from Hacker News

JavaScript once had a JSX-like syntax called E4X

by jekrb on 3/18/17, 11:31 AM with 48 comments

  • by vjeux on 3/18/17, 4:16 PM

    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...
  • by mccr8 on 3/18/17, 6:37 PM

    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...

  • by midnightmonster on 3/18/17, 4:58 PM

    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. :-/
  • by nthcolumn on 3/19/17, 12:20 AM

    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.

  • by Marazan on 3/18/17, 4:26 PM

    E4X was part of Actionscript 3. It was very nice.
  • by ads1018 on 3/18/17, 4:43 PM

    Would be nice to see JSX syntax become standardized. Clearly lots of people like it.
  • by oomkiller on 3/18/17, 5:37 PM

    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/

  • by tootie on 3/19/17, 1:26 AM

    Wait till they find out where "use strict" came from.
  • by samuel on 3/18/17, 4:56 PM

    Yes! I use it from time to time in applications which have rhino as its scripting language(mirth connect and Orion's rhapsody, mainly).
  • by abalone on 3/18/17, 9:54 PM

    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.

  • by dkarapetyan on 3/18/17, 5:12 PM

    Anyone remember Yahoo Pipes? I wrote some flows at some point and used E4X. It was fun.
  • by riffraff on 3/18/17, 4:13 PM

    I remember using this in a Firefox addon. Always seemed like a nice thing, but sadly it never became widespread.
  • by azernik on 3/18/17, 4:23 PM

    Note that this is rather old (2013).
  • by nilved on 3/18/17, 4:22 PM

    I wonder what made JSX seem like a good idea then.
  • by maxpert on 3/18/17, 9:01 PM

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