Hacker News new | comments | ask | show | jobs | submit login

For those not familiar with OpenFL, /u/larsiusprime posted a nice summary of how it's used:

"OpenFL is is a programming API that mirrors the Flash API, but in the Haxe language. So you take your old ActionScript code and port it over to Haxe (very similar language, but with additional features). Then you also take your Flash-vector-art SWF files, and you load it with the Haxe SWF library. OpenFL ensures you can still make all the same method calls to the Flash API, etc.

When you compile, you select one of many targets, kinda like unity: C++, JavaScript, etc. It conveniently packages those targets up into special configurations like "Android", "Windows", "HTML5", "Linux", etc.

So you can take your existing flash code and art, but get it running NATIVELY, in say, Linux desktop, with no need for the flash plugin or AIR runtime -- it's just a C++ app that does the same stuff (and much faster!)

You can also output to HTML5 so your players don't need the flash plugin anymore (the HTML5 target is still fairly new). As an end user, there's nothing for you to really do, except to wait for flash developers to switch over to it. From your perspective, all you'll really see is that instead of Flash apps on the web, there's more HTML5 apps. And instead of AIR apps for games on the desktop, they're natively compiled for Linux. What happened in these cases is that the developers were using Flash before but switched to OpenFL."

So basically, the open source community made a better flash than Adobe did? That is rather amazing considering the resources of the respective groups.

They've done it twice. MotionTwin did a lot of work in AS2 so they built a better compiler for it (MTASC), which compiled faster and made faster swfs (it's still used in production at the BBC).

Then when AS3 came out they seem to have thought "Oh come on!" given the quality of the compiler and language features so they built a better language. Again, faster and better compilation, as well as properly implemented things like generics (particularly compared to the awful implementation in AS3).

It's a lovely little language, and cross compiles to a vast range of platforms with ease. I built an android app which ran a webserver to control a TV app built in it (compiled to JS). I also had good success compiling it to PHP (cross-platform serialisation & deserialisation turned out to be easier and more performant than parsing XML on some low power devices).

MotionTwin made my working day so much better, not having to use the CS4 was wonderful.

Actually, HaXe, Neko, mtasc and MotionTwin projects of one person: Nicolas Cannasse. Dude is a legend, and community surrounding those projects is amazing.

Great example of this; adobe released alchemy[1] a couple years back with which you could compile very basic c/c++ code to a "swic" library which could then be referenced in flash. Although initially free to try adobe wanted to turn this into a premium feature[2]. It was quickly reverse engineered and turned into a haxe api, that made the step of using basic c/c++ and compiling it to a swic obsolete, keeping everything nicely in the haxe ecosystem[3]. If that was not impressive enough they did the same thing with "pixelbender3d"[4] and created hxsl[5].

[1] http://labs.adobe.com/technologies/alchemy/ [2] http://blogs.adobe.com/flashplayer/2011/09/updates-from-the-... [3] http://ncannasse.fr/blog/virtual_memory_api [4] http://www.adobe.com/devnet/pixelbender.html [5] http://ncannasse.fr/blog/announcing_hxsl

Context: I posted that description on the /r/linux_gaming thread to a user who initially thought that OpenFL was a plugin or something and was wondering "what they needed to do" to use it.

How does it do networking?

All I see in docs is a simple GET/POST request. Realtime multiplayer game would be very slow using it.

Documentation is one of Haxe's weak points right now.

Various Haxe networking libraries: https://github.com/MattTuttle/hxnet https://github.com/andyli/hxudp

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact