3 ms·
What language is the JVM written in? All safe code in existence running on von Neumann architectures is built on a foundation of unsafe code. The goal of all m
by sunshowers 2y ago
What language is the JVM written in?
All safe code in existence running on von Neumann architectures is built on a foundation of unsafe code. The goal of all memory-safe languages is to provide safe abstractions on top of an unsafe core.
- throwaway2037 2y ago> What language is the JVM written in? I am pretty sure it is C++. I like your second paragraph. It is well written.
- pjmlp 2y agoDepends on which JVM you are talking about, some are 100% Java, some are a mix of Java and C, others are a mix of Java and C++, in all cases a bit of Assembly as well.
- throwaway2037 2y agoYou are right. I should have been more clear. I am talking about the bog standard one that most people use from Oracle/OpenJDK. A long time back it was called "HotSpot JVM". That one has source code available on GitHub. It is mostly C++ with a little bit of C and assembly.
- pjmlp 2y agoDefine mostly, https://github.com/openjdk/jdk https://github.com/openjdk/jdk - Java 74.1% - C++ 14.0% - C 7.9% - Assembly 2.7% And those values have been increasing for Java with each OpenJDK release.
- rat87 2y agoI don't think what something was written in should count. Baring bugs it should still be memory safe. But I believe JVM has ffi and as soon as you use ffi you risk messing up that memory safety.
- sunshowers 2y agoDoes it help to think of "safe Rust" as a language that's written in "unsafe Rust"? That's basically what it is.
- pjmlp 2y agoDepends on which JVM you are talking about, some are 100% Java, some are a mix of Java and C, others are a mix of Java and C++, in all cases a bit of Assembly as well.