I assume a hand-written a recursive descent parser would run faster, but it definitely doesn't strike me as flexible or quick to write or modify, and anything extra like incremental support or good error messages is just a lot of one-off manual effort.
It's not just different. It's suboptimal. It's just not compelling. You'd need visual everything. Like visual diff, visual git, make it easy to copy visual crap between various applications. Copy visual code to a web page? Copy it to chat to send to a friend? Instead of just writing, you'd need to remember UI shortcuts/icon to insert visual crap into your codebase...
It's bleh. I clearly hate the idea. :D
Code is not inherently visual. If you made the editor visual, then it means people who are good at abstract reasoning and solving problems but don't have good aesthetic and spatial sense wouldn't be able to "write good code".
Nor is it text. It is a tree (hence the term "abstract syntax tree"). We just save it in an awful serialized format.
Perhaps. Or it might be structural, an object to be 3d printed. It would have a physical appearance - but perhaps not be "inherently visual", any more than the algorithms for adjusting a quadcopter for autonomous hovering is "inherently aerial"?
> people who are good at abstract reasoning and solving problems but don't have good aesthetic and spatial sense wouldn't be able to "write good code".
Isn't that the case with textual representation of code too? Without a sense for aesthetics, one cannot create "beautiful code"?
A chessboard/game can be represented in many ways in the form of code/syntax - even mathematical equations - and yet I would argue it is less accessible to learn and play chess going from just the standard textual representation, than from a board?
How would you teach chess moves: by lifting a castle off the board, showing that it can move up-and-down and sideways, like so - or by saying that the piece-instances initialized to position a1,a8,h1 and h8 can move only be changing either of its two coordinates up and down?
[0] Of course, my opinion.
Sadly, it also suffers from the usual problems of LL parser generators, like barfing on left-recursive grammars.
http://www.tinlizzie.org/ometa-js/#Sample_Project
Note, you need to select all before trying "do it"/"print it". See eg: the js compiler (top right, second drop down).
I dare you to not find it so easy and fun that you don't try to implement a small DSL ;)
https://ohmlang.github.io/editor/
Ohm is the successor of Ometa. The editor shows which portion of the string are matched by each rule.
https://github.com/melling/ComputerLanguages/blob/master/com...
Or, if you care about efficiency, Haskell.