"
Until recently implementing a JVM in JavaScript would have been
difficult because of efficiency problems but there have been huge
speed increases in JavaScript engines. So much so that a lone coder,
Artur Ventura, has implemented a large part of the standard JVM using
JavaScript and you can check the code out on Github.
The motivation for this effort is put very well in Artur's blog. He
argues that rather than build JavaScript into web browsers they should
have a virtual machine so that any language can be used. As well as
this advantage, he also points out that with a JVM type approach you
get automatic sandboxing and simply sending the JVM to the server
provides browser independent persistence.
It really does make much more sense to have a JVM build into the
browser but failing that why not simply emulate the JVM in JavaScript
which is built into every browser. This is just another aspect of the
steady conversion of features provided by plugins to JavaScript
implementations - codecs, pdf, zipping and so on.
After 6 months of work the result is BicaVM which, it is claimed, runs
60% of byte code. It hasn't been optimized as yet, but it does run on
the iPad/iPhone and it supports a JNI interface to the DOM.
"
Blog Post: http://www.surf-the-edge.com/2011/11/15/bicavm-jvm-in-javascript-why/
Source: https://github.com/nurv/BicaVM
Via http://www.i-programmer.info/news/167-javascript/3360-javascript-jvm-runs-java.html
Via: http://developers.slashdot.org/story/11/11/21/0454254/javascript-jvm-runs-java
> It really does make much more sense to have a JVM build into the
> browser but failing that why not simply emulate the JVM in JavaScript
> which is built into every browser. This is just another aspect of the
> steady conversion of features provided by plugins to JavaScript
> implementations - codecs, pdf, zipping and so on.
Well, definitely it makes some sense. I'm not worried by the speed,
because I understand it can be interesting; the real problem is how much
traction the project will have and so how many things it will support. For
instance, just manipulating the DOM in Java doesn't make a lot of sense.
It would make sense to run JavaFX, for instance, but this - in addition to
the bytecode translation - would require mapping graphics to HTML 5,
etc... which is a project per se. BTW, if I don't recall bad, once upon a
time a JavaFX to JavaScript translation was in the plans of Sun... but I
lost track of it.
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
fabrizio...@tidalwave.it
http://tidalwave.it - http://fabriziogiudici.it
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
> Isn't this also called the Java Plugin ? :-P Just kidding of course...
>
> But this is a deja-vu situation from a decade ago of running applets -
> because then you have exactly the same advantages: Sandboxing,
> browser-independent, etc...
I seem to have seen drawing pixels to a canvas too, but in spite of that
it's "new" thing in HTML 5 :o)
Unfortunately, we're seeing reinventing wheels all the way...
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+unsubscribe@googlegroups.com.
> Having standard cross browser ways of doing things seems great in theory.
> After about 15 years or so of promises that all the browsers will
> standardise and do things consistently and repeated failure to agree on
> so
> many things I am a bit cynical as to thinking this will ever change.
+1 (mainly to the quoted sentences, but in general to the whole post).
I have long since wished that the browsers would use some kind of VM,
frankly I would not care if it was a JVM, CLR LLVM or something else.
I would be happy with whatever I could get.
I see the problem being that no-one would agree on the VM. The backers
of the most popular browsers tend to have very incompatible political
agendas.
Having standard cross browser ways of doing things seems great in theory. After about 15 years or so of promises that all the browsers will standardise and do things consistently and repeated failure to agree on so many things I am a bit cynical as to thinking this will ever change.
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
Slightly off topic - There is a slow and completely impractical way to run Java non-graphical applications on a pre-1.5 JVM within a browser. That is via JavaScript PC Emulation. Some time ago I ported JPC to JavaScript - JsPcEmulator via GWT. It can boot the Sanos, which is just enough of an OS to run Java. My more recent port of Dosbox- JsDosbox might also run java if combined with Japheth's HX DOS extender with Win32 PE file format support (again with the same limitations).