Remix.run Logo
bhaak 3 days ago

The JVM proved to the mainstream that a virtual machine good be as fast (sometimes even faster) than a compiled binary. Because of that it took a lot of the market share of C/C++ in the 90s.

You got a buffer overflow safe language without compromise of speed. After it has been loaded, of course. But that's why Java had such a tremendous effect in Web services where the load times are negligible to the run time.

eru 3 days ago | parent [-]

Of course, eliminating buffer overflows is orthogonal to using a virtual machine.

bhaak 3 days ago | parent | next [-]

You also got a language easier to use and learn than C/C++.

With universities almost immediately jumping to Java as an introductory language you got way more potential employees.

writebetterc 3 days ago | parent | prev [-]

No, it's not? Using a VM is one way of preventing buffer overflows, it's not orthogonal.

eru 3 days ago | parent [-]

You can prevent buffer overflows even when you don't use a VM. Eg it's perfectly legal for your C compiler to insert checks. But there are also languages like Rust or Haskell that demand an absence of buffer overflows.

You can design a VM that still allows for buffer overflows. Eg you can compile C via the low-level-virtual-machine, and still get buffer overflows.

Any combination of VM (Yes/No) and buffer-overflows (Yes/No) is possible.

I agree that using a VM is one possible way to prevent buffer overflows.