
JavaScript once had a JSX-like syntax called E4X - jekrb
https://developer.mozilla.org/en-US/docs/Archive/Web/E4X_tutorial/Descendants_and_Filters
======
vjeux
I wrote a blog post a while ago about how JSX relates to E4X if you are
interested: [http://blog.vjeux.com/2013/javascript/jsx-e4x-the-good-
parts...](http://blog.vjeux.com/2013/javascript/jsx-e4x-the-good-parts.html)

------
mccr8
One bit of E4X trivia: a bug in the Firefox E4X implementation was taken
advantage of by an exploit called "EgotisticalGiraffe", according to the
Snowden documents. The implementation of E4X in Firefox was large and complex.

[https://www.schneier.com/blog/archives/2013/10/how_the_nsa_a...](https://www.schneier.com/blog/archives/2013/10/how_the_nsa_att.html)

~~~
luke_wagner
Related: [http://mozillamemes.tumblr.com/post/20381316930/inspired-
by-...](http://mozillamemes.tumblr.com/post/20381316930/inspired-by-a-bugfix-
which-caused-a) [http://mozillamemes.tumblr.com/post/22247147806/desperate-
ti...](http://mozillamemes.tumblr.com/post/22247147806/desperate-times-
require-desperate-measures)
[http://mozillamemes.tumblr.com/post/19721622462/no-matter-
ho...](http://mozillamemes.tumblr.com/post/19721622462/no-matter-how-many-
unstoppable-forces-appear-e4x)

------
midnightmonster
In 2008 I built a production website in Helma (server side JavaScript
framework running on Rhino, JS on the JVM) with E4X for the view. You could
say I've been waiting for React for a long time. Also that I used way-too-
niche technology for a one-off project. :-/

~~~
tannhaeuser
Avantgarde rather than niche I'd say.

Helma, v8cgi and co. pioneered server-side JavaScript and around 2010 inspired
CommonJS for portability, which Node.js became the dominant implementation of.

I believe Netscape's original web server product featured JavaScript as
server-side scripting language back in 1995/6 already.

~~~
rurban
And the TU-Graz Hyper-G system => Hyperwave, which was very popular in the
early internet days. It preceded WWW and Netscape by a bit.

------
Marazan
E4X was part of Actionscript 3. It was very nice.

~~~
jadbox
It was also widely used for Adobe Flex for making Flash interfaces.

"Everything old becomes new again."

~~~
bbcbasic
I quite loved my small stint developing in Adobe flex. I have to admit it.

~~~
lscharen
I share that sentiment. The complete decoupling of UI presentation and logic
all the way up to and through asset deployment via Flex Skins was interesting
and had a lot of potential.

------
ads1018
Would be nice to see JSX syntax become standardized. Clearly lots of people
like it.

~~~
Touche
How would that work in practice, though? Using Babel JSX gets compiled to
React.createElement('div', null, {}). You can configure babel to output
something else if you use something other than React.

So what would a standardized JSX syntax output? It can't be
document.createElement since that is a web API and not a generic JS API. So
what would it do, exactly?

~~~
tolmasky
I've written an in depth blog post on "generic jsx", which turns JSX into
function bind/currying syntax that would work fine in any framework (or not
framework at all, as we currently use it).

[http://tolmasky.com/2016/03/24/generalizing-
jsx/](http://tolmasky.com/2016/03/24/generalizing-jsx/)

We use this generic-jsx in DemoKit:
[https://github.com/runkitdev/demokit](https://github.com/runkitdev/demokit) ,
and it's really cool because you can do fancy stuff like:

    
    
          // Curry your JSX tags!
          const wordmark = <span style = "font-face:custom; font-weight:bold" />;
    
          .... <wordmark>hello</wordmark>

~~~
blablabla123
That would be actually super useful. JSX became for me the best part after
writing React applications for quite a while. Performance-wise not using React
is actually faster ^^ (If you take care of the dirty updating work of course)

6 years ago I wrote a proof of concept to replace a large Rails application in
pure JS using prototypes and constructing the html from strings. The latter
turned out to be the most messy part so I stopped that and rather refactored
the legacy Rails code to do something useful.

Could be really great for super lightweight JS apps!

------
nthcolumn
Fb says:

Prior Art # The JSX syntax is similar to the E4X Specification (ECMA-357). E4X
is a deprecated specification with deep reaching semantic meaning. JSX
partially overlaps with a tiny subset of the E4X syntax. However, JSX has no
relation to the E4X specification.

------
oomkiller
If you've ever used Mirth[1] then you've used E4X, for better or worse
(usually the latter). It's still used very heavily inside of the transformers,
even though Mozilla deprecated it years ago.

[1] [https://www.mirth.com/](https://www.mirth.com/)

~~~
HNcow
Haha came to the comments looking for this. Mirth is love, Mirth is life.

------
tootie
Wait till they find out where "use strict" came from.

------
samuel
Yes! I use it from time to time in applications which have rhino as its
scripting language(mirth connect and Orion's rhapsody, mainly).

------
abalone
Yes, this was back when the web was all crazy about XML as a _data transfer
format_ (redundancies and all). The goal of E4X was to make that data format
easier to work with. JSON spelled the end of that.

JSX is more about XML as a development syntax, which makes more sense.

------
dkarapetyan
Anyone remember Yahoo Pipes? I wrote some flows at some point and used E4X. It
was fun.

~~~
peteforde
So far ahead of its' time.

I was at their launch at ETech in like 2005?

~~~
trolliloquy
> So far ahead of its' time

Or, JSX is so backward, behind its time?

------
riffraff
I remember using this in a Firefox addon. Always seemed like a nice thing, but
sadly it never became widespread.

------
azernik
Note that this is rather old (2013).

------
nilved
I wonder what made JSX seem like a good idea then.

~~~
hyperpape
The post explains a bunch of things that JSX does better. A heck of a lot of
successful ideas look just like something that was tried before but without
the one restriction that made that thing fail.

------
maxpert
Hahahaha so interesting, I posted it few days back on reddit :P and now it's
here

