3 ms·
Haxe has a few more language features (abstract types) and compiler features (dead code elimination) but it lacks a few from Ceylon such as union types. The Ha
by jdonaldson 12y ago
Haxe has a few more language features (abstract types) and compiler features (dead code elimination) but it lacks a few from Ceylon such as union types.
The Haxe compiler is much, much faster than Ceylon. I wonder if certain features just can't pass a speed threshold.
- zem 12y agohaxe's enums seem like full-fledged union types: http://haxe.org/manual/types-enum-instance.html http://haxe.org/manual/types-enum-instance.html
- jdonaldson 12y agoThere's also Ceylon's enumerated subtypes, which look similar: http://ceylon-lang.org/documentation/1.0/introduction/#enumerated_subtypes http://ceylon-lang.org/documentation/1.0/introduction/#enume... However, Haxe's algebraic data types are really not the same thing. It takes a bit more code to achieve an identical effect. On the other hand, algebraic data types are much more general purpose, and allow techniques like pattern matching. http://en.wikipedia.org/wiki/Algebraic_data_type http://en.wikipedia.org/wiki/Algebraic_data_type http://haxe.org/manual/lf-pattern-matching-introduction.html http://haxe.org/manual/lf-pattern-matching-introduction.html In the case of Haxe, you can construct a pattern that uses guards and/or extractors (e.g., a pattern that matches cases where you have an empty Tree, or a tree that contains a specific Node. You could also do matches on structural subtypes, etc.)