GithubHelp home page GithubHelp logo

jvilk / jarjvm Goto Github PK

View Code? Open in Web Editor NEW
26.0 3.0 4.0 3.41 MB

JAR JVM is a Java Virtual Machine interpreter written completely in JavaScript. It allows you to run your Java programs in the browser, no plugins required!

License: MIT License

JavaScript 99.95% Python 0.05%

jarjvm's Introduction

Introduction

JAR JVM is a Java Virtual Machine interpreter that is written completely in JavaScript. As a result, it runs entirely in your browser -- no plugins required!

Usage

In order to use JAR JVM, you must do the following:

  1. JAR JVM currently requires a copy of the Java Class Library. We do not distribute this with JAR JVM. The command to do this on a Mac is the following:

cd jre/

unzip /System/Library/Frameworks/JavaVM.framework/Classes/classes.jar

  1. Once that is done, run server.py to run a simple HTTP server locally that serves the JVM.
  2. Open http://localhost:8000/ in your browser of choice and enjoy!*
  • Currently supported browsers: The latest versions of Firefox, Opera, and Chrome. No promises for IE users!

Status

JAR JVM is currently in extreme alpha state. We are working hard to create a subtantial body of unit tests for the existing code before adding new features.

Once that is done, we have a number of exciting feature ideas!

Name

Why is it called JAR JVM? Well, JAR JVM was initially developed by three people for a class project:

__J__ohn Vilk

__A__mir Rahmati

__R__yan Hurley

jarjvm's People

Contributors

perimosocordiae avatar vitaliy-yakovchuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jarjvm's Issues

Add Comprehensive Test Suite for Class File Parsing

There should be infrastructure in place to easily create / add class file parsing tests. These tests are not to test the binary file -> JavaScript primitive conversions, but the parsing logic. It will also be nice to revisit the JVM documentation to ensure that we are not throwing away any interesting information.

  • Should make it braindead simple to create new instances of Class structs (e.g. CreateClass(magic, minorversion, majorversion, etc).
  • Should make it simple to add structs to the test harness, since there are many in the JVM. Ideally, I should be able to copy+paste the documentation with minimal modifications.
  • Should type-check any example structs to fail-fast badly written tests.

Renovate Method Calling

The 'MethodRun' object / functions are ugly hacks, especially with requiring TWO frames for native method calls (one w/ a resume address of -1).

  • Clearly figure out where frame pop/pushes should occur to avoid having this BS.
  • Architect it such that the JVM can be paused at any moment (barring NativeFunctions, which must be blocking) (allowing for interesting debugging functionality).

Add Verification Functionality

Currently, the JVM does not perform any verification on the class files that it parses.

  • Add a standard function (e.g. 'verify') to all of the relevant objects, and a VM-level toggle to turn on/off class file verification (e.g. if (JVM.shouldVerify()) this.verify(); ).
  • Clearly document the assertions in the verification code with references to the JVM spec (section / page numbers / edition).
  • Add user-friendly messages to verification failures (e.g. print to console "Class file foo.class failed verification: "). Perhaps these reasons should be self-documenting.

Fix Descriptors

They are implemented terribly. Make Descriptor objects, do the parsing once, and be intelligent about it.

Add Google Drive Support

I should be able to load things from Google Drive. This would be cool.

The user would log in through the terminal. Perhaps the terminal would display emailaddress > for the prompt.

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.