

The ultimate cross platform language - sledorze
http://lambdabrella.blogspot.com/2011/08/haxe-book-secret-weapon-under-spot.html

======
terhechte
haXe has been around for a long time, so it should be pretty solid. I played
around with it in 2003 or 2004 because I wanted to have a way of writing flash
applications in a good editor like Vim instead of the frighteningly bad Flash
Editor. And I wanted to work under Linux.

The main problem why it never got traction is probably that it is aiming for
too much at once. If you try to do everything, you're just mediocre across the
board. It may spit out JS, but how do you use advanced frameworks like Jquery
in there? It may spit out C++, but how advanced is that code, and what if you
want to use GTK or even Qt. From what I understood, you're pretty much limited
to what haXe has to offer. And that, on the other hand, limits your choice of
what you can implement. Granted, you could port stuff over, but then it's more
work again.

Instead, it may be smarter to know 2-3 dedicated languages for specific tasks.
This also helps you to understand and port different design patterns back and
forth.

~~~
reitzensteinm
I think it did bite off more than it could chew in the beginning, but it's
really coming together these days. You can link in with third party libraries
just fine, though only by calling a Haxe like external interface functions, so
you'd probably write your jquery in separate files.

It's no silver bullet, and I'd probably still agree with your assessment of
using tools designed for the job - my web stack is Django + hand written
javascript/jquery + node.js for multiplayer.

But I think it's well worth checking out for the news.yc crowd. I believe
something similar will eventually win out - being able to write every part of
a stack in the same language - but that language is probably destined to be
Javascript.

~~~
terhechte
I concur that it is interesting. I mostly wondered why it didn't catch on
since it's been available for so long already. Also, for certain niches, like
simpler games, it is probably a great solution since you can create it once
and then publish / sell it on multiple platforms.

I'm also pretty sure that someday Ruby or Java or Javascript or Python will
evolve into something which runs on almost any platform. Already, you can
compile Java to Javascript, Python to Javascript, and so on. Especialy the
LLVM is going to allow for way more inter-language swizzling.

------
g123g
The ultimate cross platform language for me will be one that runs on Android,
iOS, Windows, MacOSX and Linux without any change in code. From the article it
doesn't look like haxe is trying to do that. But it will be great to have such
a language.

P.S. I think Javascript, HTML and CSS is a good combination but not what most
people want.

~~~
watty
Flex/Air is probably as close as it will ever get to being write once/run
everywhere.

~~~
Auguste
As far as I can tell, Air is designed to only run on Linux systems with the
Apt, RPM or YUM package managers. I had tried to set it up on Slackware using
some workarounds (see
[http://cookbooks.adobe.com/post_Adobe_AIR_Application_Instal...](http://cookbooks.adobe.com/post_Adobe_AIR_Application_Installer_on_Slackware_12_2-15226.html)),
but never got it to work. The .bin installer would just produce cryptic error
messages and fail.

I did succeed in installing Air by using rpm2tgz on the RPM package, but
installing an Air application still fails.

Am I the only one with this experience?

------
wslh
The topic itself is very interesting, I find that excelent libraries (i.e.:
NetworkX) in a language (i.e: Python) can be quickly ported to other
languages. It's a pity that those libraries can't be isolated and translated
to many languages without an important extra effort. In the case of graph
algorithms we have libraries for C++, C#, Python, Ruby, Java, etc with
different features and qualities, but the weakness is that the library comes
attached with a single programming language or VM.

It's an important trend to look and hope HaXe to be just one example of a
project going in that direction.

------
jamesu
I used haXe a while back when implementing a concept SCUMM interpreter which
worked in Javascript & Flash. It fitted the gap nicely... i could literally
use the same code when compiling for flash and javascript.

My only big problem with it was the standalone "neko" target used a bizarre
hack which meant integers were limited to 31 bits. This became incredibly
problematic when implementing code (e.g. drawing, file loading, interpreting
bytecodes) which relied on the assumption that integers were at least 32 bits
in size.

There was an official workaround which used an "Int32" class. This effectively
meant if you built for "neko" you had to rewrite half your code to use Int32.
Bizarrely haXe had no in-built abstraction for transparently handling 32bit
integer types in this case.

~~~
neutronicus
Common Lisp also has fewer-than-32-bit integers. It uses a few bits so that
the VM can tell whether something is a pointer or an unboxed integer.

~~~
aidenn0
No, it has fewer-than-32-bit _fixnums_. Integers are practically unbounded.
Also, on cmucl and it's derivatives you can declare something to be (unsigned-
byte 32) and when possible it will use untagged integers for performance.

This makes a difference because if you declare something "fixnum" you know
you're being non-portable, but if you declare something (unsigned-byte 32) or
just integer then you expect it to work across all implementations.

~~~
neutronicus
I didn't see a need to introduce another piece of jargon, but thanks for the
clarification.

------
pan69
One of the nice attributes of haXe is that you can use one programming
language to target different domains. Where in web development you'd normally
use PHP and Javascript you can use haXe since haXe compiles down to either PHP
or Javascript.

Of course, haXe code has to be written in such a way that you know you're
going to compile it to PHP. You can't simply "cross" compile for different run
times.

But learning one primary language is definitely appealing over learning many
different languages. Reuse...

------
AlexCP
I'd like to see how it looks. Anyone know of a framework or a web app example?

------
acangiano
It won't install for me on Mac OS X Lion:
[https://img.skitch.com/20110803-f5y8w3yngw6j4n1wi9ma33xmbu.p...](https://img.skitch.com/20110803-f5y8w3yngw6j4n1wi9ma33xmbu.png)

------
belial
Would it be a good decision for a company to replace a RubyOnRails development
environment with haXe??

~~~
tluyben2
I assume you are thinking of using something like this;
<http://code.google.com/p/hails/> ? But I would say no ; haXe is great and I
love using it, but it's very game oriented; the rest (other uses), last I
checked are not very mature (yet). That said; for cross platform gaming it is
cool; you can target many platforms and with a bit of hacking it all works
nicely.

