Slashdot Mirror


JavaScript JVM Runs Java

mikejuk writes "The world of software is made slightly crazy because of the huge flexibility within any computer language. Once you have absorbed the idea of a compiler written in the language it compiles, what else is there left to gawp at? But... a Java Virtual Machine JVM written in JavaScript seems like another level of insanity. 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. Notice this isn't a Java to JavaScript translator but a real JVM that runs byte code. This means it could run any language that compiles to byte code." Bonus: on Ventura's website is a set of visual notes from a talk he gave titled "My Language Is Better Than Yours."

4 of 234 comments (clear)

  1. Re:This is nonsense. by afabbro · · Score: 4, Insightful

    Javascript != Java. "Javascript" is just a naming rip-off. So what's the big deal?

    It's like writing a C compiler in Bourne shell. The point is less about the name than about the complexity and absurdity.

    --
    Advice: on VPS providers
  2. Interesting mind set by sgt+scrub · · Score: 3, Insightful

    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.

    I think it would have been easier to build a VM into a browser but I doubt it would have gotten this much attention. Still. It is a cool project.

    --
    Having to work for a living is the root of all evil.
  3. Not mind blowing when ... by fsckmnky · · Score: 3, Insightful

    ... you understand that a computer language, is a mapping of human readable symbols -> cpu instructions, either direct or indirect. If the mapping results in a set of cpu instructions that implements another language, you get another language.

    It's not rocket science people, its just math. Wait, maybe it is rocket science.

  4. Re:DOM-Interface for byte code by devent · · Score: 4, Insightful

    Yes, would make sense, wouldn't it? Instead that every browser have to interpret the slow JS language (yes, JS language is slow to interpret, because of the design choices. Just watch some of Doug Crockford videos), we could all just agree on a byte code standard like the Java byte code standard.

    Then you could develop web applications in your choice of language and not just in JS. On the server you upload just the byte code, like the compiled Java source code (.class).

    For example, you could develop in Ruby, Python or Java, and compile the code to the byte code for browsers. Then you deploy the byte code on the server.

    But the web-developers are so stubborn with their JS language, I don't know why.

    --
    http://www.mueller-public.de - My site http://www.anr-institute.com/ - Advanced Natural Research Institute