Hacker News new | comments | show | ask | jobs | submit login
Eval – The new Haxe macro interpreter (haxe.org)
85 points by markknol 9 days ago | hide | past | web | 5 comments | favorite





Eval here is important because of Haxe's incredible macro system. The "eval" target is the engine for macro AST transformations. While vanilla haxe was extremely fast to compile, including macros in a project would often make haxe development feel sluggish. There were various workarounds for these situations, but those added to the mental overhead of managing the project. The eval target improvement streamlines this part of the compiler, bringing it in line with the rest of the compiler performance characteristics.

The overview for macros is here : https://haxe.org/manual/macro.html

Some examples of macro usage are here : http://code.haxe.org/category/macros/


Slightly off-topic.

I've always been curious about Haxe, especially since there really is nothing quite like it out there. Does anyone have experiences or opinions to share on developing applications (e.g., games) using Haxe?


I have a bit of hobby experience. One of the reasons i picked haxe as a platform/language is that it's cross-platform, but easy to delve down into native, since it's a source to source compiler. This means you write most of your code in cross-platform ways, but when shit hits the fan, you can always fight your way out by going native (which is quite seamless - such as externs, or even embedding raw native calls directly into the haxe source, useful as a last resort).

Haxe as a language, is very similar to java/c# in style (or actionscript - if you know that language). It is superficially similar to javascript too, but has a bit of semantic differences (it's not a prototypical language). The best language feature is its macro system. It is only 1 step below the LISP macro system, since macros are actual code, and you get to modify AST at compile time.

as for the library ecosystem, there's plenty of existing libraries in both pure haxe, as well as haxe externs into target native platforms. Quality vary, but you can say the same about any language's library ecosystem. Haxe's library ecosystem is mainly targeted at games - lime, openfl, haxeflixel, haxepunk, kha, babylonhx, and many many other engine/frameworks for games exist. Most of them are relatively easy to use, but as with all open source projects not backed by a large corp, there are warts, and you often have to either workaround them, or fix it (and in the process contribute!).

I haven't written any web-server/web-app using haxe, but i think it's also a popular type of app to write in haxe.

IDE integration is great with visual studio code (and intellij too).

Over all, i can't find any faults that i can't live with or fix, and am happy to continue playing with haxe. It can only improve in time.


I have been using Haxe (not professionally, but still quite intensively) for more than 3 years now. I've moved to it from AS3.0 / Flash initially to make games. As I learnt the language more and more, however, I started using it for a very wide variety of projects - data scraping / mining / processing, websites, image processing, scripts, etc. It has a small but quite active community and it is really easy to get in touch with one of the core devs, suggest features, or even contribute to the project.

If I had to point out its biggest flaw, it would be a lack of in-depth documentation - the API reference is understandable, the manual explains the language features quite well, but if you want to do some more specific things with a less-used platform, for example, you might have to experiment a little bit. I think this is a consequence of having a smaller community for a project which targets such a large number of targets simultaneously. However, since you asked about games, Haxe is great for gamedev. There are multiple frameworks which allow you to develop cross-platform games very smoothly. There are many games popular on Steam that were written in Haxe: Papers, Please (NME); Evoland (OpenFL? not sure); Rymdkapsel (OpenFL); the upcoming Northgard (http://northgard.net/, using the new Hashlink target).

I am also playing around with writing a framework, though it's nowhere near completion. I've written many gamejam games in Haxe (http://www.thenet.sk/), with source code, if that interests you.

If you want to try something new – I recommend Haxe wholeheartedly, even if you decide not to use it, I think writing code in it is just fun.


How does it fare on iOS and Android?



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

Search: