News for hackers. Stuff that matters.
Re:The ultimate cross platform language by terhechte on Wednesday August 03, 2011 @05:32AM (#2840421)
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.

Re:The ultimate cross platform language by reitzensteinm on Wednesday August 03, 2011 @06:14AM (#2840501)
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.

Re:The ultimate cross platform language by terhechte on Wednesday August 03, 2011 @06:21AM (#2840518)
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.

Re:The ultimate cross platform language by Cushman on Wednesday August 03, 2011 @12:01PM (#2841644)
Yeah... Node answers that elegantly. Writing in a third language which compiles to JavaScript and PHP, well... doesn't.

I hope this doesn't get taken the wrong way, because it looks like a very competent effort, but I think the main reason it hasn't "taken off" is that HaXe has the hallmarks of a language designed by committee on game dev forums. "So it looks like Java, acts like JavaScript, and compiles into C++, Flash and PHP? That's awesome!"

Sounds awesome to an indie game dev. Sounds hideous to a hipster web developer.

Re:The ultimate cross platform language by neutronicus on Wednesday August 03, 2011 @12:14PM (#2841705)
Clojure seems to be gunning for the "whole-stack" crown with ClojureScript.
Re:The ultimate cross platform language by ZoFreX on Wednesday August 03, 2011 @08:18AM (#2840812)
You could always invert it. Any situation that requires a lot of logic but not much interfacing could be handled with haXe - maybe you need a particular algorithm, in JS and C++. Rather than try to interface with JS or C++ in Haxe, could you "write once" the library you need in Haxe, compile it down, and interface with it?
Re:The ultimate cross platform language by g123g on Wednesday August 03, 2011 @07:05AM (#2840609)
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.

Re:The ultimate cross platform language by watty on Wednesday August 03, 2011 @07:42AM (#2840707)
Flex/Air is probably as close as it will ever get to being write once/run everywhere.
Re:The ultimate cross platform language by Auguste on Wednesday August 03, 2011 @08:06AM (#2840778)
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...), 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?

Re:The ultimate cross platform language by exDM69 on Wednesday August 03, 2011 @07:14AM (#2840640)
Pretty much any modern language will run on all the operating systems you mentioned, without having to modify the code.

What you want is a framework/standard library to abstract away platform specifics. There are many alternatives out there but none of them delivers what they promise. One of the biggest problems is the lack of any standard GUI interface.

Re:The ultimate cross platform language by wslh on Wednesday August 03, 2011 @08:16AM (#2840802)
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.

Re:The ultimate cross platform language by jamesu on Wednesday August 03, 2011 @06:34AM (#2840542)
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.

Re:The ultimate cross platform language by ootachi on Wednesday August 03, 2011 @08:48AM (#2840908)
It's not a "bizarre hack", it's a very common implementation strategy known as integer tagging. You see it everywhere from OCaml to the V8 JavaScript engine.
Re:The ultimate cross platform language by neutronicus on Wednesday August 03, 2011 @12:38PM (#2841794)
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.
Re:The ultimate cross platform language by aidenn0 on Wednesday August 03, 2011 @12:57PM (#2841888)
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.

Re:The ultimate cross platform language by neutronicus on Wednesday August 03, 2011 @01:09PM (#2841944)
I didn't see a need to introduce another piece of jargon, but thanks for the clarification.
Re:The ultimate cross platform language by pan69 on Wednesday August 03, 2011 @07:12AM (#2840633)
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...

Re:The ultimate cross platform language by AlexCP on Wednesday August 03, 2011 @07:19AM (#2840653)
I'd like to see how it looks. Anyone know of a framework or a web app example?
Re:The ultimate cross platform language by acangiano on Wednesday August 03, 2011 @09:34AM (#2841052)
It won't install for me on Mac OS X Lion: https://img.skitch.com/20110803-f5y8w3yngw6j4n1wi9ma33xmbu.p...
Re:The ultimate cross platform language by belial on Wednesday August 03, 2011 @06:21AM (#2840520)
Would it be a good decision for a company to replace a RubyOnRails development environment with haXe??
Re:The ultimate cross platform language by tluyben2 on Wednesday August 03, 2011 @09:42AM (#2841084)
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.
Re:The ultimate cross platform language by clyfe on Wednesday August 03, 2011 @06:51AM (#2840580)
don't think haxe targets ruby
[deleted]
Re:The ultimate cross platform language by reitzensteinm on Wednesday August 03, 2011 @06:06AM (#2840494)
I've written several games in Haxe, which are cross platform. See:

http://www.bigblockgames.com/games/supergoblin/

and

http://itunes.apple.com/us/app/super-goblin-war-machine/id43...

...and there's a Windows and Mac build as well.

I don't know the author, and only used it because it had built up quite a community already. The discussion groups have 16 topics active within the last 24 hours.

Haxe is a very solid language, similar to javascript, but with strong typing plus type inference. More than acceptable to use day to day.

The compiler outputs Flash files, Neko VM (its own VM, used for servers), Javascript and C++ in a rock solid way. I can count the number of times a bug in the C++ output caused it to not compile on one hand, and I've never had a logic error, where the C++ compiled but caused an inconsistent result. Java and other backends are in their infancy, but they're coming.

The author makes many popular web games in Haxe, and uniquely, the client side javascript, server side multiplayer, web framework and Flash files all come from the same code base. The power of that is incredible.

Most importantly, the entire language, runtime, C++ output etc is all open source. It's not for everybody, but it's a great language for those that need the features it provides.

To dismiss it like you are is frankly kind of insulting. If you aren't interested, that's fine, 95%+ of the people on Hacker News won't be. Move along, or cogently criticize it, but there's no need to be flippant. It's in no way a silver bullet, but it does bring something unique to the table, and to me that deserves respect.

Re:The ultimate cross platform language by pufuwozu on Wednesday August 03, 2011 @05:49AM (#2840456)
http://oreilly.com/catalog/9780470122136

You must have not read the article if you think HaXe is boring.

Re:The ultimate cross platform language by Kwpolska on Wednesday August 03, 2011 @05:54AM (#2840466)
O'Reilly book == a book PUBLISHED by O'Reilly, not sold by them. You know, these with ANIMALS instead of random DUDES as the front cover.