Re:Zlib-rs is faster than C
by throwaway2037 on Monday March 17, 2025 @12:59AM
(#43385347)
> What language is the JVM written in?
I am pretty sure it is C++.I like your second paragraph. It is well written.
Depends 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.
Re:Zlib-rs is faster than C
by throwaway2037 on Monday March 17, 2025 @04:25AM
(#43386246)
You 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.
Define mostly, 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.
JDK≠JVM
If you are only talking about libjvm.so you would be right, then again that alone won't do much help for Java developers.
That is what most people are talking about when they are discussing the JVM, yes
I 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.
Re:Zlib-rs is faster than C
by sunshowers on Monday March 17, 2025 @03:35AM
(#43386030)
Does it help to think of "safe Rust" as a language that's written in "unsafe Rust"? That's basically what it is.
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.