points by bastawhiz 11 years ago

So..uh...this was a thing. And nobody wanted it. So it was deprecated and killed. See the "Prior Art" section at the bottom of the page.

http://en.wikipedia.org/wiki/ECMAScript_for_XML

Brendan Eich was quoted as saying something along the lines of "E4X is crazyland". Parsing it is hard as hell to do right. Think of all the tooling that's out there for JavaScript right now that will either a.) not support JSX code or b.) bloat up beyond belief as it takes into account the suddenly absurd requirements necessary to deal with a similar-but-not-quite-XML-or-even-HTML-for-that-matter syntax. Oh, you want to lint that JavaScript? Bless your heart! You want to add syntax highlighting? Love will find a way. You want to use other static analysis tools, sweet.js macros, or anything else non-trivial? How cute!

So essentially, it's a great way for Facebook to push React.js without making React.js a standard.

grrowl 11 years ago

JSXHint exists[1] and works well, and highlighting libraries exist[2]. Have you actually tried the syntax? It makes sense when used with React.js (which is quite lovely), as almost all of the new syntax exists within a render() function. It's also leaner syntactically than EMCAScript for XML, without introducing additional weirdness like "object.@items" selectors.

Work with both JSX and regular JS in React and you'll see why they're doing this.

[1]: https://github.com/STRML/JSXHint

[2]: https://github.com/reactjs/sublime-react

nnethercote 11 years ago

> So it was deprecated and killed.

I had the pleasure of being the person who removed support for it from Mozilla's codebase: https://bugzilla.mozilla.org/show_bug.cgi?id=788293. Over 11,000 lines of code removed. Everyone on Mozilla's JS team was happy to see that code gone, because it had caused endless problems over the years.

I gained even more joy when I discovered that this removal had temporarily inconvenienced the NSA: https://bugzilla.mozilla.org/show_bug.cgi?id=788293#c74.

coldtea 11 years ago

>So..uh...this was a thing. And nobody wanted it. So it was deprecated and killed.

So was Harmony. And then it was ressurected.

>Brendan Eich was quoted as saying something along the lines of "E4X is crazyland"

I don't think Brendan Eich has his finger in the pulse of the modern web, so to speak.