5 ms·
I can't tell if you're joking. I personally despise Lisp syntax.
by SomeCallMeTim 11y ago
I can't tell if you're joking.
I personally despise Lisp syntax.
- qwertyuiop924 11y ago...Well then, you probably wouldn't like Mithril. Typically, Mithril uses raw JS lists, function calls, and objects to create its vdom, which you have to directly manipulate. Like using react without JSX. With a lisp syntax, you might write the end of an expression as )))))), as opposed to in JS, where you might write )])]}); or something similar.
- SomeCallMeTim 11y agoI've actually been considering trying Mithril. But it's not strictly parenthesis that bother me. You're right in that )]}) is actually far more annoying. I try not to nest that deep in JS if I can help it. Arrow functions reduce the pain. Not passing array literals in function calls helps as well. Angular seems like the big culprit that injects [] into the middle of an argument list, for me anyway, and using that syntax is optional.
- qwertyuiop924 11y agoWell, mithril requires a LOT of array literals and object literals in your function calls. http://mithril.js.org/getting-started.html http://mithril.js.org/getting-started.html shows todomvc in mithril. That template would be much more compact, uniform, and readable with a lispy syntax.
- SomeCallMeTim 11y agoI see. You're right, that is somewhat ugly. I've actually considered the idea of hacking a JSX compiler to spit out Mithril output. If you're going to mix mark-up in your JavaScript, may as well do it with "real" mark-up instead of some imitation language. I'm still on the fence about whether I like mixing mark-up and code, but I'm leaning more toward at this point.
- lhorie 11y agoThat actually already exists: https://github.com/insin/msx https://github.com/insin/msx
- SomeCallMeTim 11y agoAwesome! Thanks for the link. It did seem like an obvious thing to do. I probably would have searched for and found this before doing any actual work on JSX, but I'm glad to know it exists already. :)
- qwertyuiop924 11y agoLisp syntax and idioms make mixing markup with code really elegant and simple. That's why I want to write mithril with lisp syntax.