Reflections on Haxe as a better Javascript

277 views
Skip to first unread message

Dario Elyasy

unread,
Sep 15, 2014, 3:02:34 AM9/15/14
to haxe...@googlegroups.com
I am currently researching various languages for Web development, and how they compare to Haxe. Assuming that we just restrict ourselves to the JavaScript ecosystem, there are several attempts to replace/improve JavaScript, like CoffeScript, Dart, TypeScript.
I have found an interesting (multi-part) blog post that discusses JavaScript shortcomings, and how languages like CoffeScript, Dart and TypeScript try to address them but perhaps not really succeed. Finally there is a concluding blog post here
where there is a discussion about what a real new JavaScript should be. How well do you think Haxe address all the issues discussed?  If Haxe is really better than other alternatives, Is the Haxe Foundation succeeding in marketing Haxe for Web development, like it is for game development?

Juraj Kirchheim

unread,
Sep 15, 2014, 3:45:06 AM9/15/14
to haxe...@googlegroups.com
If you actually believe that type systems are minor details and that pro
> --
> To post to this group haxe...@googlegroups.com
> http://groups.google.com/group/haxelang?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Haxe" group.
> For more options, visit https://groups.google.com/d/optout.

Daniel Glazman

unread,
Sep 15, 2014, 3:50:11 AM9/15/14
to haxe...@googlegroups.com
This is not as simple as it seems to be. JavaScript is now almost
twenty years old and is, by far, the most common programming language.
It's not only #1, it's now reaching new market segments that were
completely out of reach a few years ago. It's _increasing_.

There are zillions of public web sites, intranets, services, appliances
relying on it. There are attempts to replace EcmaScript (that's the name
of the standard version) by other, more "modern" languages, but this is
difficult for several reasons:

1. it's hard to change a whole ecosystem

2. dropping JS is totally impossible and adding a second programming
language to web pages would mean a hit on footprint and performance.
And bugs...

3. there is no consensus at all on a potential successor to JS

</Daniel>

Juraj Kirchheim

unread,
Sep 15, 2014, 3:51:42 AM9/15/14
to haxe...@googlegroups.com
On Mon, Sep 15, 2014 at 9:45 AM, Juraj Kirchheim <back...@gmail.com> wrote:
> If you actually believe that type systems are minor details and that pro

... whoop ... totype based dynamically typed languages are the way
forward, then I think you will find that Haxe is as much as a failure
as TypeScript. As for marketing, the short version is that we suck at
it. This is an ongoing issue. I'm not sure there is a simple solution
to that.

As for the other issues, maybe you could explain what *you* are
interested in. If it's a language as laid out there, then Haxe
definitely is not what you are looking for. I would say though that I
highly doubt some of the premises made in the articles.

Best,
Juraj

Dario Elyasy

unread,
Sep 15, 2014, 5:49:19 AM9/15/14
to haxe...@googlegroups.com
What i am interested in is developing web applications. Both front end and back end. I really like Haxe as a language, in particular its flexibility. But because of what it seems lack of focus of Haxe users to create an analog of what OpenFl did for people coming to Haxe from Flash,  I will probably fall back to TypeScript. I think that Haxe is loosing its chance of becoming a real potential alternative to JavaScript, because of this apparent lack of focus vs other efforts like TypeScript . The focus on only game development in the Haxe community is killing usage of Haxe as a general multiplatform language as it was supposed to be. Perhaps I am wrong, Perhaps there are still several developers that use Haxe for Web development, but all their efforts should be much more focused and again in my opinion there should an entity similar to openfl concentrating all efforts of people using haxe for Web Development. Web development is probably the biggest potential use-case for Haxe and this lack of focus is quite sad.

Juraj Kirchheim

unread,
Sep 15, 2014, 6:33:54 AM9/15/14
to haxe...@googlegroups.com
On Mon, Sep 15, 2014 at 11:49 AM, Dario Elyasy <dar...@beyond-eye.com> wrote:
> What i am interested in is developing web applications. Both front end and
> back end. I really like Haxe as a language, in particular its flexibility.
> But because of what it seems lack of focus of Haxe users to create an analog
> of what OpenFl did for people coming to Haxe from Flash, I will probably
> fall back to TypeScript.

Well, OpenFl didn't bring as much people as Adobe screwing up flash.
Had they not basically committed platform suicide, who knows whether
people would care for OpenFl that much. All migration is painful. To
most people at least.

> I think that Haxe is loosing its chance of becoming
> a real potential alternative to JavaScript, because of this apparent lack of
> focus vs other efforts like TypeScript . The focus on only game development
> in the Haxe community is killing usage of Haxe as a general multiplatform
> language as it was supposed to be.

Not really. The success in one area is not hindering the other. In
fact I think the haxe/js ecosystem is growing faster than it did
before the flash exodus.

> Perhaps I am wrong, Perhaps there are
> still several developers that use Haxe for Web development, but all their
> efforts should be much more focused and again in my opinion there should an
> entity similar to openfl concentrating all efforts of people using haxe for
> Web Development.

OpenFl is not really concentrating efforts so much. It presents a
familiar API, which is not fundamentally better or worse than the DOM
API, which is readily available for usage with Haxe.

Maybe you could explain what it is that you really think is missing
with Haxe and how using TypeScript will solve this problem for you?

Best,
Juraj

Adrian Veith

unread,
Sep 15, 2014, 7:14:26 AM9/15/14
to haxe...@googlegroups.com
I wouldn't say that Haxe is focused on game development only. We use it since 2006 and never wrote a single line of a game. We use Haxe->neko for server side modules and extension modules for Windows Client Apps. Haxe->JavaScript for Web applications and mobile Apps.

If you need to access other JavaScript libraries, there is of course the need to write an external class in Haxe to access that lib. But I never found that a problem, in contrary it helps you to understand that lib better. But I am not a web developer - Haxe helped me to tame the JavaScript monster.

IMHO Haxe is the best real usable multiplatform language around.

best, Adrian.
--

Franco Ponticelli

unread,
Sep 15, 2014, 10:00:59 AM9/15/14
to haxe...@googlegroups.com
I use haxe/js professionally for years now and never made a game with it :)
The only big frustration I am experiencing is the lack of official support for nodejs. Having to write externs manually can be very frustrating even if there are a few libraries out there trying to accomplish exactly that. Hopefully this is something will be "officially" addressed soon.
Beside that, coding in Haxe is always a pleasure.

Dario Elyasy

unread,
Sep 15, 2014, 10:54:53 AM9/15/14
to haxe...@googlegroups.com
Ok sorry I do not want to start a flame war around TypeScript vs Haxe comparison.
I will be very happy code in Haxe and not in TypeScript. 
There is nothing in TypeScript as a language (except some small details here and there) that I prefer vs Haxe.
The  point is that TypeScript has a HUGE pool of users and open source code. For example look here


Haxe has 10-15 times less source code activity on github than TypeScript according statistics from 2013.
Now , from many point of views, TypeScript and Haxe has very similar syntax and features (well TypeScript has actually a small subset of Haxe features).
So we can think of the Haxe community actually building on the success of TypeScript
We can think of translating (perhaps we some semi-automated way, like this https://github.com/Ezelia/ts2haxe
tools and good projects done in the TypeScript community.
I also think that Haxe should have a project like
that is a central repository and an automated manager of external JavaScript libraries

I discover now that there is already a haxe project  for translating  Typescript external definitions to haxe

Philippe Elsass

unread,
Sep 15, 2014, 12:15:02 PM9/15/14
to haxe...@googlegroups.com
We're using Haxe JS heavily and not for gaming, and as web projects complexity increase, it proves immensely more productive to use Haxe instead of JS.
I'd say that Typescript can be seen as a very limited subset of the benefits Haxe offers, but the community is arguably a larger than Haxe's.

IMHO focusing Haxe communication around the great Haxe game frameworks is a big mistake: we need to tap in the huge JS developers pool.

There have been discussions around translating definitelytyped definitions into Haxe externs and I hope this goes somewhere.
Another thing that could drive Haxe adoption is providing ready to use integration points in gulp/grunt/npm/etc.

Cheers


--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.



--
Philippe

Raivo Fishmeister

unread,
Sep 15, 2014, 1:33:56 PM9/15/14
to haxe...@googlegroups.com
Real Haxe/JS based frameworks and libraries can boost popularity in this area, so that people first get attracted to these products, and then Haxe innocently pops up as a underlaying solution.

I'm planning to write one myself but it's for future.

Dario Elyasy

unread,
Sep 15, 2014, 2:59:48 PM9/15/14
to haxe...@googlegroups.com
About translating definitelytyped definitions. It does not seem to me too hard a challenge. I would be happy to help, Somebody knows who where the people involved in this effort, so that I can contact them?
Dario

Rafael Oliveira

unread,
Sep 15, 2014, 4:28:40 PM9/15/14
to haxe...@googlegroups.com
I found this in the haxe.org:

Haxe JS Kit
A collection of externs to interact with key JS projects, including NodeJS, Express, Socket.io and more.

Nicolas Cannasse

unread,
Sep 15, 2014, 5:18:25 PM9/15/14
to haxe...@googlegroups.com
Le 15/09/2014 18:14, Philippe Elsass a écrit :
> We're using Haxe JS heavily and not for gaming, and as web projects
> complexity increase, it proves immensely more productive to use Haxe
> instead of JS.
> I'd say that Typescript can be seen as a very limited subset of the
> benefits Haxe offers, but the community is arguably a larger than Haxe's.
>
> IMHO focusing Haxe communication around the great Haxe game frameworks
> is a big mistake: we need to tap in the huge JS developers pool.

Just to comment on this : Haxe Foundation has not yet started actively
communicating around Haxe. So far our work has been mostly technical
(maintaining and extending the compiler) and documentation/positioning
(the new haxe.org website).

We are currently evaluating the best scenarios to develop communication
for Haxe and while games are being one of them, it's definitely not the
only one and Web development (both client/JS and server side) are also
considered as much if not more important.

Best,
Nicolas

Philippe Elsass

unread,
Sep 15, 2014, 5:57:04 PM9/15/14
to haxe...@googlegroups.com

Nicolas: yes I'm not talking about the foundation but in general, like in the fosdem letter, and simply around my experience explaining that using Haxe isn't only about using OpenFL to do Flash-like stuff.

Confidant

unread,
Sep 15, 2014, 11:44:20 PM9/15/14
to haxe...@googlegroups.com
I too have never used Haxe for making games (although I'm interested). My professional activity seems to be mainly doing browser-based interactive experiences using either OpenFL or piggybacking on JS libraries such as EaselJS, OpenLayers, JQuery, or Three.js.

Confidant

unread,
Sep 15, 2014, 11:45:55 PM9/15/14
to haxe...@googlegroups.com
Forgot to say, I've been using it since about 2010.

TroyWorks

unread,
Sep 16, 2014, 12:14:55 AM9/16/14
to haxe...@googlegroups.com

Strong typing be damned, Javascript will be around longer than cockroaches.  It's the assembly language of the web.

Have you used TypeScript on any project of complexity yet?   I have used TypeScript, and .um... at least on my (realtively new machine) TypeScript complier was sloow. Of course your mileage might vary, they might improve it.

Both TypeScript and Haxe suffer from the externs achilles heel, as often a project is 30% to 70% external libs.  Bridging the gap is t's a treadmill to continually walk. As soon as you hit a new version of a popular lib with an API change, or one you like but doesnt have a TypeScript, you'll have to learn how to do it, and maintain it, and it's fun is relative to the complexity of how many types and libraries, have to be converted.

That said, Type Safety it's an insurance policy, you can just use Dynamic, but so get fractional benefits, and/or find some boundaries where haxe to js ends and some other framework picks up.  Haxe unlike many other language does allow you to reuse common logic in different langauges (js, vs php), which is handy in isomorphic partial driven websites.

Also some IDE's (e.g. IntelliJ) add their own checking but this is still limited relative to a full type system.  As well if you know what your doing it IS possible to code in plain old javascript without typescript/etc, which in a startup culture can get the first version out the door.

There was a chance to turn javascript into something resembling classes (EcmaScript strict), but that never came to be in the browsers. Actionscript 3.0 was I think closest.
Reply all
Reply to author
Forward
0 new messages