News for hackers. Stuff that matters.
Re:Maud: A Rust macro for writing HTML by deepstack on Tuesday June 07, 2022 @08:06AM (#31652945)
Hmm, I think a long time ago (around 2005 or 2006) JSX was briefly considered to be party of ES standard. It didn't make it, and shortly after FB introduced React.

Think it may have being easier if JSX is just included in ES as a standard. So yes and no, JSX introduced by FB via react is a just a syntax sugar, however the original JSX is a meant to be a ES standard, with each node as a tree structure.

https://www.ecma-international.org/publications-and-standard...

Re:Maud: A Rust macro for writing HTML by lucideer on Tuesday June 07, 2022 @08:10AM (#31652988)
You're describing E4X. E4X and JSX are both XML-inspired syntaxes, but beyond that have relatively little in common in how they function.

E4X was supported by Firefox for a while, but I think support was removed.

Re:Maud: A Rust macro for writing HTML by jraph on Tuesday June 07, 2022 @08:27AM (#31653182)
The way I see it, syntax sugar can be part of the language proper.

For instance classes in JS are sugar syntax to define a function that defines fields in this and prototype members of this function.

Arrow functions are sugar syntax to define functions bound to a specific this.

async / await is sugar syntax for promises.

for..of is sugar syntax for iterating over an iterable.