Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Programming Java IT Technology

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.
This discussion has been archived. No new comments can be posted.

Ruby and Java Running in JavaScript

Comments Filter:
  • by techno-vampire ( 666512 ) on Monday April 28, 2008 @03:16PM (#23228378) Homepage
    What this is, basically, is emulating the Java in Javascript, an interpreted language. I can't help but feel that anything written in this is going to be very slow, and I can't, personally, see why anybody would bother. Of course, I'd be very happy to be proven wrong!
  • by evanbd ( 210358 ) on Monday April 28, 2008 @03:52PM (#23228772)

    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)

    by lcampagn ( 842601 ) on Monday April 28, 2008 @03:55PM (#23228804)
    > Why does everyone hate Javascript so?

    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.
  • by Anonymous Coward on Monday April 28, 2008 @04:07PM (#23228964)
    Saying that Java is a crippled version of C++ that runs at 1/10 the speed is idiotic and only displays your ignorance. You're just parroting what you've heard from other ignorant retards. Java has a ton of significant problems but people like you continuously bring up points that are either wrong or completely irrelevant. Based on your posts I doubt you understand much about Java or the JVM.

    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)

    by morgan_greywolf ( 835522 ) * on Monday April 28, 2008 @04:35PM (#23229304) Homepage Journal

    I'm struggling to see how this is truly beneficial.


    If you can run it under JavaScript, you can run it on an iPhone.
  • by bytesex ( 112972 ) on Monday April 28, 2008 @04:36PM (#23229332) Homepage
    Nah - the beef with java isn't that it's slow. Well, that too, but it's more in the interfacing; want to do something in C in between all your java - use the JNI if you dare ! Want to fire off a shell - see you thirty statements later ! Want to create a PDF ? Well, see, first we instantiate a worker-factory of this XML-class, and then we feed it through this parser-generator, and then we might end up with some PDF... on mondays. Want to stat a file, fork a process, set up a non-standard network communication, access shared memory ? Tough ! This java, man ! And it's in a world of its own. It's no miracle the java guys are always so evangelical - they're not *allowed* to see what's outside their world.
  • Re:But... (Score:2, Insightful)

    by Profane MuthaFucka ( 574406 ) <busheatskok@gmail.com> on Monday April 28, 2008 @05:13PM (#23229816) Homepage Journal
    Don't you see? Javascript is available on every hardware platform! You don't need to have a separate Java binary package from Sun to run Java programs. You can use the portable javascript implementation in your browser! It makes sense.

Happiness is twin floppies.

Working...