3 ms·
How is this different from compiling Linux from C to LLVM to native code? And why would I ever want to generate native code for an OS at runtime?
by runeks 8y ago
How is this different from compiling Linux from C to LLVM to native code?
And why would I ever want to generate native code for an OS at runtime?
- pjmlp 8y agoNot necessarily at runtime. OS/360 (IBM z nowadays) and OS/400 (IBM i nowadays) work kind of this way. The whole userspace is based on binaries deployed in a bytecode format. They are than AOT compiled into native code at installation time, or anything there are system relevant changes, via a kernel JIT service. Whole mainframe hardware migrations are possible without changing a single thing on the userspace, just doing a system refresh.
- stcredzero 8y agoAnd why would I ever want to generate native code for an OS at runtime? Why? To get write once, run everywhere. If you can do the generation at the speed the data comes off the disk, you're paying nothing for the feature. If you do things right, the abstract memory model can even be bit-identical. Even though there are differences in the underlying hardware, like endianess, all of the virtual ISAs can still implement the same virtual memory model. Smalltalk also does this, and it absolutely works across 100's of combinations of ISA and OS.