Beads: Computer language and toolchain
101–110 of 235 posts
Re: Beads: Computer language and toolchain
#102Re: Beads: Computer language and toolchain
#103yesno datatype with values Y, N, U or ERR ¯\_(ツ)_/¯
And the example is weird: it explicitly explains you can do with fewer tests if the value is not true. Multiplication by N,U,ERR silently gives 0 as a result. So multiplication by an ERR is not an error (from what I understand from quickly reading the ref).
``` 3 * ERR yields ERR 3 * U yields U (3 times undefined yields an undefined value) ```
The mathematical truth tables are in the appendix of the reference manual.
It is quite useful in a language to have a universal bottom value (undefined) and a universal top value (error). The key point is to avoid undefined behavior
Re: Beads: Computer language and toolchain
#104I think this project is really cool and am disappointed by so many of the negative sounding comments. They kind of remind me of the infamous Dropbox comment. I think some healthy skepticism is fine but the mockery and out of hand dismissals seem like they should be beneath this crowd.
Re: Beads: Computer language and toolchain
#105This seems like the brain child of one ambitious smart person that still needs to receive feedback from the outside world.
We need these kind of experiments. If you learn too much about contemporary software engineering, then it is almost certain that you'll end up with a React front-end talking to a NodeJS/Java back-end hosted on Kubernetes. Which is obviously the right thing most of the time :) but the world is richer because of these super-ambitious, super-naive experiments. Also: imagine how much has someone learned from implementing…
The author used to at least actively solicit feedback, I never once noticed acknowledgement of any of it though.
Re: Beads: Computer language and toolchain
#106- promises far fewer bugs - promises to replace entire stack - ...and Excel - "declarative languages have almost no bugs" - built-in database Yeah color me skeptical. I love experiments, but I prefer those that under-promise and over-deliver. People have been promising unification languages since there were only two languages. People have been promising cross-platform since there were two platforms. And people have b…
The thing that really bothered me was the FizzBuzz example [0]. The core logic is: cell // this routine will be called 100 times, and the implied block variable // b will hold values, like the sequence number b.cell_seq var ss : str case mod(b.cell_seq, 15) | 0 ss = "FizzBuzz" draw_rect(fill:LIGHT_SKY_BLUE) | 3, 6, 9, 12 ss = "Fizz" draw_rect(fill:LIGHT_GREEN) | 5, 10 ss = "Buzz" draw_rect(fill:YELLOW) else ss = to_s…
You could express it also as an empty string, then concatenating as necessary: ''' // to those objecting to using a modulo-15 test, // we could have done the above code as follows: var ss = "" if mod(b.cell_seq, 3) == 0 "Fizz" &=> ss if mod(b.cell_seq, 5) == 0 "Buzz" &=> ss if ss == "" ss = to_str(b.cell_seq) '''
The problem with FizzBuzz as a programming language exploration is that it is far too short of a program to reveal the totality of a language, since it only consists of using the if/pattern match capability, modulo function, concatenating strings, and converting an integer to a string. The Stock market ticker program is a much better demo of the language, because it shows how to do client/server programming in a very easy way.
Re: Beads: Computer language and toolchain
#107Earlier quoted context omitted.
We need these kind of experiments. If you learn too much about contemporary software engineering, then it is almost certain that you'll end up with a React front-end talking to a NodeJS/Java back-end hosted on Kubernetes. Which is obviously the right thing most of the time :) but the world is richer because of these super-ambitious, super-naive experiments. Also: imagine how much has someone learned from implementing…
Matter of perspective I admit but it also could just be a weird pastiche of elements of C, COBOL, M, Ada, and JavaScript. Nothing here seems particularly ambitious really.. idiosyncratic however. A good counterpoint might be Go. The author used to at least actively solicit feedback, I never once noticed acknowledgement of any of it though.
User suggestions and bug reports are promptly followed up on. There are almost no known errors at this point, so it is very good shape.
You are correct that it has elements of JavaScript, but that is inevitable given that the primary output of the transpiler is JS code for use on the web, so some JS functions have to be present for that to work, and to inter-operate with JS, one has to use their string system.
The attempt to offer an integrated programming system, where we return to the simplicity of VB6, or Borland Delphi, is actually quite ambitious, as in order to offer such an integrated product one has to build in a database (graph in this case), a layout engine (novel, Renaissance proportion based layout model), a drawing system, and a way of coordinating between client/server (a novel subscription to a single source of truth system, with remote procedure calls).
The language is primarily based on Modula-2, which the author of Beads used for 20 years quite successfully in large commercial products. There is nothing from COBOL or Ada that i can think of (although Prof. Wirth did contribute to Ada I believe), not sure what the M language is. There are some elements of PROLOG built in that are not readily apparent, as the core programming pattern is State-Action-Model (see sam.js.org), and if you change a state variable, then any drawing code that used that variable is scheduled for refresh.
Re: Beads: Computer language and toolchain
#108Earlier quoted context omitted.
// this shows a persistent value FizzBuzz grid // whatever cell you pick is remembered for a month Wait, what?
Given the implementation is `cookie_write(KEY, my_state, duration:1 day)` I am fairly sure even this example has a bug.
Classic FizzBuzz is just too simple a task to show off any language features, so the task was souped up so that it draws a 10x10 grid of the results, and lets you pick one of the 100 cells to highlight.
It persists this selection for a day to show how one can save up to 1kb of state information trivially inside the browser's cookie system, which is simpler to use than the IndexDB database (which is also available to use if you wish).
1Kb is enough to store a reasonable amount of data, and since Beads has a built-in graph database (not as fancy as Neo4J), you can store a subtree into the cookie with one line, and no encoding/decoding necessary, as that is performed by the runtime library for you (a nicety).
The convenience of working with a graph database internally, instead of the typical collection of data structures that one sees in older languages such as scalars, tuples, lists, dictionaries, queues, and pointers, is an advantage that only becomes apparent after some use of the language; i encourage you to take it for a spin.
Re: Beads: Computer language and toolchain
#109"Some people, when confronted with a problem, think 'I know, I'll u̵s̵e̵ ̵r̵e̵g̵u̵l̵a̵r̵ ̵e̵x̵p̵r̵e̵s̵s̵i̵o̵n̵s̵ invent a new programming language that will unify everything.' Now they have two problems."
Haxe already exists [1] to unify everything, similar to beads' claims. It doesn't.
Unifying has been done better before with it, C (it does run almost everywhere!), Java, Flash/Flex, and JS+HTML. Many have entered. Few win for a little while, and eventually everything loses.
Re: Beads: Computer language and toolchain
#110It's very strange to me that the first pitch is that because desktops, laptops, and phones, are now all 64-bit, that is why we can now create a cross-platform language... that replaces scripting-ish languages. I could understand if this was saying the 64-bit transition made things like Zig/Rust much simpler, but this seems like a non-sequitur for what Beads appears to be for.
I'm a little confused as well. A cross-platform language can work on any platform, like I can take my C++ code and run it on 64-bit or 32-bit, and this is true with plenty of other languages as well. I don't understand the relationship there at all.