Hacker News new | past | comments | ask | show | jobs | submit login

Maybe I'm just an idiot here (haven't really used JSX outside of React) but what would you consider spiritual alignment to s-expressions? There's a lot of baggage that comes along with them, and Hiccup carries some but not all, but at the end of the day Hiccup is actually composed of literal s-expressions.



I hoped I explained the position clearly in the first place, but I’ll try again. Ultimately Hiccup is hyperscript in Clojure syntax. It’s literally s-expressions, yes, and insofar as that’s true so is JSX compiled to h or equivalent. But JSX’s compilation target is undefined until specified by the developer, and like a lisp DSL it can be and often is compiled from its list structure into semantically very different computations. Again, all possible with Hiccup, but at least from what I saw when I worked in Clojure that wasn’t typically the case, it was almost always a very direct 1:1 mapping to hyperscript. Which is fine, it’s a good model for rendering UI! I just think it’s fascinating that I see more application of the advantages of lisp (macros, DSLs, creative/clever optimization of using and computing essentially a list of symbols) in the JSX space.


For others following along at home who haven't heard of hyperscript before, you can track down leads by searching for react-hypescript - otherwise you'll endup at https://hyperscript.org/docs/ which seems to also be a html/js system but not what is referred to here.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: