5 ms·
The headline is sort of misleading. It is (appropriately) primarily about inappropriate abstractions. As you say, some abstractions are unavoidable. Even assemb
by ghaff 4y ago
The headline is sort of misleading. It is (appropriately) primarily about inappropriate abstractions. As you say, some abstractions are unavoidable. Even assembly language is an abstraction.
- cryptonector 4y agoThat's why real programmers write binary object code directly.
- nine_k 4y agoDon't tell them about the lost art of loading microcode on boot.
- fnordpiglet 4y agoI wire my magnetic core with artisanal copper.
- choeger 4y agoYou use copper? These kids today...
- noam_k 4y agoRelevant xkcd: https://xkcd.com/378/ https://xkcd.com/378/
- PeterCorless 4y agoDammit, emacs!
- LAC-Tech 4y agoAh yes, the All Abstractions Are Equal fallacy.
- naasking 4y agoBinary is an abstraction. I tap the clock and data lines line manually with a battery. Boy are my fingers tired.
- agentultra 4y agoI pick only the best artisinal integer representations for my programs. Only fools use abstractions.
- dlivingston 4y ago> Even assembly language is an abstraction Is this true? I thought assembly mapped 1-to-1 with actual HW instructions. If so, assembly wouldn't be an abstraction, it would be an interface.
- Spivak 4y agoNope, the CPU presents you an interface of the available instructions but those instructions are a complete fiction on modern processors and don't have to match at all what the underlying hardware does. The CPU guarantees that the observable effects of the instructions are consistent (i.e if the processor wants to do some fuckery it can't change the instruction semantics) but beyond that is free to run your code however it wants.
- nine_k 4y agoSimpler RISC designs, like simpler ARM cores, more or less directly execute instructions; same for old 8-bit cores you can still widely find in MCUs. Complex high-performance cores, with pipelining, instruction fusion, and OoO execution, turn instruction stream into a microcode lava.
- Spivak 4y agoSo maybe the right thing to say is that assembly is a contract between you and the processor and the underlying implementation can map directly to hardware when appropriate but it doesn't have to. It is an abstraction over different underlying hardware implementations.
- nine_k 4y agoFirst of all, you normally use symbolic labels, not offsets for jumps; the assembler will calculate them for you, and a linker will possibly build a relocation table based on them. Then, any good assembler has macros. Also, data / text blocks, etc that are not code but an abstraction which the linker later uses. Writing machine code directly, as a byte stream, is fun, but is exhausting.
- taeric 4y agoI think arguing that assembly is an abstraction is going the wrong direction on why it is hard. Assembly largely forces numerical abstraction on your problem. Which is a lot harder to reason about than folks want to acknowledge. That is, higher level languages let you get farther away from the abstraction that is the computer itself. As such, you can have a less abstract program in a language that has higher abstraction away from the execution environment.