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.
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
> 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.
one of the JSX designers answered your entire comment before you even wrote it: http://blog.vjeux.com/2013/javascript/jsx-e4x-the-good-parts...
Also, you somehow managed to imply that JSX makes it impossible to use sweet.js macros. There's a sweet.js implementation of JSX, so that's absolutely bollocks. https://github.com/jlongster/jsx-reader
>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.