Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Haxe is strange in that it seems to be very well known among developers but relatively very few actually use it. I guess it's an old project with very specific use cases; like building certain kinds of multi-platform apps.

It's nice to see a project with such a dedicated community.

It's a shame that most developers started using TypeScript instead of Haxe; that seems like a missed opportunity. TypeScript was pretty painful to use in its early days; it shows the importance of positioning and marketing.



I've been using TypeScript professionally for over 2 years now and compared to writing JavaScript it's indispensable but for all my personal work I prefer haxe

-- My love list --

- The generated JavaScript is usually faster and smaller after compile-time optimizations, for example, objects can be inlined so they become stack-only and don't hit the GC. Example: https://try.haxe.org/#0F337

- It's expressive (but familiar); nearly everything is an expression and switch statements support pattern matching:

  var animal = { species: "cat", breed: "bengal", age: 15 };
  
  var friendliness = switch animal {
  	case { species: "cat", breed: "russian-blue" }: 100;
  	case { species: "cat", breed: _, age: age } if (age < 5): 300;
  	case { species: "dog", breed: "golden-retriever" }: 1000;
  	default: -1;
  }
- Fast compile times (for sizable projects you get hundreds of milliseconds rather than seconds – and faster still with incremental builds enabled)

- No need for separate tools like webpack:

> You can perform arbitrary compile-time behavior (like processing and embed assets or generating code) by marking haxe code as a macro

> Generates a single bundle by default

> Dead code elimination built-in

-- The downsides --

- Not many people know about it so it's usually better to stick with TypeScript with clients

- The smaller community means if you might have to be more hands-on, both in learning haxe and when it comes to working with haxe libraries – i.e. fixing a bug upstream rather than waiting for the community to fix it

- The package manager is more bare-bones than npm (personally I _much_ prefer this – I find `npm` and `node_modules` can be a nightmare to work with) but there's a general ask in the community for more advanced package management


Well TypeScript also had a huge corporation with infinite budget and a large full time team of contributors and evangelists which probably helped adoption.


Counter-example: Dart.

If corporate support is a definite factor, Dart would have taken off way earlier than now. A bigger factor in TypeScript's success would be the ability to gradually migrate the projects as it's a superset of JavaScript. How do you start migrating? Flip the file extensions from .js to .ts with loose compiler options, then gradually add typing as the options are tightened. It's factors like these that drive spread of language, not "huge corporation with infinite budget and a large full time team of contributors and evangelists." Dart had no short of those and still not much accepted.


It never felt like Google was really committed to Dart the way that Microsoft is going in on Typescript. My recollection is a little hazy, but I want to think Dart originated in the Flash/Silverlight era, when plugins were still an accepted way to do things, then Chrome flirted with adding native runtime support reminiscent of ancient IE VBScript, then things pivoted to chasing the compile-to-JS trend after CoffeeScript popularized that approach, and now it seems to have pivoted again towards cross-platform native app development. Somewhere in there was also server-side programming as well. I get the sense there was never enough focus on any one thing to achieve critical mass.


No, plugins were already on the way out when Dart was released.

In short, some folks at Google had ambitions for Dart to eventually become a web standard with an interpreter built in to browsers, with compile-to-JavaScript used for the transition. That was a radical, unpopular idea and didn't happen even for Chrome, but Dart lives on as a nice compile-to-JavaScript language, and has new life on mobile due to Flutter.

Microsoft had a much more conservative strategy with Typescript and executed on it better. Having modest goals was a big win there.


Dart is vastly underrated.

From an external perspective, Google's enthusiasm for Dart seemed half-hearted at best. Its launch was encumbered by rocky political issues, with half the community terrified that they were looking at a new VBScript, and Google's competitors actively stoking said terrors. It could've jeopardized Chrome's ascendance by turning off tech people, on whom any new software depends for propagation, and giving MS/Apple/Mozilla some room to doubt Google's commitment to the extant web, and that was surely enough to make pouring heavy resources into it a non-starter from a business perspective. It's naive to believe that any technical considerations entered into it.

Take a look at Kubernetes if you want to see what happens when Google is committed to using that G-Juice to cram something down the community's throat.


Dart suffered from corporate politics, Chrome team wasn't really into it, got rescued by Ad Words team, and now are trying to become relevant outside Google with help Flutter.

If Chrome team actually cared about Dart and went ahead with Dartium's integration, Dart's future would have been much different.

Then the Angular team decided to dump Dart and go with Typescript.

So politics as usual.


Dart also suffered from external politics: a chrome-first Dartium VM stank of ActiveX to most people. IIRC Microsoft had discontonued its silverlight plugin for lack of interest/support. The general attitude began to shift towards just JS/HTML5 tooling in the webdev community.

And in addition to not having full support from Google, there was not and probably would never have been buy-in from Mozilla or Microsoft. Also the language IMHO didn't offer much more than JavaScript, and 6to5 -> Babel was gaining traction at the same time. It wasn't a good recipe for success.


Sure, there is always some difference in opinions even within the same organization. However, I do not think it is what killed Dart. It would have been a clear winner with clear traction, people will have changed their mind and adopted it (as many did with TypeScript)

I think it was smart of Google of giving it a fair trial and cut its loss when it was time before it got embarrassing or "coffeescript costly" for many developers.

The problem is that all of those new "beautiful" languages is that they trade pragmatism for purity, but at the end, we all have stuff to build, and at the end of the day, a well known, well tested, and good enough language with some modern construct (a la TypeScript and ES2016+) can become a very powerful tool to build small to big code base, whereas a beautiful near perfect languages would have brought us lot of development frictions or little exhilaration.

There is a reason why the Chrome team was not really into it, and they might have been right, but regardless, they should not be blamed for Dart's fall. As developers, I do not think we want another GWT or Google Gear kind of experience.

TypeScript is successful because it solves the right problem the right way, i.e., adding type without changing everything else around it.


Dart had some other downsides, like you needed Java I think and many developers have an irrational disgust for Java(I hope I remember right)

There are other languages pushed by a big corporation that fail so having the big corporation is a necessary but not sufficient condition.


The syntax looks a bit like a cross between JavaScript and Java, but Dart isn't much at all like Java and doesn't depend on Java.

But you might be remembering the old Dart IDE, which was based on Eclipse.


I think I get confused, google had/has some transpilers/compiulers and other web tools that were based on Java and Java tooling.


You were probably thinking of GWT and/or Closure-Compiler


Side note: it really pisses me off that Google picks language and tool names that have really poor SEO and are often names for existing CS concepts. Go and Dart have terrible SEO, and Chrome and Closure already mean something in their fields.

Drives me nuts.


When it was first announced, I complained about "Go" and someone said it provides an interesting challenge for the search engine team. (There are lots of synonyms.)

I find that searching on "golang" generally does the trick.


Has Dart taken off? I think most people recoiled in horror when they saw the early-days "hello world" turn into millions of lines of generated code.


Only inside Google on the Ad Words team that kind of rescued Dart after the Chrome team stop caring about Dartium.

Now the Flutter project is Dart's last hope to keep it relevant outside Google.

It remains to be seen how serious Google is about Flutter, as the Android team only gives political correct answers when inquired about Flutter vs Android.


Not that I'm aware of, no. I don't know, but it seems to me like WebAssembly is more promising for conveniently bringing all programming languages to web applications, rather than languages like Elm or Dart whose standard implementations compile to JavaScript and are designed only to program web applications.


Dart is not designed only to program web apps

you can target mobile with Flutter, and also command-line etc.


Thank you, I wasn't aware of this.


I think credit has to go to Anders (or perhaps just the whole team). I think the experience of already shipping multiple languages that were used by millions and learning lessons from those has helped enormously in building a language that is actually adopted.

See the discussions of soundness versus usability in typescript where they took a lot of heat from some people, but I believe absolutely have made the correct compromises.


I think the appeal is also based on the name. Dart sounds like a new language aka go/rust/etc. Typescript sounds like Javascript with types. Typescript invites you to try it just based on the name.

Disclaimer: have never used Typescript.


Classic Microsoft: Embrace, extend, extinguish. God I hate Typescript!


Was this response sent from 1998 via a time machine?


Do you know what the best predictor of future behavior is? They're acting all nice and friendly right now, wasn't always like that and there's no reason to assume it always will be. Even the catholic church is pretty chill these days, but give them enough power and they'll have people burning at stakes in no time.


If you became supreme leader of your country, you'll get power drunk in no time. And it's not just you. It's everyone. Power corrupts people. Absolute power corrupts absolutely!

Remember how developers shunned Windows Phone and paid lip service to firefox os, and everything else apart from IOS and android?

Well, you can see how the power is surely corrupting Google. If you don't see it now, give it time. But it's even too late right now.

No amount of bitching will make Microsoft, Apple, Google, Amazon, Facebook and other "big bullies" play nice. What will? Strong, credible competitive threats.

You think Intel processors are expensive? Without AMD Intel processors would cost 4x as much. How much battery life would Intel PCs have without ARM? In fact, I assure you that without AMD, ARM would also be dead because Intel would have simply forbidden their partners from using ARM - the same way Google discourages top android manufacturers from using android forks.

About ur catholic reference - there's only one reason why Catholic churches are "pretty chill these days." And that's competition. New protestant churches are sprouting like grasses everywhere - competition has diluted the power of the church.

Competition is the key to niceness. Just look at the behavior of US ISPs.


Mostly agree...

The reason it's not all about power/competition is that corruption is very easy to get into your system; be that individual, corporate or otherwise; and tricky as hell to weed out. Once you've been there and done that, the bar is set lower for relapse.


Exactly this; frankly, I think it's amazing that Haxe is as relatively well known as it is given it's humble origins at a once obscure* French game development studio.

It's not a surprise at all that the likes of Microsoft and Google and Mozilla are able to promote and push new languages to significant widespread adoption.

*Not so obscure anymore; Motion-Twin is well known for the hit game Dead Cells, and their former employee, Nicolas Cannasse, who is credited with inventing Haxe, went on to found his own studio with its own successful games (Northgard especially)


Exactly, many of the new trendy languages have a corporation behind that can with money and by association get the language known.


>Haxe is strange in that it seems to be very well known among developers but relatively very few actually use it.

So like Lisp, Scheme, Haskell, ML and so on?


The first law of programming language intersectionality is that the interesting things will always be happening in languages other than the one you actually use.


I'd say one of the issues with Haxe was always tooling. I don't know how it is now, but when I was looking at it a few years ago, debugging it wasn't really possible.


These days you can use the debugger in VSCode[0] with the eval target (which is used to execute haxe directly). When writing platform specific code you can use the platform's debuggers, for example, you can use sourcemaps to debug the JS target [1]

[0] https://github.com/vshaxe/eval-debugger

[1] https://haxe.org/manual/debugging-source-map-javascript.html


I really disliked Javascript and swore of it no matter how much it took over the world till typescript. If typescript is not enough, I'll use another language go/python and use web assembly to generate js. js is a byte code to me. However, the advantage of typescript is that I can pull in a js lib and use it.


Same with haxe, you can use an untyped js lib with the `untyped` keyword [0] or use an extern to enable strict typing[1] (like TypeScript's d.ts)

[0] https://haxe.org/manual/target-javascript-injection.html

[1] https://haxe.org/manual/target-javascript-external-libraries...


I like typescript.

I also like purescript - which I like to think of as 'typescript, where the types have teeth' (I like that I can also pull in a js lib and use it)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: