Code Monkey home page Code Monkey logo

jvm.js's Introduction

jvm.js Build Status Dependency Status

=====

A Java Virtual Machine implementation written in JavaScript, including libraries for Java, Scala and Closure.

The main thread hosts the UI while all the bytecode parsing and program execution takes place in a web worker to keep things responsive. When a non-present class definition is encoutered, the classloader will attempt to download the bytecode of the required class, otherwise the upfront load times would be outrageous.

The initial class loads you see on the demo page are setting up java.lang.System.out which will write to the log window in the bottom right.

Demo

http://achingbrain.github.io/jvm.js. Skip to step 4 below. Hope you're running a modern browser.

Getting started

  1. Install dependencies

    npm install

  2. Run web server

    grunt run

  3. Open http://localhost:8060

  4. Drop a .class file with a main method file onto the box marked "Drop a .class file here"

  5. Set some breakpoints and hit run

Other tasks

Run test suite:

grunt test

Run test suite with coverage (report appears in /target/reports/coverage/index.html):

grunt coverage

Delete the "target" directory

grunt clean

What doesn't work

Rather a lot.

  1. Threading, files, sockets, etc.
  2. High value longs, doubles, etc.

To do

Rather a lot

  1. Test invoke_dynamic with some code that uses it (e.g. not Java)
  2. Support ConstantValue field attribute
  3. Implement step-into and step-out functionality

jvm.js's People

Contributors

achingbrain avatar

Stargazers

月球王子 avatar

Watchers

James Cloos avatar 傅长路 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.