8 ms·
BicaVM: A JVM in JavaScript
- yatsyk 15y agoapplets 2.0 :)
- struppi 15y agowow, atwood's law at work :) http://www.codinghorror.com/blog/2009/08/all-programming-is-web-programming.html http://www.codinghorror.com/blog/2009/08/all-programming-is-...
- oinksoft 15y agoDo we have to hear this every time somebody recreates something in JavaScript?
- struppi 15y agoYes? ;) No, sorry. I guess it really was a redundant response. Anyway, I used this reference for the first time. I said it because I think a JVM written in JS is remarkable - This is something I would not have expected anyone to do. Not at all. Yet, technically, it was predicted by said law.
- esrauch 15y agoI haven't seen this brought up before on HN.
- _delirium 15y agoI wonder if JVM bytecode would be a viable alternative intermediate language for compilation-to-javascript, as compared to the LLVM IR that projects like Emscripten use.
- ConstantineXVI 15y agoWe tried this before. The JVM lost.
- _delirium 15y agoI'm not sure I expect a "real" JVM to end up back in the browser, but everyone these days does seem to be trying to compile everything else to JS by hook or by crook, so anything that serves as a halfway plausible IR for that is interesting. The LLVM IR, for example, is used more or less because it was the least-bad option, not because it's great for the job (the Emscripten list has a lot of discussion of how not-really-platform-independent it is).
- azakai 15y ago> I wonder if JVM bytecode would be a viable alternative intermediate language for compilation-to-javascript That would be very cool! In fact I've been thinking about compiling JVM bytecode to JS using Emscripten. Either by compiling JVM bytecode to LLVM IR, or directly to Emscripten's IR (which is a close parallel to LLVM's). If any JVM hackers want to work on that with me, that would be awesome (I can do all the LLVM/Emscripten parts).
- robterrell 15y agoA few years ago I found the Orto javascript runtime impressive. Seems more complete than BicaVM. http://ejohn.org/blog/running-java-in-javascript/ http://ejohn.org/blog/running-java-in-javascript/ Edit: Seems to be missing from the web. I'm pushing my local copy to github: https://github.com/robterrell/orto https://github.com/robterrell/orto
- vog 15y agoThat github page says: "Nothing to see here yet. Move along." Are you sure you really uploaded it?
- robterrell 15y agoI trusted the damn GitHub desktop app to do the work... and it's still spinning in that window. Damn GUIs. I've now committed it from the console.
- buu700 15y agoThe license file is gibberish It clearly says that Orto is free for non-commercial use, but otherwise you need to contact them for permission. For all practical purposes, though, I think it's safe to consider it effectively public domain at this point.
- robterrell 15y agoIf you have a readable copy of the license, please send a pull request. The copy I have is high-ascii garbage.
- king_magic 15y agoIt's technically impressive, but I cannot see any real world application. A native Java runtime is heavily, heavily optimized for performance. Why would you run Java code through an interpreted/JITed JavaScript environment? However - I can appreciate the technical challenge :)
- nickand 15y agoThis is backwards. It should be JavaScript syntax driving the JVM. Because Scala and Groovy are way to small for anyone to care, but the JVM is an awesome way for people to write play-anywhere applications. Java is one of those languages that could have been dynamically typed from the beginning, but they chose to force us to be static to be academic (or something...). People can do a lot more in JavaScript than in Java FASTER. Make a version of JavaScript that drives the JVM and you win. Perhaps you can even use one of the current ECMA Standards. They probably already have some 'make window' syntax defined somewhere. If this project already exists please let me know. I have tons of uses for it. Thanks.
- akavlie 15y agoRhino? http://www.mozilla.org/rhino/ http://www.mozilla.org/rhino/
- nickand 15y agoNO, this is to use JavaScript in Java applications. It isn't to actually write the application.
- kodablah 15y agoOracle announced Nashorn recently that is not yet open sourced, but should be released for Java 8 and compile to bytecode (w/ the help of invokedynamic)
- nickand 15y agoProbably the most promising answer, but it looks like for now the only safe bet is writing straight up java.
- robterrell 15y agodyn.js: http://jsconf.eu/2011/dynjs_-_100_invokedynamic_java.html http://jsconf.eu/2011/dynjs_-_100_invokedynamic_java.html Interview with the developer here: http://www.infoq.com/news/2011/10/dynjs http://www.infoq.com/news/2011/10/dynjs
- devongovett 15y agoAs always, here is my perspective on Badass JS: http://badassjs.com/post/12648021003/bicavm-a-jvm-implementation-in-javascript http://badassjs.com/post/12648021003/bicavm-a-jvm-implementa... :)
- ypcxz 15y agoblog looks good, now in my google reader