Comment #67 on issue 235 by [email protected]: Support the Javascript E4X extension
http://code.google.com/p/v8/issues/detail?id=235

Someone pointed me to this thread and since it seems like this venue has pretty much lost all sense of bearing to v8 and turned into a discussion on the future of E4x I wanted to chime in.

I was the author of the nodejs-users thread linked in the comment above, and I've since changed my stance on E4X and have done some work which I believe will sate the desire for E4X.

Here is the latest thread on this subject:
http://groups.google.com/group/nodejs/browse_thread/thread/f451fbd78ef153ea

I realized that E4X is trying to do too much. It attempts to solve the problem of /consuming/ XML in addition to /producing/ XML. I think it got a lot of things right with regards to producing XML, but really fumbled when it comes to consuming XML. The API is bloated, hard to grasp, and adds a lot of superfluous syntax. Additionally the need to consume XML has already been solved in user-land, and more elegantly to boot. There's SAX and DOM parsers which are both great for reading XML.

Producing XML is a different beast, though. There's still nothing that beats for E4X for this. I believe XML literals are the best solution by far. I think when people think of "E4X" they think of the bloated spec and get a sour taste in their mouth. But if you look at just "E4X: The Good Parts" there's actually something very valuable there. Thus I abandoned my effort to bring E4X to NodeJS and instead focused on bringing only XML literals to NodeJS. You can find this new project here: https://github.com/laverdet/js-xml-literal . It is still implemented with desugaring, however it is a subset of E4X's syntax. It converts all XML literals into function calls which can be implemented in userland. Included is a very simple virtual DOM simulator for constructing XML trees ala E4X, but there's also an environment that can operate directly on an existing DOM. So you could use this today to get XML literals working in IE6, for instance.

I haven't had much time to work on js-xml-literals lately as I've been focusing on my other project (Fibers in NodeJS), but hopefully soon I can polish what's there and make it easier to get into. Anyway, I'll get off my soapbox here. Not trying to self promote or anything, I just figured a lot of the users on this thread might find that there's better solutions to the problems they're trying to solve.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to