We are largely told that before functions and objects, programmers were filled with ignorance and could not program well. If you were to believe the myths … apparently these brave programmers rescued everyone from the barbaric assembly programmers. This is a revisionist lie.
Valuable techniques that have been lost because of the mass hysteria against assembly. At the heart of it, assembly programming is about moving data from RAM to storage and devices using processes. Assembly was popular even till the early 2000s as plenty of Game Boy games were done in assembly. The biggest failing of assembly is perhaps the obfuscated terse words. Can there be a better assembler which can use readable mnemonics ?
- Dispatch Tables
- Decision Tables
They promote a style of 2D code organization using arrays.
Error Flow based on unrestricted goto
Even lisps condition/restart is implemented using setjmp/longjmp but with stack unwinding.
- Global Data as configuration and extensions
Why not use the code itself for configuration ?
Stack based operations
Most programmers are not aware of how you need symbol tables and stacks to implement subroutines.
State machines using gotos for transitions. GOTO’s are easier to follow than recursion. Even novices understand GOTO’s. Besides recursion always needs an additional state variable, which is slow. Turing machine is made up of GOTOS and branches and yet modern languages restrict it.
Self-rewriting code is epic on all accounts and it beats Lisp’s macros. You know … all the crazy exploits use this.
Assembly is perfect.
In assembly code = data. In fact that is the basis of the turing machine.
It is convenient for programmers to omit history.
The defect rate in an x86 processor is 0. How many bugs are there in your compiler ?
x86 is backwards compatible. Each instruction is executed in fixed time. How many instructions does a language feature cost ? Why can’t C++ just give a number for this ? You can’t write boot code in your favorite $lang.
If you ever want to fake GOTOs use,
- Mutual Recursion
- Tail Calls / CPS
- Fake an instruction set with an array.
Did the Apollo guidance computers, use co-routines to implement processes like Erlang in a crash-restart way to send a rocket to the moon ? Who knows! Assembly programmers sent a rocket to the moon, the average programmer can’t even program a todo app without consuming all the memory.