Ruby and Java Running in JavaScript 220
John Resig is reporting on his blog that a recent trip to Tokyo opened up some very interesting JavaScript projects to him that haven't met with widespread popularity outside of Japan yet. "One project, in particular, really caught my eye. It's called Orto and is an implementation of the Java Virtual Machine (JVM) in JavaScript. This means that you can take an existing Java application, compile it to bytecode, run it through Orto (which produces the JavaScript, and embed it in a web page. While it doesn't provide the full capabilities of most Java code it does provide enough to make for some interesting demos." In a separate post he also detailed how the HotRuby project is allowing a Ruby VM to run in a browser using JavaScript or even indirectly using ActionScript in Flash.
Doing things the slow way (Score:3, Insightful)
Re:Doing things the slow way (Score:4, Insightful)
Tetris performed better on my Gameboy (an 8-bit, 4.2MHz x80 CPU with 8KB RAM) than this clone does on my 32-bit 1.4GHz Athlon. And it had sound. Tetris shouldn't load "quickly" it should load instantly.
This is a very clever hack, and I admire the work -- but it is in no way practical for anything. I find the idea of using it for "real work" apalling -- and I code in Java by choice!
Re:Strange (Score:2, Insightful)
Javascript is inherently multithreaded and embedded in a highly asynchronous environment, het has no threading API whatsoever. To me, this is mind-boggling. Every AJAX project I've been involved in has had to build in ugly workarounds or just drop features to prevent race conditions.
Re:Java running under Javascript... (Score:4, Insightful)
By the way, you can obviously rewrite critical portions of Java code in C as well... Being able to call out to C is not an excuse for the current Python and Ruby implementations being complete trash. There are lots of languages that provide a similar level of abstraction that have far better performance and a threading model that isn't a complete joke.
Re:But... (Score:2, Insightful)
If you can run it under JavaScript, you can run it on an iPhone.
Re:Doing things the slow way (Score:3, Insightful)
Re:But... (Score:2, Insightful)