4 ms·
> Turing completeness is why you can run a JVM on top of a C environment. It means that any computation that C could do, the JVM could do. I'm genuinely confus
by haberman 16y ago
> Turing completeness is why you can run a JVM on top of a C environment. It means that any computation that C could do, the JVM could do.
I'm genuinely confused: I thought this was the argument you called a strawman when I argued against it before.
I've already rebutted this argument twice: Brainfuck (http://en.wikipedia.org/wiki/Brainfuck http://en.wikipedia.org/wiki/Brainfuck) is a Turing-complete programming language, and yet you categorically could not implement the Java class libraries on top of it. For example, the java.io.FileReader class could not be implemented on top of it, because Brainfuck does not have any API for opening a file.
Even in cases where you can implement one language on top of another, it may not be efficient to do so. For example, Adobe Alchemy runs C/C++ code on top of Flash/ActionScript at a 2-10x slowdown compared with running the C/C++ directly on the hardware. Implementing a JVM on top of Java appears to be 4-9x slower than implementing it in C/C++ [0] (and that's only comparing two interpreters: the difference is far greater when the C/C++ implementation generates machine code directly).
C gets credit for efficiently supporting a whole host of different VMs with divergent GC schemes and synchronization primitives. That is what makes C special, and why it continues to dominate in system space.
[0] http://portal.acm.org/citation.cfm?id=1294345 http://portal.acm.org/citation.cfm?id=1294345