3 ms·
It's hard because yes it's true that Java and C# have fully defined behaviour (at least to my knowledge, and when you assume that the garbage collection is opti
by tinco 13y ago
It's hard because yes it's true that Java and C# have fully defined behaviour (at least to my knowledge, and when you assume that the garbage collection is optimal) the operations of the VM's themselves are written in C. So you are still dependant on that the programmers of your VM are in control of the undefined behaviour of C.
I know that sounds a bit like a cop out, but it lays the finger on the pain point of modern computing, that whatever we do, we are still so heavily reliant on C for everything low level.
How would we come close? I'd say name a language whose JIT directly outputs (x86) assembly, and whose runtime is written in a runtime free version that is output by that same JIT.
The only language I know of that can do that atm is Rust.
- moomin 13y agoRust, of course, uses LLVM, which is written in C++.
- Dylan16807 13y agoYou can use defensive C that checks for undefined behavior whenever it could possibly occur to implement the runtime of an undefined-free language. And with intelligent coding you could probably get those checks to be very minimal.