Re:Angular 2 versus React
by qwertyuiop924 on Wednesday January 06, 2016 @10:05AM
(#10850821)
Well, mithril requires a LOT of array literals and object literals in your function calls. 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.
[ Parent
| on HN ]
Re:Angular 2 versus React
by SomeCallMeTim on Wednesday January 06, 2016 @04:09PM
(#10853796)
I 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.
That actually already exists: https://github.com/insin/msx
Re:Angular 2 versus React
by SomeCallMeTim on Friday January 08, 2016 @02:20PM
(#10867452)
Awesome! 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. :)
Re:Angular 2 versus React
by qwertyuiop924 on Thursday January 07, 2016 @08:30AM
(#10857752)
Lisp syntax and idioms make mixing markup with code really elegant and simple. That's why I want to write mithril with lisp syntax.