Better HN
topnewbestaskshowjobs
Log inSign up

clemos

229 karma · joined Aug 24, 2011 (15y ago) · 20 submissions

Submissions

comment 11y ago · link · parent

see http://waneck.github.io/wwx-unity3d-haxe/

comment 11y ago · link · parent

You can do Unity with Haxe, but not the other way around, so clearly Haxe > Unity :p

comment 12y ago · link · parent

We made a cross-platform (Flash, HTML5, Android, iOS) video player for TF1 (first French TV channel, considered the most viewed TV channel in Europe)

comment 14y ago · link · parent

So ?

comment 14y ago · link · parent

I put a lighter theme, and increased line spacing a bit

comment 14y ago · link · parent

Also, IMHO the fact that Haxe looks familiar to people coming from Javascript, ActionScript, or Java is a plus.

comment 14y ago · link · parent

Well at least it doesn't look like PHP...

comment 14y ago · link · parent

Actually functions are private by default.

"static function main()" seems to work as an entrance point, though, which makes sense somehow...

comment 14y ago · link · parent

It could be fun to have a CoffeeScript to Haxe converter, though.

comment 14y ago · link · parent

Not usually, but I wanted the app to look a bit less "hardcore techie" than the rest of the Haxe evangelism material :)

comment 14y ago · link · parent

NME is particularily good in building "Flash-like" applications, so mainly games.

I think Appcelerator is more adapted to applications that want to use native UIs elements (menus, buttons, layouts, etc).

Then you can still write an Appcelerator app using Haxe :) https://github.com/skial/haXe-titanium-desktop

I don't know how/if it's possible to mix both, for example embed a NME app inside an Appcelerator app (besides using UI.WebView and embed it as HTML...)

comment 14y ago · link · parent

Given that a .swc is basically a zipped .swf, this currently depends on runtimes:

- Haxe/Flash supports embedding .swf libraries : http://haxe.org/manual/swc

- NME/C++ (Android, iOS, ...) has partial support for .swf libraries : http://www.joshuagranick.com/blog/2012/02/08/quick-notes-on-...

- NME/HTML5 doesn't seem to support .swf right now, but I think it's being worked out.

Then you have third party tools such as Flump or Flambe to help you: https://github.com/threerings/flump https://github.com/aduros/flambe

comment 14y ago · link · parent

NME is a library for Haxe.

It basically provides an implementation of the Flash API for the C++ and Javascript targets, besides the SWF target that Haxe offers natively.

It also comes along with tools that allow this generated C++ code to be easily compiled and deployed to Android, iOS, Blackberry and WebOS devices.

So, if you write an app that targets Flash Player using Haxe, you can use NME to deploy to all these targets with no modification to your code.

comment 14y ago · link · parent

http://try.haxe.org/#655c1

You can compile this example to both Flash and JS online.

If you install Haxe and NME (http://haxenme.org), you can also compile it to iOS, Android, WebOS, BlackBerry, as well as desktop Mac, Windows and Linux binaries.

And these are only the possibilites offered by NME, which is basically a Haxe-based Flash API implementation.

comment 14y ago · link · parent

Ok, ok, I switched back to monospace...

comment 14y ago · link · parent

It has very powerful type-inference, which usually makes it far more concise and expressive than Java or AS3...

It may still be a bit more verbose than Coffeescript or Python, but once your code is written you can theorically run it almost anywhere :)

comment 14y ago · link · parent

http://haxe.org/ref/conditionals

Most standard classes and methods (String, Array, Hash, etc), and a lot of third party libraries are completely cross-platform, so you don't need conditional compilation.

Usually you use conditional compilation either for very low-level per-platform operations / optimizations, or to switch, say, between client code and server code, like here for instance:

https://github.com/clemos/try-haxe/blob/master/src/App.hx

comment 14y ago · link · parent

... and the editor has autocompletion on dot :)

comment 14y ago · link · parent

demos :

Flash API to SWF or JS (nme/jeash):

http://try.haxe.org/#655c1

http://try.haxe.org/#E4001

Flash with custom shaders (hxsl):

http://try.haxe.org/#93bE1

Flash + away3d:

http://try.haxe.org/#9F075

20.

Try Haxe (try.haxe.org ↗)

180 points · by clemos · 14y ago · 87 comments