84 points · by revorad · 15y ago · 36 comments
Our devices (I work at Chumby) will soon be AS3-capable but at this point I'd like to stick with Haxe anyway because I've grown to love the language for things like generics, inline methods and it'll be cool to be able to access the Alchemy memory directly from non-C++/Alchemy-compiled code when I can.
Protip: Don't just look at the release version of haxe, there is a ton of cool new stuff in the svn that hasn't yet been wrapped into a release, including a very flexible compile-time code generating macro system.
You work at Chumby! I'm trying to get into some hardware hacking and came across your site just recently. I'd love to talk about it and ask some questions. Can I email you? Or please drop me a note (my email's in profile). Thanks!
source build instructions are here: http://haxe.org/doc/build
I was able to get a small program working with Haxe, however I figured out that you still need Adobe's runtimes, so it didn't solve our problems. I ended up using Smaxe ( http://smaxe.com/ ), which is a commercial (non OSS) library that allows you to work with all sorts of Flash technology from Java.
I found the whole Haxe system to be intriguing. The Neko VM appears to be quite sophisticated. The idea of writing PHP in another language is certainly appealing, as is developing Flash and ActionScript outside of Adobe's IDE.
So, a kind of hello world code that compiles in different platforms could be a great way to show the strength of the language.
For an example of this, see jquery.com.
There's a list of snippets here: http://haxe.org/doc/snip
some of them handle common tasks in a platform independent manner, or show off a cool trick:
It's developed by Nicolas Canesse of MTASC fame as well as the developer of the Neko VM and HaXe which runs on top of it. Excellent and active community and the features are constantly expanding (considering the additions of output targets such as iPhone, PHP, JS, etc).
Well worth a look for any developer (even if you aren't interested in the Flash portion which seems to be the biggest usage area).
JavaScript/node would be another option, but something more native might pique my interest.
The biggest benefit of all this is a build once, deploy multiple architecture, so if you are a Flash developer, you can also target iPhone or C++ for desktop, or other outputs with slight code changes.
It's a very nice Flash compiler, which makes up for some very poor language design choices imho (for example static typing and type-inference, but the type inference sucks and frequently infers the wrong type).
I have found it invaluable for refactoring.
Not that I'm accusing haxe of being buggy, but that's the GP's implication...
Since each layer is written in the same language, it is simple to write proxies and connection layers between them. It's also easy to update or change these protocols all at once. There are already some great serialization, proxy, and remoting classes in the base library.
Fantom has stable and working JVM and CIL targets. These targets are aren't yet finished for HaXe.
Quick comparison of the languages:
http://99-bottles-of-beer.net/language-haxe-2248.html
http://99-bottles-of-beer.net/language-fantom-2563.html
These are both very interesting languages. Hopefully they'll get more attention.
When I started there were unresolved issues making it unpalatable for all Flash projects(e.g. preloader creation), but they have since all been overcome and documented. It still requires some elbow grease to get working.
It's worth taking a look at though. I have to get over a fear of cross-compiling (like CoffeScript or RJS to JavaScript), largely because I had bad experience debugging such stuff in the past.
i thought this is supposed to be multi platform? i don't see C# (windows) or other languages there? kind of misleading to me, sorry.
Haxe originally start out with support for Flash, JavaScript and Neko (a small VM available for both Lin/Win/Mac, see nekovm.org).
More recent and in-development targets are PHP and C++. I think there is Java and C# somewhere in the sheds, but nothing spectacular yet.
Haxe vs. C++ ------------ Pros: * relatively easy cross-platform communication via remote function calls ("remoting") * powerful language with many practical constructs (a bit like C++ with boost included.. wait a bit.. :) * Code sharing between platforms - write once, run on Flash/Servers(neko/php/cpp)/IPhone(cpp)/Browser(js).. * Automatic type inference (don't write the types, but you still get strict checking) * Hacker feeling :) * Possibly many other
Cons: * Hacker feeling (your manager possibly won't allow it as it is not "Enterprise") * Generics ("type parameters") are far behind C++ templates.. yet * Possibly many other
You won't write nuclear simulations in Haxe, but if you are into web/interactive apps, it is worth a peek.
http://haxe.org/com/libs/swhx and http://hippohx.com/
Primarily I have used it as a custom wrapper around Flash applications being developed by my Flash team. By creating these custom wrappers I can give full access to the filesystem and databases without the Flash guys needing much knowledge of the surrounding development. This is a lot like Zinc is, however gives me a lot more control over what is happening and I can create additional dll's to hook in to to further extend what is going on behind the scenes.