4 ms·
I was going to say: "the hard part of a JVM is the JIT, GC and the cooperation between. As it stands now I am not sure it's possible to write a good JVM on anyt
by xxs 12y ago
I was going to say: "the hard part of a JVM is the JIT, GC and the cooperation between. As it stands now I am not sure it's possible to write a good JVM on anything but C/asm level language."... But I see it's already done.
- chrisseaton 12y ago> "I am not sure it's possible to write a good JVM on anything but C/asm level language" Graal is one part of a JVM, the JIT compiler, written in Java [0]. It performs about as well as C2, and sometimes better [1]. [0] http://openjdk.java.net/projects/graal/ http://openjdk.java.net/projects/graal/ [1] http://lampwww.epfl.ch/~hmiller/scala2013/resources/pdfs/paper9.pdf http://lampwww.epfl.ch/~hmiller/scala2013/resources/pdfs/pap...
- mike_hearn 12y agoChris, although it's slightly off topic I just want to fanboy your work for a second. Your blog posts about how Graal/Truffle can inline C into Ruby and vice-versa and beat Ruby+C, all on the JVM, is the most mind blowing compiler tech I've ever seen. Saying Graal performs about as well as C2 and sometimes better is modest. The Graal/Truffle combo does a lot more than C2 can ever do. It is only really comparable if you ignore the astonishing capabilities it has vs the competition. For readers who are not aware of this work, and who have an interest in VM/compiler technology, I strong recommend checking out Chris' blog and the Graal/Truffle presentations that are floating around. Basically they've built a program that converts simple syntax tree interpreters into full blown JIT compilers. It means that basically any toy scripting language can have similar performance to, say, Javascript on V8, just by writing the base interpreter with their framework. But where it gets really crazy is when you write an interpreter for C or (say) Objective-C, and start to get aggressive speculative just in time compilation with seamless cross language optimisation, to the extent that C code can actually be run on a compacting garbage collector.
- ayrx 12y ago> It means that basically any toy scripting language can have similar performance to, say, Javascript on V8, just by writing the base interpreter with their framework. That actually sounds a lot like what RPython from PyPy enables.
- mike_hearn 12y agoYes. Some of the underlying theory is the same, but truffle appears to generalise to other languages a lot better (note: I am not an expert)
- ayrx 12y agoAre you aware of any comparisons that shows "truffle appears to generalise to other languages a lot better"? I'd be interested in reading them. :) The performance of various RPython interpreters like PyPy and HippyVM are pretty impressive.
- pron 12y agohttp://www.chrisseaton.com/rubytruffle/deoptimizing/ http://www.chrisseaton.com/rubytruffle/deoptimizing/
- chrisseaton 12y agoI don't know if it could or couldn't be done well in RPython, but one application of Truffle that shows off how well it generalises to other languages is a C interpreter. We use it to interpret Ruby C extensions.
- mike_hearn 12y agoNot aware of any direct comparisons. Perhaps I am engaging in hyperbole :) The reason I said that is I thought RPython is mostly for speeding up Python, and wasn't aware of HippyVM. There are tutorials on how to use Truffle for other languages and some apparently useful implementations though.
- pjmlp 12y agoThere are multiple JVMs written in Java. Besides the sibling post, JikesRVM is one of the most well known ones.