tags:

views:

1640

answers:

11

For people out there using HaXe, what makes it useful for you? Reading the website it looks very promising. Does it provide significant portability?

What are some real world and perhaps under appreciated advantages?

What are the pitfalls or gotchas?

+1  A: 

I had HaXe on the radar since it started. I agree it seems very promising but I noticed that developers are not adopting it as quickly as you would expect (compared with RoR and even Flex).

Regardless how good and suitable HaXe can be for you right now, you will still be among the early adopters and you will sure go into issues early adopters usually face.

Although there is a very active mailing list with very helpful members, I would still wait until more people join in and more books and resources are written about it.

At the end, HaXe helps you write in a single language and target different platforms (JS and Flash mainly, and now NekoVM, PHP, and C++) do you really need that?!

Ammar
I'm not sure that is a fair comparison for adoption rate.With Flex, it is a sponsored language from Adobe. That automatically gives it "street cred" ;)Ruby was around what, something like 10 years old when Rails came out. From what I've seen, it appears that more people switch to RoR then to just plain Ruby. In contrast Haxe is around half as old as that, and although there are many frameworksfor Haxe in development out there, certainly none have gone viral like rails has.
tylermac
Seriously?! What's the % of RoR developers who used Ruby before RoR came out? And doesn't matter to me (as a developer) if a dev platform was sponsored by a big corporate or not? The adaptation rate is moving really slow with HaXe IMO and this is my main concern about it
Ammar
New approaches are not always obvious to everyone, I remember RoR and papervision both projects that have expanded in recent years that interested me, and I have to say haXe really proves its potential and I believe it will be bigger than both.. 2-3yrs will tell ;)
JLM
My argument still stands: it's too early :)
Ammar
+25  A: 

Is Haxe worth learning?

The short answer is: Absolutely!

For people out there using HaXe, what makes it useful for you?

If you're a web developer, you know you can't stick with a single technology for too long. Sooner or later you'll have to deal with changes in the environment or targets (you develop for .NET but an important customer requires PHP, or maybe that widget should be in Flash not Javascript), and this is the best case scenario. In the worst case you'll have to switch constantly, often multiple times in the same business day.

Those switches can waste a lot of your time because you need to change your programming paradigm too many times and possibly because you will have a lot of overlaps in coding your libraries for specific targets. HaXe tries to ease the pain of transition by having just one source language (the HaXe language) and many outputs (through the HaXe compiler). The language is very friendly and quite easy to learn, no matter your background.

Reading the website it looks very promising. Does it provide significant portability?

The language is the same no matter what platform you deploy to. So you define classes/interfaces/enums/typedefs in the same way for JS, Flash, C++, etc. If those types you define do not depend on a specific platform API, they can be reused from platform to platform with no effort at all. All the platforms also share common APIs like XML access, HTTP connections and reflection. Platforms that have things in common (i.e. Neko and PHP) share the same API for things like file access or web-server development.

What are some real world and perhaps under appreciated advantages?

  • If you are experienced with Flash/Flex you know how the compiler can slow down your work (the only advantage is being able to take a coffee break while waiting ;) ). The haXe compiler is many times faster, so fast that most of the time you don't even notice it working.
  • The bytecode produced is much faster than the equivalent produced by Adobe tools.
  • Also in the Flash realm, haXe can "inline" functions or access the Memory features that are only available elsewhere by using Alchemy.
  • In case you need it, you can also decide what version of Flash to target, from 6 to 10; the API has changed a lot but the HaXe language is exactly the same.

Talking about the server side, we all know how ubiquitous PHP is. You can develop an application with HaXe targeting it and scale to Neko or even C++ if your web application grows.

What are the pitfalls or gotchas?

Here's a list of common misconceptions:

  • HaXe is young and immature Not really, HaXe is almost 4 years old now, has seen 25 formal releases (not builds) + 13 alphas and betas, it is updated constantly and has a very dedicated community. It is used professionally by a lot of people in several development areas; take a look at the mailing list archive to find how people use HaXe.

  • HaXe is complicated Because the main target of HaXe is without any question AS3, people expect that it must have wizards or a GUI. As stated HaXe is a language and a compiler which makes it suitable for programmers but not very good for designers.

  • There aren't any IDEs The true part of this is that IDE could be improved in a lot of aspects to better integrate with HaXe but there are already a lot of valid options.

  • The only book published is already outdated There is some truth here too, unfortunately the book was published just a few months before a major release occurred (from V1 to V2). That major release didn't change much, but it did add a few incompatibilities. The book still remains a valid resource (I'm not just saying that because I wrote it ;) )

Franco Ponticelli
Thanks for the response Franco. And the list of IDEs. I am intrigued by the Xcode plugin for HaXe. That looks super sweet! What's the story with UI framework kits and Haxe? For example, will it ever be possible to target say Cocoa with HaXe and get native widgets for OS X? Basically using interface builder and linked together with HaXe source code?
Gordon Potter
If C++ is native enough for you then it is possible. You should wrap Cocoa calls so that they are "reachable" from the code generated by haXe. The current version of haXe as you probably know already enables to develop iPhone apps; of course it is still very experimental. Consider that the C++ target has been introduced only in the latest release.
Franco Ponticelli
There you go, edited to make it easier to read!
RCIX
thank you, appreciated.
Franco Ponticelli
+3  A: 

My primary use of haXe is limited still to Flash development. I'm only slowly warming to the idea that it can be used for other targets. I still don't see the advantages in that direction and do my PHP and JS directly in PHP and JS.

Even though I don't develop for the Neko back-end it is great support to have since it means I can write test cases for code and have them integrated into a build script rather than only being able to run them in a flash player. This is a very good advantage.

The open nature of the code and development is also a good advantage. I really needed a preprocessor and so #line support was added to haXe. I don't think Adobe would ever have taken my request seriously.

I find that being a typed language is huge advantage over many of the new modern languages.

There are several of pitfalls with regards to language consistency and back-end transparency. I keep a list of the ones that affect me here. Of course no language is perfect in this regards but I'm kind of disappointed that a new language has so many.

+2  A: 

yes, completely

BUT it needs a better IDE and documentation, the lack of a great IDE (like an eclipse based one) for me makes all the difference, and I cannot reach the levels of productivity I do in other langauges due to this.

language = great - best by miles development environment = poor (at this time and imho)

nathan
+2  A: 

haXe is an invaluable language. Many of it's plus-points are often overlooked. For example, it has fantastic built-in libraries that make application development sooo much easier, such as a simple but very powerful ORM (Neko/PHP), full cross-platform remoting (Flash/JS/PHP/C++/Neko) where any supported platform can communicate seemlessly with any other platform, a solid regular expressions library (support by all except Flash <8) and many more.

As a note, I recently wrote an application using haXe for PHP/JS/Flash and found the development speed was increased exponentially.

Granted, haXe might not be designer centric, but it's not hardcore, either. haXe is very easy to learn and reuse, and as the number of target platforms increase, haXe developers can target those, too, without having to learn anything new.

+8  A: 

"For people out there using HaXe, what makes it useful for you?"

As a creative flasher I really don't see the point in AS3 anymore! So from a flash user coder/artist here is my take.

On my current project I have a 19yr old who moved from mostly timeline AS2/AS3 to haXe classes under my guidance, and was porting both as2 and as3 code across so I really don't think haXe is any more difficult to use than AS3 or when used in flash significantly different. As far as stability my main current gripe is aspects of the current flash players, haXe really is as stable or more stable than AS3 when developing flash.

Flash evolution has been a constant process of creating libraries that become useless as flash changes, could it be they need to sell software every year!!, and components have always been something I need but sizes are silly so I am not willing to follow like sheep into Flex or even move to the alternative XAML.

The main advantage of HaXe is that you can start to really think of creating classes that are divorced from platform and will be largely useable in 5yrs from now, I doubt that is true of any AS3 you create, haXe has less tie ins, potentially I could compile code to javascript, silverlight, or whatever google bring out next.

My main problems with haXe are that most of the development has been not on Macs so aspects of compiling c++ and new features of haXe sometimes trail from windows users, but I have not had problems with core haXe such as flash compilation.

In terms of designers... well I use a Flash IDE movie loaded at runtime for my visual assets and do the same when developing in AS3 so really my workflow does not depend on AS3/haXe, I like a simple life so I use textmate for either as3 or haxe. I have a passion for the flash IDE and its power but would never use it for code and most of my flash work is largely code, so I am not some Linux hardcore, haXe does not stop you using flash IDE, but if you want to use swfmill or sam you can.

So as I said the question is why waste your time on a commercial language AS3 that is likely to change just to sell future versions and is limited to the flash player.

My second reasoning is that it has not taken me long to get to a stage where I could create a game or complex ide in javascript without needing jquery etc just out of the box haXe...it would work cross browser etc... I mean haXe really lets me take my flash programming skills and interface development understanding outside flash ( having never really used javascript before), if I was to learn pure javascript I would probably not feel so enabled more like someone had cut my arm off and I would be writting very platform specific code, while now I can use feffects for tweening and later add some compiler switches and compile to some other platforms and use some neash/nme.

I actually quite like aspects like the compiler being smart about types allowing my code to be cleaner and typedef's are brilliant.

I looked at PHP and decided it was a messy silly dirty language and same for javascript, I am so glad I can target them with haXe and not have to spend too much time on black hack magic.

If you love to create code for rapid dev of visual creativeness I think haXe is the ideal language and even as a freelancer I am using it commercially.

JLM
+6  A: 

My view of haXe,

Warning the following paragraphs are very philosophical (Practical ones are further down):

As someone who has been open to many programming languages over my short time programming and someone who simply moves on when I feel something isn't working for me; I find that haXe is something that I just can't progress from, I just cant 'better it'.

I had found in the past that the amount of time I spend writing in one particular language relates to two key factors, how much I need to use that language to get the result and how easy I find that language to grasp. But with haXe the grasping period was much shorter, and I attribute this to my small build-up of knowledge in a variety of languages. Until haXe I had never found one that really suited me and that just felt right, they were either to hard to understand or just plain useless; well at least useless from my perspective.

HaXe had allowed me to be a lot more expressive with how I write, I don't mean the 'expressive' as in the quality that everyone talks about languages having I meant the ability to just have an idea and run with it, to try something out the way I feel is right. Whether it succeeds or totally fails.

HaXe has been a very easy learning curve for me, with my general background in c style languages and AS2/3, and I have not really had any trouble picking it up. One thing that always stymied my progression with a new language was understanding the concept behind that particular syntax/framework, but even once I had passed that hurdle I would often find that the language was in itself either limited, limiting or both. With haXe I'm neither limited nor am I finding the language itself to limit me. With haXe there is no glass ceiling, but the is a glass floor, in that there is no limit to what you can do but you can clearly see how you got there

Picking up haXe isn't like picking up some sticks and making fire, but nor is it like going out and buying a oxyacetylene set and starting a fire with that. In that sense haXe is closer to a match, that you can reuse. It follows almost all of the conversions of something that your used to but adds useful new features. But to do so it doesn't reinvent the wheel entirely, it just fixes the rotten bits. (ok fewer analogies in the next paragraph)

Practical things:

The language is simple easy and standardised, whilst still allowing the programmer to go as far as they like.

Your can write a very high level piece of code or go and fiddle with the little bits and pieces (to a serious degree on some platforms)

HaXe doesn't dictate what you can and can't do on any one platform, it gives (or plans to give you) full access to everything, but where it can it adds a standardised way of doing things.

The mailing list is very helpful and responsive and the forum is even picking up pace now.

The language is constantly being changed (in minor ways) with new things added in every release.

There are very few real bugs coming through for the main API and even fewer for the compiler.

Every one talks openly about the language its direction and the direction they suggest for haXe (and or course why it should take that direction)

And finally haXe isn't some big private venture by a large (or even small) company to make money out of you as a developer, instead it is created for all developers to use, build upon and improve. And that is why I feel haXe is where I want to be. (now to go back to coding)

Othrayte
+4  A: 

If you want to have a short answer: YES!

For people out there using HaXe, what makes it useful for you?

The most of the time I use haXe for the server side. (This means PHP or neko target). In my opinion PHP is the most sucking language I ever used, that was the reason I started using haXe: Having a useable language.

Another big advantages for me is, that haXe is open source.

Does it provide significant portability?

Having the same code on different targets! I could not imagine any way to have more portabillity.

Migrating a website from PHP to mod_tora, which performs 40-80 times faster then PHP, oftens just requires 5 minutes of work???

What are some real world and perhaps under appreciated advantages?

  • The biggest advantage is portability of code and the excellent options to communicate between the platforms, it was never easier to handle data between client and server. (Take a look at the Remoting section in the wiki.)
  • The community is great. (If you like mailing lists at least. :-)
  • Another thing is: If you need to perform very platform native operations that are not supported by haXe (which happens very seldom), haXe always gives you the options to target them. It's called the haXe magic. In other words: you could to everything you could do in the native language of the platform + all the nice thing haXe offers you.

What are the pitfalls or gotchas?

  • Documentation, sometimes installation are not 100% perfect. The support for IDEs could be improved a lot.
  • Also the JavaScript target is sometimes hard to use, because haXe provides a really good language, but some kind of framework for the most common DOM manipulations is missing, but I think some people are working on that ;-)
  • If I have to work for clients they sometimes dislike the idea to have their project realised in such a unknown language.

P.S.: I think it always worth to learn a new language, as it improves you programming skills and experiences.

Hippo
mode_tora sounds interesting. But what do you do if you don't have/want apache's httpd? There's a server in neko, but the documentation says it's just for development.
stesch
+2  A: 

Subjectively I find I'm more productive in haxe than any other language. I use haxe mainly targetting neko and javascript.

The compiler itself is very fast which allows me to use haxe like a scripting language. It leans towards object orientation but has a number of functional tools; first class functions, functional match, lambda libraries.

I find the speed of neko sufficient, and it's small image size great for constrained environments. It's C FFI is excellent - very simple to add new functionality.

I use haxe for my javascript client side controller, firing events to a standard jQuery view. This works really well as you can type check your client and server code simultaneously, while keeping untyped raw js to a minimum and retain the benefits of the usual js libraries. JSON libraries available. Btw, although haxe does come with mod_* for apache etc, I find using a proxy much more flexible, so i can set up multiple neko instances behind the web server.

On the whole I think it's very well rounded and thought out - and critically it works as advertised on all platforms.

bd

+3  A: 

Well your question is already answered but I'd like to add a few short blurbs.

I learned and used haXe entensively after the first betas and have been using it ever since. It was the first language I learned (I was also still in college at the time) that really made me understand the difference between language and API.

You see at college I first learned AS2, then PHP, then some Javascript. We had no formal introduction to programming (and I wasn't studying computer science anyway). These languages are all pretty tied to the platforms so as a newbie programmer I automatically assumed that things like strlen() is PHP, MovieClip is AS2, ...

By using haXe I actually understood the value of object oriented design, since the platform was no longer restraining my classes. I could reuse code written for a Flash project in my regular web code, if I seperated them from their platform specifics well enough.

Because of the excellent remoting classes you can use to communicate between platforms, I also realized XML isn't all that special, nor is JSON, it's all meaningless without code that acts upon it.

For someone like me who just started programming, that was a pretty big revelation in a time when XML was 'cool' and good for everything ;-)

Danny Wilson
+1  A: 

I've been coding haXe in personal and professional uses for about 2 years. There are certain advantages that it has that you won't get from other languages, the biggest one being that it was designed nearly from the beginning as a modern production-grade compiler that can adapt flexibly to new platforms and take advantage of their unique features. This makes it the closest thing out there to a higher-level version of C. If you write code in haXe, you can count on it sticking around.

Community uptake has been stronger than you'd think - I did a little analysis of list traffic in terms of compressed kilobytes(from the data on http://lists.motion-twin.com/pipermail/haxe/ ) and the result shows a 25-50% YTD(Jan-September) increase each year since 2006. In the last six months traffic has really exploded and I'm seriously considering going to digest because otherwise my inbox gets flooded with hundreds of messages on haXe if I leave it for more than a day. It's not as hyped as other languages, but that in turn means that the people hitching their wagons to haXe tend to be confident, well-informed programmers.

People have experimented with language-to-language compilers in other contexts(Scheme anywhere, Python or Ruby in JS, etc.) but those languages were designed for a different place and purpose, and in translation lose a lot of their best aspects, making the results cool hacks, but not comfortable for day-to-day work. haXe doesn't feel like that; while it doesn't have the conveniences that come from having language/runtime integration, it has a lot of other cool stuff to offer right now.