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

Since JS is the only thing you can actually use[1] in a browser you can argue that anything that runs in the browser is syntactic sugar (and in fact, Typescript is syntactic sugar).

A less flippant analogy might be macro support in Rust. It's clearly part of Rust, but the syntax is completely different and it requires IDEs to have completely separate processing just to handle it. I wouldn't consider that to be mere syntactic sugar either.

[1] Yes, yes, wasm




JS and JSX are isomorphic (in the mathematical sense) hence why JSX is considered just syntactic sugar.

JS and TS aren't isomorphic (there's no inverse morphism once you go TS->JS that can bring the resulting JS back to the original TS) hence why TS is a different language (even if a superset of and compiled to JS).


> JS and JSX are isomorphic

They are not

Or, if they are, they are in the same way of a custom XML templating language that can be translated to a specific javascript library implementation and then back to XML

In the same way, is Mustache isomorphic?

    "{{title}} spends {{calc}}"
can be translated to

    `${title} spends ${calc}`
and back to

    "{{title}} spends {{calc}}"




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: