Orto: Running Java in JavaScript

John Resig reports that while speaking at the Shibuya.JS user group in Tokyo, Japan. He came across a number of interesting JavaScript projects that have yet to make it outside of Japan. One project, in particular, was really intresting, called Orto and is an implementation of the Java Virtual Machine (JVM) in JavaScript. This means that you can take an existing […]

John Resig reports that while speaking at the Shibuya.JS user group in Tokyo, Japan. He came across a number of interesting JavaScript projects that have yet to make it outside of Japan.

One project, in particular, was really intresting, 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.

As Orto simulates the multithreaded nature of Java with yields and timeouts this is of course hard-core simulation (read: hack), but the benefit are that you could Java Games on non-JS devices, like the iPhone.

Orto also seems to try to simulate the Java UI conventions, thus making it easy to convert existing applications (to a certain degree as there is no equivalent in HTML for the richness of Java UIs unless you build them yourself as libraries ike Dojo or Quoxdoo did).

Using this you can convert Java code into bytecode and embed it in the document.

"java/lang/Thread 1316742099":function(){var orto333=orto245[0]; var orto336=orto350(orto333); if(orto336.orto340!=orto310){orto223("java/lang/IllegalThreadStateException",null); return ; }

Full Article

Source:→ Ajaxian

Projects, Tokyo, Japan, JavaScript, JVM, Java, Games, Tetris