Live data from Hacker News

Java Virtual Machine in pure Node.js

github.com

11–20 of 143 posts

Re: Java Virtual Machine in pure Node.js

#12
18ms for calculating Fibonacci numbers from 1 to 10. This is definitily bringing JAVA back to the good old days of enterprise execution speeds. :-)

Really cool proof of concept! I would really enjoy seeing more projects like this!

Re: Java Virtual Machine in pure Node.js

#16
For anyone interested in the details:

-Reads in real .class files

-Uses the JS run-time to implement the Java run-time (e.g. there isn't a garbage collector written in JS, the JS collector is used)

-Only implemented part of java.lang and java.io

Re: Java Virtual Machine in pure Node.js

#17
post #4

Just a toy implementation[1], if someone is wondering. [1]The basic .class file attribute parsers are located in libs/classfile, while a simple bytecode interpreter can be found in jvm.js. It doesn't load a real runtime library (classpath, apache harmony,openjdk,etc...) but it partially implements a few java.* classes in pure javascript under libs/java.

Can someone point out what it can do and what it can not do; I am curious what 2.000 lines of JavaScript can do. How much more code would it take to get a full featured implementation?

Re: Java Virtual Machine in pure Node.js

#18

For anyone interested in the details: -Reads in real .class files -Uses the JS run-time to implement the Java run-time (e.g. there isn't a garbage collector written in JS, the JS collector is used) -Only implemented part of java.lang and java.io

A handful of classes with a few of their methods, in java.lang and java.io.
Post reply on HN