Hey everyone. I've been quiet for a while, but I finally have something to show for my time working on my language Mech the last couple of months. Last I showed it off here I had a video demo of a bouncing balls program. Shortly after that video I tore everything out and made a more realistic runtime. After about 4 months of work I'm back to where I was then, feature wise, but now the foundation is more stable and you can actually play with it in the browser:
http://mech-lang.gitlab.io/try/
Click compile and the bouncing ball program compiles. Then click start timer to set the balls in motion. You can click in the canvas area to add more balls. Click pause to stop them. Step forward and back moves through the transaction history.
I don't really have a user guide done yet, but I have a list of expression that I know work, so you can get an idea of what's possible from this:
https://gitlab.com/mech-lang/syntax/blob/master/tests/compiler.rs
The main idea is that each block of code reads from or writes to a set of global tables, denoted by hashtags. When all the input to a block is available, that block will execute the operations defined therein, and then writes data out to the global tables with a set operator
:=
. Blocks re-execute every time its inputs change, providing a reactive, live feel. You can also gate a block's execution on a specific column with the
~
operator, which will cause a block to run
only if the associated column changes.
Right now, there are a ton of language features I haven't implemented yet. What I have implemented are basic math, operators, some inequality operators, logic operators, table construction syntax, and indexing operators. I'd like to make sure these operators are rock solid before I move on to anything else. I'm hoping some intrepid people here can test drive what I have now to find cases that don't work. For now, you can see program output in the Chrome console by clicking on "View Core". If you find any code that explodes or produces unexpected output, please let me know by filing an issue here:
https://github.com/mech-lang/mech/issues