Syntax is the Problem
mike at lew42.com
Sun Nov 5 13:22:52 UTC 2017
Raul-Sebastian Mihăilă just made a post here about some mixin syntax. I
didn't read it (sorry).
But, it got me thinking about a concept I've been thinking for years: *syntax
is the problem*, and there's a better solution.
If you define syntax as a human <--> computer language (a human-readable
and computer-readable form of text), you necessarily need a very strictly
defined syntax. One missing curly, and you're f'd.
Duh, we all know this. Hang onto your pants for a second, let's explore an
What if we edited scripts more directly in AST form (abstract syntax
tree). Developers could implement their own UI to manipulate this AST.
There are many, many benefits to this, I'll get to in a second.
First, let's remember what everyone in the JS community is doing right
now: running their code through transpilers. (I refuse to do this, that's
why I'm unemployed - I strongly dislike the concept). What is a
transpiler? It's an unofficial middleman that interprets the syntax,
converts it to an AST, performs transformations, and then returns the AST
to syntax form.
Suddenly, scripting in AST form doesn't sound so crazy.
Clearly, you wouldn't be writing JSON. We would be using a GUI to create
the AST. And this is the greatest benefit: moving away from *syntax*, and
moving to a GUI.
Then, instead of babel plugins that provide alternative *syntax*, you could
have plugins that provide alternative *experiences.*
What would designing a class look like, if using a GUI?
1. Click [ create new class ]
2. Click [ add new method ]
Or, click the [ extend ] button next to an existing class...
This is the future. I have to go eat breakfast, but I'd love to discuss
this future if anyone is interested...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss