Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
BicaVM: A JVM in JavaScript (github.com/nurv)
66 points by arturventura on Nov 11, 2011 | hide | past | favorite | 25 comments


A few years ago I found the Orto javascript runtime impressive. Seems more complete than BicaVM.

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


That github page says: "Nothing to see here yet. Move along." Are you sure you really uploaded it?


I 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.


The 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.


If you have a readable copy of the license, please send a pull request. The copy I have is high-ascii garbage.


I've made a rough translation of the license. As mentioned it's in Japanese. It's also kind of confusing. I'll send a pull request when I'm back at my desktop. (EDIT: Though of course, redistribution seems to break the condition at line #6).

  1 Orto SDK is Free Software.
  2 Copyright Kobayashi Yuu
  3
  4 Use and publication of applications produced by using Orto SDK
  5 are free for both commercial and non-commercial purposes.
  6 For other uses of Orto SDK, or for redistribution of the Orto SDK,
  7 please contact support@orto.jp beforehand.
  8
  9 Due to lack of contract with Sun Microsystems,
 10 Orto is Java-style but it is not Java. Orto is an independent language.
 11 Java is a registered trademark of Sun Microsystems
 12
 13 The author is not responsible for any damages which may occur through use of Orto SDK
 14 Furthermore, reverse engineering of Ordo SDK is prohibited.


No, it's Japanese. I've never heard of Orto before but I can read the licence off your Github repo.

https://github.com/robterrell/orto/blob/master/docs/license....



Do we have to hear this every time somebody recreates something in JavaScript?


Yes? ;)

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.


I haven't seen this brought up before on HN.


I 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.


> 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).


We tried this before. The JVM lost.


I'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).


It'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 :)


As always, here is my perspective on Badass JS: http://badassjs.com/post/12648021003/bicavm-a-jvm-implementa... :)


applets 2.0 :)


This 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.


Oracle 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)


Probably the most promising answer, but it looks like for now the only safe bet is writing straight up java.



I searched around for dyn.js and found a git repository with no explanation. I skipped around the video you posted and couldn't get a clear answer.



NO, this is to use JavaScript in Java applications. It isn't to actually write the application.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: