4 ms·
There are no dumb questions! In non-VM languages everything is compiled down to assembly (or, more accurately, machine code) since that's ultimately what your C
by kaoD 6y ago
There are no dumb questions! In non-VM languages everything is compiled down to assembly (or, more accurately, machine code) since that's ultimately what your CPU executes. Anything else on top of it is just sugar!
Raw machine code does have peripheral access via interrupts and/or the BIOS (which is kind of a "barebones" OS in firmware).
Usually there are several layers of abstraction on top of this (network card drivers, the TCP/IP stack, Unix sockets, etc.) so we don't have to deal with sending raw commands to the network card, but that's just convenience (and those are themselves machine code too).
- The_rationalist 6y agoIn non-VM languages everything is compiled down to assembly (or, more accurately, machine code) This is a misconception: Both AOT and JIT compilers can generate directly machine code OR intermediate representations (bytecode, llvm IR) which ultimately reduce to machine code. AOT and JIT simply differ in when the machine code generation is executed. VM are just a special case of JIT that enable hardware agnosticity without fatELF. The rest of your comment was instructive.
- gpderetta 6y agoNormally VMs (although strictly speaking doesn't have to be) are not only an abstraction layer but also enforce some form of isolation and memory safety.
- The_rationalist 6y agoRight however full featured VMs allow to escape such safety when needed (for performance and interop with the outside world)