haXe Judo
haXe is a web oriented programming language, in the sense that the compiler targets Flash and Javascript/DOM, there is also a server side target for the Neko virtual machine (which is written by the same author as haXe, Nicolas Cannasse). Yes, that's right, one guy has written a new language and libraries for 3 separate platforms!
haXe has been ahead of the pack by providing strong typing in Javascript environments, yet allowing you to escape typing when required. haXe is fully object oriented providing classes, interfaces and generics but also type inference (only now being deployed in C# 3), first class functions and closures, and a variety of useful typing features. haXe also provides cross platform standard libraries and a means to create your own so there's great potential for code reuse.
I could go on, with the merits of the haXe language, but this post is about why I think, against all odds, haXe will be a success.
All languages are destined to become marginalized, and haXe's innovative lead in providing the best of functional/procedural worlds is being diminished by the introduction of Ecmascript 4, which provides all of the facilities of haXe more or less. Let's not forget the other main players; Silverlight and JavaFX
So that I'm not accused of not seeing the whole picture and being naive here's the playing field
haXe + community effort
vs
Adobe + community effort
Mozilla + community effort
Microsoft + community effort
Sun + community effort
Oh dear, maybe I can still be accused of being naive; it does look a little stacked, where would you put your time and money? A small platform focussed on direct benefits for the developer or an army of competing giants with competing standards?
When it comes to my daily bread and butter I'm betting on haXe as my language and "platform" of choice. Here's why.
What is haXe
haXe is a compiler, it takes source in haXe syntax and produces output in one of, right now, 3 formats, Javascript, Flash 6,7,8 and 9 (and actionscript 3 source) and Neko source. Is the language complete? Nicolas Cannasse has already outperformed all the other guys put together, ES4 and C#3 are coming to the same place now, Java in it's current incarnation is old school. Brendan Eich thinks highly of NC's work (a long and interesting read).
haXe is a set of cross platform libraries. Using simple #if technology, haXe implements a set of standard libraries across all platforms, these libraries include reflection, collection classes, xml, date/time, basic type conversions etc. This is important, haXe doesn't attempt to reinvent the wheel, haXe reuses the standard library facilities of the base platform and wraps them up.
NC was smart, he realised it wasn't possible to create an entirely new platform, that's a huge amount of work, and takes teams years to do. Instead haXe leverages what exists.
haXe is no model of computer science purity, e.g. Smalltalk, it doesn't try to provide it's own universe for you to live within, e.g. Java, it doesn't try to lock you in, ... ahem ... , it innovates by providing the simple tool, a compiler, that is the key to any number of universes thay may exist. So right now, haXe is a "web oriented programming language", but there's nothing to stop the compiler targeting .NET and the JVM. In fact simple experiments by Franco Ponticelli using Rhino, we can already have haXe generated JS running on the JVM, but haXe could generate source or bytecode, as time permits.
Pragmatism is the most significant aspect of haXe. Don't try and compete with Adobe, MS or Sun, but provide a unified interface to their efforts via a tool that is very flexible and able to adapt to different environments. It's very judo'ish in fact. Don't take the full force of the marketing hype from any one of these behemoths, simply adapt to whatever they do and use their own weight against them, in this case their platform. This i think is something unique. Other platforms "lost" the mindshare war (Smalltalk and Lisp?) due to a conceptual integrity that could not bend with the latest fad - haXe can.
Right now the prevalent vehicle for animations on the web is Flash, and haXe has demonstrated it's ability to change with the underlying platform by now compiling optimized Flash9 bytecode and providing an interface to the new Flash9 DOM. It works! If Silverlight becomes prevalent (as MS would have you believe), it's really no stretch of the imagination to see haXe targeting that platform. When Tamarin becomes available NC has already done the work required for targeting it.
Good Intentions
Ecmascript4, Silverlight, JavaFX ... whatever next ...
It's started already of course, the war of standards, bad vibes by various parties, the grab for market share, the endless stream of "10 reasons why X is best" etc. See Brendan Eich's latest news.
And you ... the developer in the middle wondering where to focus, where to put your precious time? Are you a winner or a loser? Were you perspicacious enough to see all the angles?
Unlike the Judo of haXe, the other contenders are taking the road of heated debate, head to head, as corporations do and must. They will inevitably muddy their waters and provide competing standards, because it's simply not in their interests to do otherwise. This is obvious to anyone who's been in the industry for any length of time so I don't need to labor it.
And this brings me back to my playing field table on page 1, it looks stacked in favor of the other platforms, but, when there's endless internecine warfare backed by huge marketing budgets and FUD, then I believe it's an open question about which platform is left standing - maybe the insignificant one- the Claudius if you will.
Frankly, I think it speaks volumes that Nicolas Cannasse has achieved as much as everyone else put together. For the nerds among us, it's like Legolas against the Oliphant in the movie, it doesn't matter what you do, you'll simply be out manouvered by a far smarter, focussed and nimbler opponent (although I don't believe Nicolas has pointy ears). For even greater nerds, it's a bit Gnu'ish, don't play by the same rules, create your own ecosystem which will continue to exist even when the corporations have decided otherwise.
Conclusions
While the other players slog it out in their model of the universe, haXe will adapt, providing the tools programmers require to access any of the prevalent technologies - therefore you can code new cross platform libraries and know they will still be relevant in time. The only "small" issue is if haXe doesn't support your platform, well then it's time to break out your compiler and get cracking!
Subscribe to:
Post Comments (Atom)

3 comments:
I insist I did nothing ;-) ... I've just tried to run a JavaScript assembled with haXe and run it with a JavaScript webserver and it worked (almost) out of the box.
Anyway I agree with every consideration you have expressed ... good work!
Now I'm getting red.... ;)
Thanks for your support, the more haXe enthousiastic people there will be, the most it will be a great success !
Sorry was unavailable for two weeks, will be in the IM at 5 am my time next two days for those readouts, mail system, etc. Always enjoy working with excellence, can't wait to get together once more. MT
Post a Comment