When comparing Assembly vs Haxe, the Slant community recommends Haxe for most people. In the question“What is the best programming language to learn first?” Haxe is ranked 36th while Assembly is ranked 49th. The most important reason people chose Haxe is:
Ranked in these QuestionsQuestion Ranking
Pro Low Level - it's how the computer works
One of the best ways to learn how a computer actually works is to work your way up from lower level abstractions. Assembly, being only a level above machine code, is low enough level to make it clear how the computer is actually performing a computation, including code flow and loops, but high enough level to not be excessively tedious for the type of small projects that a student would do at the beginning of their first programming class. Use of an assembler with macros can stretch this even a bit further.
Pro You must look into it if you really want to understand what computers do.
There is no other way to understand a processor, so dig in.
Pro Naturally creates fast and small programs
Because of its natural syntax and low-level nature, assembly language programs are typically really small and fast.
Unlike other programming languages, in assembly language it is really hard to create a slow and over-bloated program.
Pro Useful for embedded systems
A curriculum that involves an embedded component, such as an Arduino or a Raspberry Pi, can encourage students by allowing them to immediately connect their work with 'real systems'. Assembly is the ideal language for getting started with and understanding these devices, and since Assembly can be called from C, the code will still be useful if students move on to C later in the program.
Pro Uniform syntax
Assembly language syntax is relatively uniform, and so there's less room for a student to get confused by obscure characters, or miss some meaning implied by structure, such as with scoping rules, or call-by-name/value/reference semantics. While there may be a lot of mnemonics to look up, most work involves only a very small subset of them.
Pro Compiles to multiple platforms and languages
Haxe allows you to develop for Web, iOS, Android, Blackberry, Windows, OSX, Linux and others, all at once, without the need to switch languages and maintain separate code bases.
Support for even more platforms and languages is under development.
Pro Powerfully expressive but easy to learn
The language was designed to be very expressive with the smallest possible amount of syntactic sugar. There are actually fewer keywords than other languages with similar power.
Pro Pick up errors at compile time
Pro First class code completion
Code completion is built into the compiler and available to the IDE allowing for much smarter code completion that can actually parse and understand the syntax tree.
Pro Syntactic macros
Syntactic macros allow you to extend compiler features at the syntax tree step. Macros come into play after code is parsed into the abstract syntax tree, and macros allow you to transform it before the rest of the compilation completes.
This provides for immense power, while at the same time scoping the extensibility at a level that is powerful, but well constrained.
Pro Code reuse server side and client side
You can use the same classes on the server as you do on the client where applicable. This saves a lot of time.
Pro Extremely fast compilation
Haxe can easily compile over 100,000 lines of code to JS in seconds on a mid-spec computer.
Pro Ability to use existing JS libraries
Haxe has the ability to use "externs". These are haxe files which describe the usage of existing JS libraries. Get code completion and compile-time-checking for everything from jQuery to Node.js.
Even without externs, native JS code can still be used through untyped code.
Pro Small, readable output
The output that is generated can be trimmed using "dead code elimination" to only include those functions and libraries that are strictly necessary. All code is very readable with only minimal extras for specific functionality.
Small output is good for frontend development as file size is a major concern.
Pro Powerful type inference with strong typing
After a type is inferred from its context, it cannot be changed to a new type, and type safety is done at compile time so it stays safe without the extra maintenance required for static typing.
Pro Algebraic data types and pattern matching.
Pro Large library support. From servers to games.
Pro Established project
Haxe has been around for more than 10 years (since 2005) and whilst not the most popular project, has had continuous growth.
Highly unlikely to disappear or for support to stop.
Pro Friendly community
Pro Offload execution to the server with remoting
Using a remoting proxy you can get type safe server to client communications, allowing for remote method execution on the server as if they were part of the client side code.
Pro Package management like Java
Package tree is just directory tree, it's wonderful!
Pro Builtin conditional compilation support
Haxe supports conditional compilation, so depending on compiler flags Haxe will include or exlcude sections of your code. Making it easy to have debug and release builds.
Pro Abstract enums allow constants with exhaustiveness check
You can define constants in an abstract enum and when used in a switch/case statement Haxe checks for exhaustiveness, making sure every constant is covered - with no runtime implication.
Pro Type safety for exísting JS libraries
Haxe compiler will check types when using externs for existing libraries.
Pro Available in NPM
Pro Ability to skip type checking when calling non Haxe code
You should use externs when calling non Haxe code, but if you just need to call one or two external JS functions, you can skip type checking by calling untyped code.
Pro Create without needing to be limited to a language, target, or commercial ecosystem
Pro Abstracts allows me to create more intative api's without runtime overhead
Pro Can create complex applications without needing webpack, npm or other crutches
Haxe has the power and expression to not need the npm dependancy hell that is common in js and typescript, bit it's still simple.
Con Difficult learning curve
Starting off as a beginner with assembly language could prove very daunting. I suggest learning a high level language first (e.g. C) to get a good grasp of programming - especially dealing with bits, bytes, numbers, accessing memory with pointers (which is why I suggest C).
Then once that person is comfortable writing C (or whatever high level language) programs, they would find moving to assembler a little less of a "What the hell?!!!" experience.
Con Rarely a requirement or used in professional employment
(except for experts, which will outperform you in assembly language and execution speed on any day of the week, simply because they have full control of the processor.)
Con Not very portable
The instruction set may change depending on what CPU architecture is being used. Also, there will be some differences in implementations due to different assemblers being used, such as with changes in OS.
Con Hyperspecific syntax isn't a good first step to learning other modern languages
Con Bad support in some popular IDEs
While it has great support in Visual Studio Code and Vim for example, it still lacks support in some IDEs such as IntelliJ.
Some popular libs like JQuery have maintained externs, for any specific code or lib already in JS you have to write the externs to use it in your haxe application.
Con No Qt support
There is currently no support for Qt.
Con Full programs only
You can create small utility functions with Haxe, but generally it is a lot more work than with other JS compilers. Haxe is best used when you have a larger project.