Ruby and Java Running in JavaScript
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.
Finally, a way to combine the feature-rich capabilities of Javascript with the speed of Java!
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!
Good, inexpensive web hosting
Does it run Linux? ;)
In all seriousness, though... I'm struggling to see how this is truly beneficial. Aren't most pages already hopelessly clogged with mounds of JavaScript? Is it that difficult to expect a user to have a Java interpreter already installed when they visit the page such that having your Java "emulated" in JavsScript is the better solution?
Just seems like a solution needing a problem to me.
Proudly supporting the Libertarian Party.
Also worth mentioning that PyPy allows you to run Python as Javascript, inside a browser. Like all of these things, it isn't 100% mature, but pretty cool nonetheless.
While not exactly the same thing, the Google Web Toolkit (GWT) lets you write your code in Java and then run it in the browser. The difference is that the GWT translates the Java into JavaScript instead of giving you a full JVM. I'm not sure what practical advantage having a full JVM gives you.
Bradley Holt
Seems odd to use languages that weren't really designed to be embedded in a browser. One of the nice things about Javascript in the past couple of years has been the great DOM support. Add a library like JQuery and you have full cross platform goodness and a sane way to write code. Getting Java or Ruby code to interact with the DOM seems like it would be a huge pain compared with JQuery.
Why does everyone hate Javascript so? If you're going of cut-n-paste examples from the web yes it looks like an ugly language. Check out how the OO stuff works, or some JQuery code, and you'll be pleasantly surprised.
std::disclaimer<std::legalese> sig=new std::disclaimer; sig->dump(); delete sig;
This just reminds me of the "octoparrot" from The Simpsons. "Braawk! Polly shouldn't be!"
Use the Firehose to mod down Second Life stories!
'Orto' means 'ass' in Spanish.
Client side perl would kick ass. Then I could match my front end with the back.
writing a java VM in javascript? *head asplodes*
that's pretty cool but man, talk about a daunting tedious task. I'd rather bail 600 acres with a weed wacker and twisty-ties.
I came to the datacenter drunk with a fake ID, don't you want to be just like me?
Ok, so maybe we can run python in pypy in ironpython in java in javascript.
Now all we need to get is a C compiler to output python code. If someone can then write an x86 VM in python we could then run Linux in Firefox!
SJW n. One who posts facts.
Anybody else twitch at the sight of that headline?
/* No Comment */
As a side note: "orto" in argentina means ass. I don't think I'd want to run anything through it.
diegoT
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.
Clearly the top application of this project is me playing that Tetris game and telling my boss that it's research for my job.
Democracy Now! - your daily, uncensored, corporate-free
They don't know if it works properly yet - they're still waiting for it to finish running "Hello World"....
Java is slow when done inefficiently, like any other programming language. In Java code that is implemented correctly, speed will be one your lesser worries. In fact, under certain conditions, Java can rival, and even surpass, native code for speed. The implemented correctly is a much bigger one.
brandelf -t FreeBSD