Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C yes, assembly--where? Its mapping to machine code is relatively straightforward, and as is the mapping from machine code to ELF. Or do you mean all the magic the CPU does to make it go fast?


Assembler code used to be a close mapping of what the CPU does. But it too is now a high-level language with a funny syntax, it's just that the complexity is hidden by the CPU frontend instead of by a language compiler.


Well, it’s turtles all the way down. [1]

Even the assembly language programmer is running on top of the OS. The OS is deep magic: runtime interrupts happening to make the floating point hardware handle certain edge cases correctly. Fork system calls that semantically provide a copy of the parent’s address space in almost no time by using virtual memory tricks (copy on write pages). Virtual memory itself.

The OS lets the user space assembly language programmer touch some of the hardware directly, but not all of it.

[1] https://en.m.wikipedia.org/wiki/Turtles_all_the_way_down


It's black magic that summons spectres.


Yes, along with complications that arise as you interact with your OS and other programs.


Yeah, in the best case. In the worst case it is more like this: https://news.ycombinator.com/item?id=5261598 which is pretty magic.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: