What language is Sun's JVM written in?
+5
A:
C.
Sun's not a Java shop; it's a C shop. That's what Solaris is written in.
duffymo
2009-01-04 02:48:45
It should be noted that nearly all the Java standard libraries however are written in Java.
cletus
2009-01-04 02:51:56
Absolutely correct, of course, but the question was about the JVM itself.
duffymo
2009-01-04 02:52:36
At a guess, the C source includes some ASM - conditionally compiled on certain mainstream architectures.
slim
2009-01-04 02:54:56
slim
2009-01-04 03:05:14
Still, a large part of the JVM is written in C. (Or, was when I last looked at it.)
Jonathan Leffler
2009-01-04 03:13:21
slim: The interpreters are written in an assembly language-like way in C++ (the C++ generates machine code).
Tom Hawtin - tackline
2009-01-04 13:38:12
Some of the libraries are written in C, some date back to before Java. Most of the libraries are Java. HotSpot is low-church C++, not C.
Tom Hawtin - tackline
2009-01-04 13:39:41
Silly response. They were supposed to jump in the time machine and suggest Java for implementing Unix in 1970? They were supposed to rewrite their Solaris in Java? There have been a few Java OS's written, none targeting servers like Solaris does.
John M
2009-01-09 20:21:36
+9
A:
Strictly speaking, C++ (the JVM code does make use of C++ OO facilities).
Neil Coffey
2009-01-04 04:06:21
+6
A:
You can find out for yourself at: http://www.sun.com/software/opensource/java/.
Anthony Cuozzo
2009-01-04 08:22:23
+12
A:
Sun actually has multiple JVMs. The HotSpot JVM is written largely in C++, because HotSpot is heavily based on the Animorphic Smalltalk VM which is written in C++.
More interesting than HotSpot is IMHO the Maxine Research VM, which is written (almost) completely in Java.
Jörg W Mittag
2009-01-04 13:23:01
"Low-church C++" would be a more accurate way of describing it.
Tom Hawtin - tackline
2009-01-04 13:41:08
Maxine will be definitely such a great thing, when it'll be ready!
ivan_ivanovich_ivanoff
2009-04-08 17:58:42
Well, it's a research project. By definition, it'll never be ready.
Jörg W Mittag
2009-04-08 21:07:52