Live data from Hacker News

HaXe - Code Once. Deploy Everywhere.

haxe.org

21–30 of 62 posts

Re: HaXe - Code Once. Deploy Everywhere.

#21
post #12

> Unlike JavaScript which can take hours to debug, haXe has a very strict compile-time type checking feature that allows you to catch errors before testing your program in the browser It's great that you invented a new programming language. haXe is very cool. But why do you feel the need to disparage other programming languages? If you personally don't like dynamic typing, that's fine. But putting that in the blurb f…

The biggest problem for Haxe is with appropriate JavaScript libraries that abstract the shrinking number of differences between browsers, plus the advent of NodeJS working on pretty much every possible operating system, JavaScript is becoming what Haxe wants to be.

Re: HaXe - Code Once. Deploy Everywhere.

#22
"multi-platform. code once. deploy everywhere."

wow, that claim makes me feel old. i've lost track of how many existing/legacy ways we have to write once, deploy anywhere, multi-platform apps. it's like what they say about the great thing about universal ultimate standards: there are so many to choose from!

Re: HaXe - Code Once. Deploy Everywhere.

#23
I've used HaXe in a few projects. Its a nice abstraction with strong typing and so on which helps with larger code bases. Combined with NME it is very powerful: one can compile code for html5, flash, ios, and android with little to no modification.

My only criticism would be the 32bit integer handling in the neko target. I'm not sure if its changed recently, but the last time i used it i had to wrap all operations in "Int32.()" function calls which to me was a completely braindead solution.

Re: HaXe - Code Once. Deploy Everywhere.

#24

Ah, "code once. deploy everywhere." Few examples of marketing to engineers spark quite the same level of skepticism as this oft-repeated claim. Ignoring, for a moment, the complexity of deploying software across multiple platforms, it's important to remember the multiple form-factor problem. The same software doesn't work from a user's standpoint on multiple platforms if the UI isn't correct for that device. The best…

It should be required that anyone who says "Write once, run everywhere" must write an essay about how they avoid the Java pitfall: "We look consistent everywhere -- but consistently crappy."

JavaScript has almost solved this problem, if one views HTML and CSS as the domain-specific languages which JavaScript deploys for rendering its GUIs. You have to know a lot of quirks, but when you finish a site which looks nice in Firefox you can have a reasonable assurance that it doesn't look absolutely horrible in WebKit browsers.

What's more surprising is that it has come this close to solving that problem, but I don't remember anyone ever promising JavaScript as something of this nature. There exists some JavaScript pride today, especially with CoffeeScript and Node.js, but since at least my first internship in the summer of 1999 it has been faced with inconsistency and standardization pains -- and I don't remember anyone before that time promising that you could run the same HTML/CSS/JS everywhere. By those standards it's more of a 15-year goal than an initial pitch.

Re: HaXe - Code Once. Deploy Everywhere.

#25

Ah, "code once. deploy everywhere." Few examples of marketing to engineers spark quite the same level of skepticism as this oft-repeated claim. Ignoring, for a moment, the complexity of deploying software across multiple platforms, it's important to remember the multiple form-factor problem. The same software doesn't work from a user's standpoint on multiple platforms if the UI isn't correct for that device. The best…

"Write once. Debug everywhere."

Re: HaXe - Code Once. Deploy Everywhere.

#26
post #12

> Unlike JavaScript which can take hours to debug, haXe has a very strict compile-time type checking feature that allows you to catch errors before testing your program in the browser It's great that you invented a new programming language. haXe is very cool. But why do you feel the need to disparage other programming languages? If you personally don't like dynamic typing, that's fine. But putting that in the blurb f…

While I disproportionally use Ruby and JavaScript on a daily basis, this statement is referring to a specific type of (common) error, which is largely alleviated by the use of static typing, and therefore not exactly untrue.

I didn't take it as a disparaging of dynamic typing.

Re: HaXe - Code Once. Deploy Everywhere.

#27
post #12

> Unlike JavaScript which can take hours to debug, haXe has a very strict compile-time type checking feature that allows you to catch errors before testing your program in the browser It's great that you invented a new programming language. haXe is very cool. But why do you feel the need to disparage other programming languages? If you personally don't like dynamic typing, that's fine. But putting that in the blurb f…

While I disproportionally use Ruby and JavaScript on a daily basis, this statement is referring to a specific type of (common) error, which is largely alleviated by the use of static typing, and therefore not exactly untrue. I didn't take it as a disparaging of dynamic typing.

It's not untrue.

But why the singling out of JavaScript? The statement is true for Python, Ruby and Lua as well.

And why even mention another language or class of language in a negative way? I propose that the sentence would better have been written as

> haXe has a very strict compile-time type checking feature that allows you to catch errors before testing your program in the browser

It loses nothing by removing the disparaging part.

Re: HaXe - Code Once. Deploy Everywhere.

#28
post #12

> Unlike JavaScript which can take hours to debug, haXe has a very strict compile-time type checking feature that allows you to catch errors before testing your program in the browser It's great that you invented a new programming language. haXe is very cool. But why do you feel the need to disparage other programming languages? If you personally don't like dynamic typing, that's fine. But putting that in the blurb f…

The biggest problem for Haxe is with appropriate JavaScript libraries that abstract the shrinking number of differences between browsers, plus the advent of NodeJS working on pretty much every possible operating system, JavaScript is becoming what Haxe wants to be.

Interesting, I didn't realize that. Perhaps this isn't random bashing then, but a response to a perceived threat.

Re: HaXe - Code Once. Deploy Everywhere.

#29

Earlier quoted context omitted.

I should mention too that if anyone's interested in Haxe and would like to talk to me for a few minutes about my experience porting the games at http://www.bigblockgames.com and the feasibility of swapping to it from your current solution, hit me up at michael@bigblockgames.com. I don't do contract or consulting work, so you don't have to worry about me trying to sell you something. :)

Would you be so kind as to post that experience here?

Sure!

* The Haxe C++ output is very solid. Sometimes there are compiler errors that you have to reverse engineer, like for when you use a try{} without a catch{}, which is valid in Haxe, but throws an error in C++. It's relatively easy though; the C++ output contains which haxe file and line number each line is from, and it has never taken more than a minute or two to figure out what's going on.

There has only been one logic error I've experienced - Haxe guarantees that arugments of a function are called left to right (i.e. something( readbyte(), readbyte() );), but of course C++ does not. Other than that, as far as the core compiler and code generation goes, if it compiles, the generated code is sound.

* Use NekoNME - bootstrapping on the iPhone without it would require a whole bunch of work. It is an API compatibility layer with Flash, and most basic stuff is replicated. So you code against the Flash APIs, and it spits out a native app on the iPhone, etc. That said, call as few of the Flash APIs as possible; roll stuff by hand, because they kind of suck.

* The garbage collector is quite slow, especially on the iPhone. So you have to be careful about the number of objects you've got in flight, even/especially strings. I don't keep Black Market's story in memory even on the PC version of the game because of this.

* The C++ generated code is very very fast. Though of course some optimisations aren't possible, like creating vectors on the stack, so for example the Haxe Box2d port is slower than the original C++ version of Box2D (I had to use pooled Vectors in Super Goblin).

* If you're making something using 2D graphics, catering to the myriad of display resolutions is going to suck. But that's not a function of Haxe.

* Similarly, you end up doing a whole bunch of work per platform anyway; stuff like putting in app purchasing into the iPhone apps required (at least when I did it) hacking it into the native sections of the NME libraries (a pain, but doable).

* Checkout NME once, and stop updating when it's working well - it breaks often, and is in constant development.

* That said, if you're a hacker, get commit access to NekoNME. If you commit solid changes back they'll love the extra help, and you're likely to want to add some missing features (not as many these days as there were when I did it a year ago).

Now that Unity3D supports Flash, my next game is actually going to be written in that (see http://www.underthegarden.com). However, if Haxe fits your needs (eg write your website backend, Javascript, SWF, iPhone app, PC downloadable all from the same codebase), it's solid and will likely be around for a long time; there'll be some teething pain, but it isn't a lemon technology wise.

The reason I suggested people email me is so I can help figure out if it actually does fit their use case!

Re: HaXe - Code Once. Deploy Everywhere.

#30
post #16
post #9

We use HaXe at Justin.tv. It has some very nice points, but "code once, deploy everywhere" is ridiculous. So many of the crucial APIs are platform dependent that there is absolutely no way your HaXe application is going to be portable.

Who knows - if they keep pushing, it might eventually become true. I remember at one point being part of the crowd that laughed at "Write once, run anywhere" slogan that Sun used for Java ("Write once, debug everywhere" was the joke back then). If you look at how things stand today, however, it has become mostly true (for server side applications).

Server side is the easy part.

If it "might eventually become true," they might want to reword how declarative the saying is, or change it to something like "Code once. Deploy everywhere. Maybe someday."

Post reply on HN