Code Monkey home page Code Monkey logo

doppio's Introduction

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

Before attempting to build doppio, you must have the following installed:

  • Node v0.10 or higher
  • NPM packages grunt-cli and bower installed globally
    • npm install -g grunt-cli bower
  • Java 6 JDK

If you are on Windows, you will need the following installed:

  • Git (must be on your PATH)
  • Python (must be on your PATH)
  • A version of Visual Studio

Run the following commands to build doppio. Note that your first time building may take some time, as the build script will download the entire Java Class Library.

git clone https://github.com/int3/doppio.git
cd doppio
npm install
bower install
grunt release

Usage

To run doppio on localhost:

grunt dev
tools/server.coffee --dev

To get the optimized release version:

grunt 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 grunt dev or grunt 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:

grunt 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 grunt release-cli. The build products can be found in build/release-cli, and the runtime can be invoked via ./doppio.

Automated Rebuilding

To automatically rebuild doppio while you modify files, run the following command:

grunt release watch

This will perform a complete build of doppio, and then will watch files to trigger partial rebuilds.

Running Tests

Run all tests:

grunt test

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

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.