JavaScript JVM Runs Java 234
mikejuk writes "The world of software is made slightly crazy because of the huge flexibility within any computer language. Once you have absorbed the idea of a compiler written in the language it compiles, what else is there left to gawp at? But... a Java Virtual Machine JVM written in JavaScript seems like another level of insanity. A lone coder, Artur Ventura, has implemented a large part of the standard JVM using JavaScript and you can check the code out on Github. Notice this isn't a Java to JavaScript translator but a real JVM that runs byte code. This means it could run any language that compiles to byte code." Bonus: on Ventura's website is a set of visual notes from a talk he gave titled "My Language Is Better Than Yours."
Javaception (Score:5, Funny)
Anything which can be written in JavaScript ... (Score:5, Funny)
yo dawg (Score:4, Funny)
So we heard you like java...
Hey Bro... (Score:5, Funny)
Joking aside, this is not going to help the amount of confusion people have with regards to Java not being the same as Javascript *at all*.
Comment removed (Score:5, Funny)
Re:Hey Bro... (Score:5, Funny)
Re:Javaception (Score:5, Funny)
10 Write Browser in Java
20 Write Javascript engine in Browser
30 GOTO 10
Yo dawg.. I heard you like Java, so (Score:1, Funny)
Yo dawg, I heard you like bloat (Score:4, Funny)
Re:Javaception (Score:5, Funny)
Now we just have to do all of that in a Minecraft map so the CPU collapses under its own virtual weight!
Re:Javaception (Score:5, Funny)
Ummmm, Java != Javascript.
I thought that bit of confusion was cleared up by now. I was wrong.
This is completely unnecessary. (Score:5, Funny)
Re:Javaception (Score:5, Funny)
Think before posting please.
Seriously, if we are going to put that kind of requirement on posters, I will probably have to cancel my slash dot account
Re:This is completely unnecessary. (Score:5, Funny)
Fabrice Ballard already wrote an x86 emulator [bellard.org] in javascript. Just install the standard x86 JVM inside of that and you're good to go.
Yes, that's why this is completely unnecessary.
Re:This is nonsense. (Score:4, Funny)
It's like writing a C compiler in Bourne shell. The point is less about the name than about the complexity and absurdity.
Isn't it more like writing a C compiler in C-shell - at least name-wise :-)
Re:Javaception (Score:5, Funny)
but it wouldn't be "virtually impossible"
Exactly. It'd literally be virtually possible if you control the whole virtual machine...
Re:This is nonsense. (Score:5, Funny)
Re:Javaception (Score:5, Funny)
This is modded "funny", but actually this would be very useful. Because you could send the browser along with your HTML and be done at once with all browser-compatibility problems. Plus you could make browsers supporting other languages (e.g., Python, Haskell, you name it).
Of course javascript would not be the appropriate target-language for this (I guess, due to efficiency issues), but the idea in itself is very interesting. A better target-language would be closer to the machine (no closures, and no garbage collection); the NaCl project might actually be a better candidate. [google.com]
I'm betting that somewhere, somebody is already writing a browser in NaCl.
Re:This is nonsense. (Score:5, Funny)