I'm looking for a standard Java to Java bytecode compiler implemented in JavaScript.
Has anyone heard of anything that can accomplish this?
-
12+1 for insane idea :-). Care to explain... why?Tomasz Nurkiewicz– Tomasz Nurkiewicz2012年02月17日 22:26:42 +00:00Commented Feb 17, 2012 at 22:26
-
1Haha thanks. For part of my dissertation I would like users to be to write Java code within a web browser. It would support my thesis if the code could be compiled within the browser also.Jivings– Jivings2012年02月17日 22:30:51 +00:00Commented Feb 17, 2012 at 22:30
-
4It could be worse. He could have asked for a JVM implemented in JavaScript.DNA– DNA2012年02月17日 22:31:53 +00:00Commented Feb 17, 2012 at 22:31
-
1I have one written in Logo ;)Peter Lawrey– Peter Lawrey2012年02月17日 22:40:14 +00:00Commented Feb 17, 2012 at 22:40
-
2Aha, another candidate to illustrate the Atwood's Law ? +1 ;o)Seki– Seki2012年02月20日 10:33:47 +00:00Commented Feb 20, 2012 at 10:33
2 Answers 2
There are several here: https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS
Such as j2js, bicavm, doppio...(see the java section)
Comments
if your goal is to have users write Java in a browser and see it run, it makes.MUCH more sense to do the compiling and executing server side. A servlet could read the code, compile it and run it, then push the output back to the browser.
unless your thesis is "Anything that can be written in JavaScript will eventually be written in JavaScript."