frankier / doppio

A JVM in TypeScript.

Home Page:http://int3.github.io/doppio/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doppio: A JVM in TypeScript

Doppio is a double shot of espresso. In this case it's also a JVM written in TypeScript.

To try Doppio now, head to the live demo page.

To learn more, head to the Doppio wiki.

You can also get in touch via our mailing list or via the IRC channel #plasma-umass on Freenode.

Getting & Building the Code

git clone https://github.com/int3/doppio.git
cd doppio
tools/setup.sh
make

If you have Homebrew, setup.sh will try to install a bunch of dependencies automatically. Users of other package managers should check that they have:

  • node >= 0.10
  • wget

Usage

To run Doppio on localhost:

make dev
tools/server.coffee --dev

To get the optimized release version:

make release
tools/server.coffee --release

Then point your browser to http://localhost:8000/.

To include your own code in the browser without manually uploading each file, place your .class files in a directory under classes/, then re-run make dev or make release to re-generate the listings.json file.

For example:

#in shell
cp -ivR /path/to/my/class/files/ classes/my-classes/

#in browser
java -cp /sys/classes/my-classes my/package/MyClass  # use slashes, not dots, as package separators

We currently don't support loading class files from JARs in the browser, but we intend to in the future. For now, unzip the JAR file and use the above method to access the class files directly.

Doppio can also be run from the console. For example:

make dev-cli
node build/dev-cli/console/disassembler.js classes/demo/Fib
# doppio-dev -> node build/dev/console/runner.js
./doppio-dev classes/demo/Fib
./doppio-dev classes/demo/Fib 7        # pass an argument to the JVM
./doppio-dev -jar my_application.jar   # extract and run a JAR

To get the optimized version, use make release-cli. The build products can be found in build/release-cli, and the runtime can be invoked via ./doppio.

Automated Rebuilding

bundle exec guard -i -g release # automates `make release-cli`
bundle exec guard -i -g dev # automates `make dev-cli`

The front-end currently lacks an auto-rebuild system.

Running Tests

Run all tests:

make test -j4

Run a specific test, or test with different options:

node build/dev-cli/console/test_runner.js -h
node build/dev-cli/console/test_runner.js classes/test/Strings

About

A JVM in TypeScript.

http://int3.github.io/doppio/

License:MIT License