3 ms·
> That’s what Lua was made for. Idk why I would “<choose><jsx></jsx></choose>” over “choose { lua }”. React was made for web developers. Most web developers k
by diggan 3y ago
> That’s what Lua was made for. Idk why I would “<choose><jsx></jsx></choose>” over “choose { lua }”.
React was made for web developers. Most web developers know HTML already. Many of them probably know Lua too, but not as widespread as HTML-knowledge.
JSX is basically HTML in JavaScript, so it's easy because it's familiar. The reason for JSX is to make DOM creation in JS more like DOM creation in HTML.
- wruza 3y agoIn my opinion, HTML and XML would benefit from being a Lua table with Lua strings too.
- diggan 3y agoMy opinion is that most developers would be better off if they just started using lisp-like languages instead. Use Fennel if you really have to use Lua.
- wruza 3y agoLisps are much more loaded with implicitness around all sorts of brackets, which makes them non-friendly for semi-programmers. This is less important in our usual industry that is motivated to hide as much as possible behind a paywall, but I’m a strong follower of “anyone wielding a keyboard should be able to program” ideology. That said, historically lisps are the most featureful runtime-wise. It’s a real shame we hide behind our complexity but collectively chicken out before really powerful concepts lisps introduced.
- slmjkdbtl 3y agoYou need to invent and build non-trivial systems to compile JSX, while you only need a couple lines to make a mithril.js style hyperscript h() without the need for a compiler, and you get variables, loops / array maps etc for free since you're writing normal JS.
- diggan 3y agoSure, I'm not arguing for everyone to use JSX (I personally use Reagent/Hiccup in ClojureScript most of the time, which are just built-in vectors (arrays) basically). I'm just explaining to someone why people chose JSX in favor of X, when they come from a HTML/CSS/JS background.
- slmjkdbtl 3y agoYeah that's fair! Everyone has their own way to do stuff