Hacker News new | comments | show | ask | jobs | submit login
Haxe – Opensource Cross-Platform Toolkit (haxe.org)
149 points by bigbugbag on Sept 30, 2017 | hide | past | web | favorite | 38 comments



Ah, Haxe...we used it to build the video player at Justin.tv, because it had a reasonable build pipeline to SWF and some nice language features.

I rather enjoyed the language. Certainly, it's a lot nicer than working in Flash directly.


Does Twitch still use Haxe?


No idea. I thought they moved to HTML5 video...


Many great games were/are being made in Haxe.

- Papers, Please [0] by Lucas Pope.

- Dead Cells [1] by Motion Twin, a collective linked to the creator of Haxe.

- Evoland [2], Evoland 2 [3], Northgard [4] made by Shiro Games (studio of the creator of Haxe).

- rymdkapsel [5] and twofold inc. [6] by grapefrukt games.

- Topsoil [7] by Nico Prins.

- The Westport Independent [8] by Double Zero One Zero.

- Defender's Quest series [9] by Level Up Labs.

- Fidel Dungeon Rescue by [10] Daniel Benmergui.

Other popular games such as Threes [11] and QWOP [12] were ported to HTML5 with Luxe Engine [13]. Popular game development frameworks and engines include OpenFL [14], HaxeFlixel [15] and Heaps [16].

[0] http://papersplea.se

[1] https://dead-cells.com

[2] http://evoland.shirogames.com

[3] http://www.evoland2.com

[4] http://northgard.net

[5] https://rymdkapsel.com

[6] https://twofoldinc.com

[7] https://www.topsoilgame.com

[8] http://www.doublezeroonezero.com/westport.html

[9] http://www.defendersquest.com/index.html

[10] http://store.steampowered.com/app/573170/Fidel_Dungeon_Rescu...

[11] http://play.threesgame.com

[12] http://www.foddy.net/Athletics.html?webgl=true

[13] https://luxeengine.com

[14] http://www.openfl.org

[15] http://haxeflixel.com

[16] https://github.com/HeapsIO/heaps


The Haxe community is generally pretty great. http://haxe.io provides a pretty rad community round-up every week, and though I don't use Haxe much, the work put into the framework is awesome to see.


What is the market demand for Haxe like, for employees and freelancers, anyone know from personal experience?

Edit: To make it more clear, I just looked at:

http://haxe.org/use-cases/who-uses-haxe.html

and that page does show that many well-known companies are using it. My question is more about the {perceived|anecdotal} usage level that anyone thinks it has in the industry, vis-a-vis other products in roughly the same space. Asking with a view to whether I should consider learning it for work.

Edit 2: Checking out http://haxe.io/ based on MoOmer's comment.


Market demand for haxe is probably not enough to justify learning the language, but the language is incredibly easy to pick up for anyone who has done any development in ActionScript/JavaScript/ECMAScript type languages.

It more or less feels like a class-based, typed (often inferred type) JavaScript. If you have any experience in the class of JavaScript-like languages, learning haxe is basically no effort beyond just learning a new set of build tools and the haxe runtime APIs.

I used it a lot when I was working for Chumby because the language could target the ActionScript/AVM runtime that was used for Chumby widgets and was in many ways a far superior language to ActionScript 2. (ActionScript 3 was also very good, but the Flash player on Chumby devices didn't support AVM2 until just about the time the company went through a very near death experience [though it is still alive thanks to the efforts of Duane Maxwell]).


Thanks for the answer - useful. Cool to know you worked on Chumby - I remember reading about it some time after it was created, maybe on the O'Reilly site. Seemed like an innovative device.


The Chumby was a cool device (or rather, set of devices) for sure!

The common wisdom was that the introduction of the smartphone basically doomed it, but in retrospect you could look at it as something like a before-its-time Amazon Echo Show (which Google is supposedly making a competitor to right now as well)...

There appears to be modern market for this type of thing, though newer devices are certainly benefiting from everything that came along with the smartphone revolution like super cheap SoC packages, cheap high resolution displays, cheap capacitive panels, more mainline support for embedded devices in the form of modern Linux kernels, Android, etc.


A Haxe developer with 3 years of experience here. I'm at the point to cross compile projects for IOS from Linux & Docker.

I started coding Haxe as a transition from being a AS3 Flash dev. At first, I've found the name odd and the idea of cross-platform is bloated but I came back for following reasons:

- Language being almost same as Actionscript 3, which I already knew and which I made stable income in past with.

- Native compilation. While this sounds bloated, I never had a critical issue since I rarely deploy more than 2 platforms, and I see difference is very small when I don't use a platform specific library.

- Despite small community, as because libraries and tools are intuitive enough, ease of use overtaken my need of too much help. Project leaders are very responsive and energetic if you get confused anyway.

Only thing you will notice is that, the build tools and package management needs a bit revolution if community will grow further but I had no issues until today. Most of the time I prepared a Dockerfile to freeze everything and moved on.


Why hasn't haxe taken off in your opinion? On paper it looks amazing.

I tried it a couple of years ago and while I loved the language (I have a strong AS3 background) I felt there were too many moving parts that rely on each other.


i'm sure there are more complicated reasons, but for me personally, the last time i messed with it (a few years ago) the toolchain was clunky and the language itself was dull.

hopefully things have improved!


Curious project I wonder how it compares in actual portability to a project like Kotlin? Been enjoying that language and the possibility of the apps core functionality being cross platform.


I have done a few Ludum Dares using Haxe.

I developed one into a a mobile game. It pretty much just worked across iOS, Android, Native Linux, Native Windows and flash. It really does compile as the same project and Build for $platform. With the exception of iOs which needs to do shenanegans with xcode. Flash version as a free to play here http://fingswotidun.com/Potato/


Your game seems to be broken atm (Chrome latest).


Looks like it's using Flash, and like most sites the "ask" mechanism doesn't work - it'll only show the SWF if you tell Chrome to allow it and then reload the page.


Oh, of course. Didn't even notice that parent had specified it was flash.


Haxe has been around many years before Kotlin. People have done flash games in Haxe that also compile to other platforms including HTML and mobile platforms. It also compiles to many other languages. It's definitely work investigating and seeing the output.


Does Kotlin have its own complete standard library? I thought it used Java's?

Also, does it compile to anything else then the JVM?


Kotlin compiles to JavaScript, Java bytecode or native code (via LLVM, currently only a "technology preview").

There is a small standard library but it relies on the platform libraries for most things. For collections, Kotlin/JVM uses the Java collections with some extension functions, but on Kotlin/JS and Kotlin/Native the Kotlin standard library itself provides the same Java-like collections API.

For other things, Kotlin/JS provides a tool for converting TypeScript bindings to Kotlin as well as a special "dynamic" type (kind of like .NET) to call JS APIs without bindings. Kotlin/Native has a bindings tool to generate Kotlin wrappers for C libraries.

The size of the standard library for Kotlin/JS is roughly similar to AngularJS – 1.4 MB unminified or 100 kB minified and gzipped. But there is a tool (since 1.1) to eliminate the unused parts and reduce the size – e.g. for one simple tiny program I have here, library + program is 28 kB minified and gzipped.


Okay, based on what you're saying, Haxe would be a lot more portable then. The unified standard library is key. It seems like Kotlin compilation target is more a choice you make initially, not a portability feature.


Depends on whether you need whatever is in Haxe's standard library, I guess?

I have a Kotlin program running on Windows, Linux with X11, Java with Swing, as well as in the browser, i.e. targeting native, JS and Java. That seems pretty portable to me. You just need to provide an implementation of whatever API you need on each platform you target.


Well, your portability for Windows and Linux is just from the JVM no? What does Kotlin add that java didn't?

And your Kotlin to JS, when you say target API? I mean, how similar is it to your JVM one? If you had to rewrite everything you were using Swing for, that's a lot of rewrite.

I think with Haxe, though not sure, but it's my impression with Haxe it would be almost 100% same code. Because whatever UI framework you'd used in Haxe is in the standard library, and would therefore be availaible on all its target platforms.

Hum, actually I take that back, it seems HaxeUI supports most platforms but not HTML5. Though HaxeUI2 seems to be in development adding support for it.

Ok, I see what you mean then. I don't know if I'd call that truly portable, but if they add native WxWidget and say QT to Kotlin native, it would slowly tend towards what Haxe has going.

I don't really think of that as portable personally. So many languages offer it today, Java with GWT, Clojure/ClojureScript, Kotlin, OCaml/BuckleScript, PureScript, Ruby/Opal, Python/PyJamas, Erlang/Shen, Scala, etc.

You save a bit of time not having to learn another language, and can reuse all pure code, mostly. But I'd really like to see a language develop which supports multiple platforms from the get go by having a unified standard library that was very complete, including UI.


> Well, your portability for Windows and Linux is just from the JVM no?

No, there is a native binary executable for Windows and a corresponding one for Linux. There is no Java embedded in or required by those, although separately (!) I also target Java, in addition to Windows and Linux. (I knew I should have used more parentheses in that post.)

> If you had to rewrite everything you were using Swing for, that's a lot of rewrite.

Yeah, but there is no Swing on the web, so what can you do? We used to have Swing, in the form of applets, and it was horrible. If you want something to work well on the web, you have to write it for the web. (But you can write it in Kotlin!)

Again, there is no Java when you target JS. Instead you can use any JS API and any JS library. The Kotlin standard library provides some basic data structures, math functions, etc. No Java.

> if they add native WxWidget and say QT to Kotlin native, it would slowly tend towards what Haxe has going.

wxWidgets and Qt happen to be in C++, which is difficult to use from other languages, but you can use any C-based library from Kotlin/Native, such as GTK+ or the native Win32 API.


It compiles to JVM bytecode and JavaScript currently. JetBrains is working on a native port as well.

Uses the JDK standard library currently.


[flagged]


> Haxe is an open source toolkit based on a modern, high level, strictly typed programming language, a cross-compiler, a complete cross-platform standard library and ways to access each platform's native capabilities.

>What the fuck am I reading?

A pretty accurate description of what Haxe is, with bog-standard programming terms and no buzzwords.

>I have no idea how anyone could think this is a reasonable way to describe something.

Probably because they have a better grasp of what the thing they are describing is.

>Why not just say it’s a modern, high level, strictly typed programming language?

Because then you would have left out the most important parts: that it's also a cross-compiler, with a cross-platform standard library, and access to the underlying native libraries.

Again, all these are bog-standard programming terms, and all are things that Haxe offers. Furthermore, they are all core to its core mission, and the main reasons why one might choose it over any other "high level, strictly typed, programming language".

Even more so, what the fuck is difficult to parse about Haxe also being "a cross compiler"? It just means it can produce code for different platforms/environments.

Or about having a "complete cross-platform standard library"? It just means that it has a large standard library, that is portable across many platforms/environments.

Or what is difficult about it having "ways to access each platform's native capabilities"? It just means that it's not some closed sandbox system, but you can link and call into platform (e.g. iOS or .NET or whatever) APIs.


Haxe is basically several different things.

A language: It's language was originally designed to be a successor to ActionScript 3, as Haxe was originally designed to replace Flash.

A cross-compiler: The most interesting part in my opinion. Basically you can write Haxe code and target many, many different platforms. Mostly how this works is by transpiling, or translating the code into valid code in other languages.

A cross-platform standard library: This just means that it includes its standard library whenever it cross-compiles.

Ways to access native capabilities: Depending on your desired compilation target, you can use specific functionality only available on that target.


I've used it before as a demo building something to run on flash based set-top boxes. Hey couldn't process XML quickly so I moved the code that did it to run on a server and use the built in serialise/deserialise functions. Then I just compiled one side to flash and one side to PHP.


You are reading an information dense sentence describing a large, complex ecosystem.


That sounds like the start state of an adventure-style game.


Cool but I’ve never heard of a programming language that doesn’t come with a compiler or standard library does that really need to be spelled out?


But see, cross-compilers and cross-platform standard libraries are actually different things than compilers and standard libraries. In the context of cross-platform mobile, they are quite important things to spell out.


It's not easy to describe... Hate is basically like ActionScript. The compiler is written in Haskell (or was it OCaml?) and it compiles to: JavaScript, Flash (SWF), C++, Python, PHP and who knows what else, for multiple platforms. You can do both server-side code and client-side code. It's quite impressive, it also can run on top of the MakoVM. I kinda laughed at your response about it though it does sound a bit much for someone not familiar with Haxe.



I originally wrote it the other way "(or was it Haskell?)" but switched it out since I've seen so many Haskell languages here. But yeah that sounds right. I remember looking into why a compiler / transpiler in OCaml would work and apparently they have really great string libraries. I'm no expert in OCaml nor Haskell just know both are used to make some interesting projects. I am always fascinated by Haxe.


Anyone interested can read this paper - https://www.ijicta.org/index.php/ijicta/article/view/16 .


> Why not just say it’s a modern, high level, strictly typed programming language?

Because Haxe is more than that... Why would you favor less specific, less informative description over a factually correct statement?


It makes total sense to me, but it helps that I've spent hundreds of hours researching and using cross-platform frameworks.

It might be that you aren't the target audience.




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

Search: