web oriented universal language

EcmaScript 4 and the Web

Posted on 2007-11-03 by Nicolas Cannasse in General

Recently was published a proposal for extending the current Javascript language with a good set of new features : classes, optional type system, and a lot more. This proposal is known as EcmaScript4 (ES4) and was built by the TG1 discussion group composed of representatives from Mozilla, Adobe, Opera, Microsoft, and maybe a few others.

While things were going smoothly up to now, there is currently a quite big debate among some of the TG1 participants and other people from the Javascript (JS) community (see the whole public discussion if you have free time).

Why this may seem a bit technical, it can have a lot of impact of our (web developers) life.

Stakes

At first, and in order to understand the situation we are in, there are different kind of conflicting interests at stake, so let's try to sumup a little bit :

  • Mozilla is pushing for big changes : they are big users of Javascript : a lot of their applications are scripted with JS, they have XUL, ... More language features would help them in their everyday work. And surely they would be happy if ES4 would become the standard for web development.
  • Adobe fully supports Mozilla in this push for ES4. For some time now, they are targeting developers with their new products and want people to forget about the whole "proprietary plaform" label that is stick to Flash. Their strategy is then to support a standardized language. They already implemented a reduced ES4 version called ActionScript3 and the Virtual Machine that runs it (Tamarin) has been donated... to Mozilla.
  • On the other side, this is exactly what Microsoft is fearing : they have been investing a lot of time and money into their own prioprietary technologies, like C# and more recently released Silverlight which is seen as a Flash competitor. They would not like to see a new language that they don't control, that was designed by an alliance of their competitors, and that (horror) doesn't run yet on .NET
  • there are fears that ES4 would "break the web" since it seems that Mozilla want to replace current Firefox JS Virtual Machine (SpiderMonkey) with a new one that would run ES4. ES4 is is supposed to be backward compatible with JS, but when you change implementation, you might get some bugs and incompatibilities anyway, since even with a lot of testing, software is rarely perfect.
  • there are others comments for people of the embedding browser market, such as Opera. For obvious reasons, their fears are more about the size of the runtime that would be needed to run ES4, memory consumption etc.
  • some JS developers prefer small-steps improvements to one big-step one. For several reasons. One is be pure conservatism, the other is that when your daily technology evolves, you feel huge pressure to keep up-to-date with the latest features. And if you read ES4 proposal, you can see that while you can write plain'old JS, the number of new features to learn is huge, and it would take a lot of time for the average JS programmer to master the language.

I hope that I didn't forget anyone opinion, I didn't include technical discussions about the usefulness of ES4 features but with that many differents point of view it seems already quite complicated.

From here, what ?

As we see, each party has more or less its own internal agenda, which is perfectly normal in an human world. But at this point, the situation is pretty blocked.

Mozilla and Adobe seems to want to push ES4 up to the end, and Microsoft will not accept it. I personaly don't care about Microsoft opinion EXCEPT that they are the ones doing Internet Explorer (IE), you know, that (still) 80% market share internet browser, the one your users are visiting your website with...

So, as developers, we're out of luck.

Mozilla and Adobe thought the same and came up with the ScreamingMonkey project, which is an ES4 runtime that can be installed for Internet Explorer. Nice, but how long will that work ? Given that Microsoft has no intention of helping, I can foresee that each IE/Windows update will break something. In short : I'm not sure it's possible in the long term to put a plugin into an application while its owner does not want to hear about it !

So, as developers, we're out of luck....

Another solution ?

Now, I'll take a bit of time to write about my own (not hidden) agenda.

haXe is a highlevel programming language that has been developed for few years now and which has a still small but growing community of users. One of the particularity of haXe is that it can compiles to Javascript. It means that you get all the benefits :

  • you are using an highlevel language with compile-time static typing
  • the haXe language let you also do dynamic stuff that is helpful for DOM/AJAX implementations
  • in the end, you are generating a .js that can be run by all current browsers
  • it's open source
  • it can interoperate with existing JS libraries
  • if you don't like it, simply use Javascript !

<irony>

So my suggestion to Mozilla and Adobe would be to drop ES4 and use haXe instead :) There's already an open source compiler available, and a Book on the language should be published soon... unless of course haXe features are not good enough, but I'm open to suggestions and discussions on this particular topic.

</irony>

And developers ?

More seriously, it's a shame that nobody asks to the main people concerned by such a decision what would they like to have. The main people here being web/JS developers, which as far as I know are not represented in the ES4 commitee.

That's actually one of the big problem I have with ECMA or W3C. Everything is decided by a group of people that represent corporate interests, then they publish a huge document which is often a bloated specification that only big companies with enough cash can afford to implement.

What was useful a few years ago in order to ensure intercompability between different proprietary vendors is no longer needed when there is one single open source implementation.

That does not remove the need for a clear specification that needs to be either respected or modified, but at least that gives additional agility in the process of designing this specification.

As a language designer, I prefer to experiment long time with a feature, then if it was useful for enough people of the community, it's added to the language. If not it's removed. That's the way software should be designed, at least IMHO.

Conclusion

So what would be wise to do now that we're here ? My suggestion would be to forget about languages, forget about syntax or features, forget about corporate wars (if possible).

What are the problems with current Javascript ? As for me they are :

  • browser apis incompatibilities
  • security
  • speed (slow)

So why not have every browser vendor sit around the table and resolve first these issues that are the ones really concerning the developers, instead of losing their time and energy in these fights ? Then, as for improving the language, I think it would be better if it was a commmunity work, since corporations can fight between them but no one has the interest to fight against the developers community.

Nicolas Cannasse

Comments

"So why not have every browser vendor sit around the table and resolve these issues that are the ones really concerning the developers, instead of losing their time and energy in useless fights."

Do you really think whether or not to extend javascript is a "useless fight"? The language that the web runs on is *the* issue. It seems to me that any other discussion pales in comparison. It always amuses my when people make the argument that when people disagree (fight) that it is useless or meaningless or not important and they should stop. Every web developer on the planet is effected by this decision which is in fact why you are blogging about it. If they do "stop the useless fighting" what should the decision about the language be. Oh I forgot they should just adopt haXe.
Posted by Hank Williams , 2007-11-03 17:11:33
Hank, you're right the "useless" word was maybe a bit powerful here. I've been rephrasing the last sentense which I hope now express better my thoughts.
Posted by Nicolas , 2007-11-03 17:25:47
You says "They would not like to see a new language that they don't control, that was designed by an alliance of their competitors, and that (horror) doesn't run yet on .NET"

I do not know whether you are speaking about ECMAScript 3 or 4. But they do have JScript.NET since a few years. And silverlight 1.1 will feature JavaScript.
Posted by Laurent Debacker , 2007-11-03 18:32:23
A couple more points, gleaned from the main discussion, you referred to.

While there are a lot of new features in ES4, there has been virtually no movement to ES for over 7 years. ES4 represents where the language should be, had it been given the same attention that it was given up until ES3.

With regard to Microsoft, the issue is not just about whether .NET/Sliverlight can run ES4 code, nor is it just that they don't control JavaScript. The problem for Microsoft is that a "grown-up" JavaScript would empower non-Microsoft developers to create content that competes with them, and seriously undermine the enormous advantage that Silverlight would otherwise have, in terms of features, robustness and adoption.
Posted by Peter Hall , 2007-11-03 18:48:44
Hi,

I'm a big fan of neko and patiently waiting for nekoML docs for a long time. Haxe I'm not interested in, precisely because I think a standardized ES4 would be better.

I also disagree with your view on screamingmonkey, Microsoft will face huge fines if they dare break third party extensions for anti-competitive reasons. Not to mention that Adobe Flash will be bringing ES4 to thousands of Windows computers come 2008/2009 - perhaps even helping distribute the IE screamingmonkey plugin. There will also be other ES4 supporting browsers available as free downloads for Windows, so IE market share isn't critically important anyway.

Finally, Microsoft business strategy has nothing to do with ES4 standardization and they filed no specific technical objections that I've seen.
Posted by whatever , 2007-11-03 19:19:39
So if a new version of Javascript is released you will include it as a target in Haxe compiler?
Posted by Miguel Serrano , 2007-11-03 19:26:35
I don't agree with that
"That's actually one of the big problem I have with ECMA or W3C. Everything is decided by a group of people that represent corporate interests, then they publish a huge document which is often a bloated specification that only big companies with enough cash can afford to implement."

within ECMA TG1 I don't think people are there to support their own corporate interest in the first place, not from I've seen in the different discussion, wiki, etc.

Anyway, a language need to evolve, you must see that with haxe, but I see no interest as a developper to have other languages evolving around ECMAScript to generate it,
I prefer the language itself to evolve, and it's what proposing the current ES4 proposal, that's why I like it.

You can not solve the "speed" problem without being within the language and its engine (and VM), you can evolve haxe as much as you want you will not make the resulting js faster,
only the engine running it can do that.

And for language design and API, I prefer a good language basis so not only people designing the language can define its evolution but also people using this language everyday can participate and reuse these features to make the whole language and API evolve, and that's also what the current ES4 proposal plan and also why I like it.

@peter hall: totally right on, Microsoft fear most of all developpers going in other directions than .NET.
Posted by zwetan , 2007-11-03 19:31:26
I double that.. but the problem is that the company that has the maximum market share of the browser market!! are they willing to sit and discuss with everyone? (not necessarily fair) business interests have always come in the way of this noble deed of finally considering the developers before going ahead with a specification.. and it seems these corporate interests will continue to do so for some time!
Thanks anyways for introducing haXe.. sounds pretty interesting.
Cheers!
Posted by karl , 2007-11-03 19:36:54
Nicolas's conclusion which was also very prominent on responses
to MS's Chris Wilson's blog
responses(http://blogs.msdn.com/ie/archive/2007/10/30/ecmascript-3-and-beyond.aspx#5788577)
is to paraphrase 'let's fix the real problems like incompatibilities first' this is of course what
we all want, but corporates won't let it happen, and that's why
haXe is so important.

haXe smooths over the differences and let's us get back to work,
with standard APIs, i.e. haXe has already fixed the REAL problem of
vendor incompatibilities.

I hope that Nicolas and Motion Twin will be able to resist
the inevitable buyout attempts from Adobe/MS to quash the only
complete independent solution to the web programming nightmare that
exists :P.
Posted by blackdog , 2007-11-04 00:14:39
"You can not solve the "speed" problem without being within the language and its engine (and VM), you can evolve haxe as much as you want you will not make the resulting js faster,
only the engine running it can do that."

Well Neko is just as prototype based as javascript, and currently twice as fast as AS3 (with my specific tests). So yes, speed can be fixed with the current language.

Actually the new Opera 9.5 has some amazing JS speed. It's about twice as fast as FireFox!
Posted by Danny Wilson , 2007-11-04 00:41:52
One thing I think everyone is overlooking, is that most developers do not want a new javascript. While I will ride to the end of the earth to convince people the benefits of a strict typesafe language, oop vs procedural styles etc, most people it seems aren't able or willing to make the switch.

I've spent tons of energy over the last 5 years trying to make this happen (well, not as much as you, but still a lot : ). I am really starting to see that most people with a real life aren't going to be along for the ride if it happens (which means it wont happen on a 'popular' format like html). This is even probably why Flash trumped java on the client in the end.

It seems pretty funny that all these factions are arguing over the spoils at this point. Err, what spoils? Johnny web can't do oop. Reality slap.
Posted by Robin Debreuil , 2007-11-04 03:19:04
to be or not to be ...

not to be, or are they " killing " themselves :

- a website build with javascript/ajax is not well classified inside a web-robot
- a website build with Flash is not well classified inside a web-robot
- a website build with haXe can have the same issue, when built in EcmaScript.

has the Task Group 1 a solution to solve this ranking problem ?

to be :

- witch language offers the lowest entrance-ticket to learn and deploy the most recent web technology, i mean all the AS3 features ?
- witch language needs less than 6 Mb on the hard-disk to develop solid web and/or desktop oriented applications ?
- witch language generates software that can be run without modifications on 3 operating systems ?

the answer is not blowing in the wind : it's the open-source haXe technology.

Michel, a stand-alone programmer who needs only simplification and efficiency.
Posted by Michel Oster , 2007-11-04 12:25:56
:: Johnny web can't do oop.

ES4 is backwards compatible. Your "Johnny web" can continue to write the same (inaccessible and usually unnecessary) procedural style, globally scoped scripts he always has.

We hear these same arguments about XHTML. If Johnny web isn't capable of running his code through validation he probably isn't capable of using text editors or spell checkers either.

I've heard enough about Johnny web, this dunce has held the rest of the class back for too long. Time to move on and accommodate these mythical individuals as best we can.
Posted by !johnny web , 2007-11-04 13:40:57
So are you saying the average html person will have no trouble jumping oop? Or that they aren't welcome on the web without an exam? Or that they are mythical, and everyone is already there? (Or that xhtml isn't a total mess, its just being held back by dunces?, lol).

I would never argue that procedural is a better way to code if you can do both, but it sure is if you can only do one. And yeah, it *better* be backwards compatible, or maybe better put, 'forward optional' : )
Posted by Robin Debreuil , 2007-11-05 01:43:15
:: So are you saying the average html person will have no trouble jumping oop?

No, I'm saying they don't need to with ES4 anymore than they did with ES3.

:: Or that they aren't welcome on the web without an exam?
:: Or that they are mythical, and everyone is already there?
:: Or that xhtml isn't a total mess, its just being held back by dunces?, lol)

You lol'd!

Babies can't write HTML, I think we should reduce element names in formal declarative markup languages to meaningless random gurgles to make it easier for them. I'll also respond to further posts by doing a literal translation from English to French. Grammar be damned; who'd expect me to bother learning French before I start writing it?

:: I would never argue that procedural is a better way to code

For 20-30 lines of script, small programs and quick experimentation I think it is. Having class based inheritance in ES4 is a win for large scale apps and as I've said, Johnny web isn't writing these.
Posted by !johnny web , 2007-11-05 11:48:07
One day the world will see the power in haXe and assimiliate, is the secret new Crockford/MS scripting language a rip of haXe? hehe j/k

I am a big fan of ES4 (it will give an opportunity to address these issues in performance and incompatibilities). I use haXe but I also use AS3 and love it. This is the problem I think it is an extremely fun language that is spawning all sorts of engines and kits far beyond what people thought possible so far. Microsoft just invested alot in Silverlight RC based on ES3 javascript. Flash being based on ES4 is a problem right now for them. I suggest they stop blocking, implement it and get back to supporting developers and reaching further. AJAX was first implemented by them. They can do things when they aren't obstructing. I just think it is a bit of delay to help 1.1 maybe start look at supporting it and what it would take to make RC1 Silverlight support it.

ES4 has some bloat (getters, setters) but is far better at OO, functional still, event model, smaller scripts, and still supports ES3. There is no reason browsers can't have a ES3 or ES4 engine for a while. As other javascript versions were updated they managed to support this.

Really I just want the best technology, the problem is people treat platforms like a religion so noone looks at the best solution. The best solution is to evolve always...
Posted by Ryan Christensen , 2007-11-05 13:51:56
I've posted a "why haxe?" document here, i intend to add more to it, but it does seem time to expand on the reasons for haxe usage given the latest disagreements in the ES4 spec process.

http://www.blackdog-haxe.com/content/haxejudo.html
Posted by blackdog , 2007-11-06 13:00:47
I think they're all missing the point...

It's the VM's that supply the functionality, while the language is the flavour that makes the cooking all the more enjoyable (or not). haXe provides all my favourite ingredients, and then some, but that's because I'm from a predominantly Flash background, and haXe is oh so similar to ActionScript. If haXe were more like OCaml, I'd probably not have ventured near it.

The point I'm making, is it's fine for corporations to sit in a room and work out what the new standardized language specifications are, but there's issues with their process...

1) I didn't get to say how I feel about their decisions, so if I didn't, neither did my mate Joe Public, and if he didn't, who's this darn standardization treaty for? It certainly isn't us!

2) A standardization for what exactly? What's wrong with the old standards? Who are they trying to convert? About the only wet underwear we'll find from all this will belong to the purists who swear loyalty to such corporations, and that certainly isn't me (there I go again with the selfishness).

3) Agreeing to a new language standardization isn't going to get me some new feature that will solve intersteller transportation. About all it will do is increase revenues on Amazon as everyone buys some new book about how to use this darn new dialect! (Btw, I don't feel the same way about the new haXe book which does give the secret to intersteller travel**)

4) As has already been mentioned in one form or another, how on Earth do these corporations make any money when they're obviously missing the crucial elements? Namely, how can they better the virtual machines that parse all this code in the first place? It's fine having a new language, but if I'm coding for the JS VM that came with IE3, then what point is there in adopting this new language?

Conclusion: Nicolas is one of the few that can manage to see further than the collective head knocking of those in corporations who spend more time dunking biscuits in board meetings talking about nothing in particular, than actually addressing the issue at heart. If these corporations had a mind (at all) to concentrate on unifying the existing technologies, that themselves are powerful enough for most major tasks of todays commercial market, then we'd already be seeing a more productive market place, where all developers can live in harmony, happily smoking weed and reminiscing about the old days when POKE was a keyword to be feared.



**The haXe book only provides the secret to using the tools that may or may not aid in discovering the secret to intersteller flight. All characters in this post are fictional and any similarities to those living or dead is purely coincidental
Posted by Lee McColl Sylvester , 2007-11-14 15:33:28
Food for thought, from the Peanut Gallery, Caveat Emptor and all that...

I didn't understand in the late 90's, and I don't get now, how a Web Display Technology that has Images/Audio/Video as third class data types became so important. These technologies do a good job with text, but give the middle finger to the visual, audio and interactive experience on the web.

http://samfeltus.com/kudzu/Nanoprogramming_podcast.html
Posted by Sam Feltus , 2007-11-30 20:43:18
I took the liberty of posting a link to the discussion here: http://channel9.msdn.com/ShowPost.aspx?PostID=368742#368742
Posted by Bent Rasmussen , 2007-12-28 16:11:03
FYI: The ES4 language, presented by Waldemar Horwat
http://www.youtube.com/watch?v=-yDS1eGfuWQ
Posted by Bent Rasmussen , 2008-01-25 21:29:17

Post a comment

Name:
Email:
Url:
Security: Please enter 3453 here.
remember me
Comment:
 
 
Haxe Powered Rss flux Valid XHTML 1.0 Valid CSS