3 ms·
Languages you must know #1 (assembler)
Assembler is fundamental. If you can't write it in assembler then you don't understand it.
Assembler teaches you about machine architecture, including memory, caches, registers, pipelines, paging, micro-operations, program status words, privilege levels, virtual hardware, hardware management co-processors, "trusted" boot routines, GPU/CPU/FPGA co-processing.
You learn all the fundamental programming ideas: sequencing, conditionals, branching, subroutines, memory management, bit/byte/word ideas, interrupts, atomic operations, and fencing.
Data structures such as stacks, queues, heaps, trees, strings, character representations, floating point representations, byte packing, and bit-banging.
Issues such as cache timing, instruction scheduling, memory protection, memory-mapped I/O, instruction timing, I/O ports, virtual hardware support, power management, cache coordination.
More things like garbage collection, disk I/O, file system structure, linkers, loaders, libraries.
Operating system ideas like task switching, I/O buffering, networking, time sharing.
Ideas like row-hammering to change protected memory, return-oriented programming to use library code to execute what you can't execute, stack smashing for fun and profit. Micro-timing to break crypto routines.
Best of all: self-modifying code! This idea is either fundamental (if you know what you are doing) or a disaster (if you don't).
Self-modifying code is the basis of learning. Systems learn when they change. The recent AI systems "sort of, kind of, maybe" "learn" by shuffling weights. That's really just glorified pattern recognition (an important idea) but REAL learning requires self-modification.
Everything you ever wanted to know can be learned from assembler.
It's all here. Other languages will teach you new ideas but knowing assembler is fundamental.
- johndoe0815 6y agoAnd learning assembler especially teaches you where and why to avoid it. I'm teaching operating systems, compilers and machine-level programming and it amazes me that there are courses in my field that try to avoid the machine level as far as possible - such as compiler courses that concentrate on the front-end and only talk about code generation as an afterthought or OS courses that only focus on algorithms and data structure and ignore all implementation questions.
- simonblack 6y agoAh, but which assembler? You need to be able to program in assembler without being swamped by recent (last 30 years) worth of enhancements. Or, in other words, not being able to see the woods for the trees. That's why I recommend to people who want to learn assembler to work on the (very basic by today's standards, but still very versatile) 8080/Z80 CPUs using a CP/M emulator.