4 ms·
The article fully acknowledges this: "However, at the core, TypeScript and Haxe have different design philosophies. TypeScript is a superset of JS. It means it
by larsiusprime 11y ago
The article fully acknowledges this:
"However, at the core, TypeScript and Haxe have different design philosophies. TypeScript is a superset of JS. It means it cannot modify the existing JS syntax and semantics. It adds a static type system and some new constructs (e.g. “proper” class/interface). It is not interested in optimizing the program in any way. Haxe looks like JS, but is more similar to other popular compiled languages like Java/C# regarding to semantics, the use of types, code organization, and optimizations. It also brings in a lot of advanced functional programming concepts.
Which is the better compile-to-JS language? It depends. Existing JS developers will favor TypeScript as they are more similar in many ways. They can utilize their existing skills immediately."
EDIT:
As for how Haxe holds up on generated JS code, you can see for yourself online right here:
http://try.haxe.org/ http://try.haxe.org/
- rictic 11y agoPlaying around with that site, I think that the parent had a good point in bringing up what the output would look like. The output of Haxe is compiler output. Variables are renamed and in some cases elided. If Haxe wasn't working out for a team, they could not easily convert to javascript, as their generated code would be illegible. Typescript on the other hand produces the ES5 that I would have written if I wasn't using Typescript. Variable names are kept, nothing is elided. You can even ask Typescript to translate code with type errors and it happily compiles.