Git Product home page Git Product logo

matevm's Introduction

MateVM is a Java JIT compiler written in Haskell, using already existing libaries, namly Harpy and hs-java.

MateVM is i686 (i.e. 32-Bit) only at the moment.

Visit us at #MateVM on OFTC!

We use hs-java to parse Java Classfiles in order to get a Java Bytecode representation. Afterwards we perform a basic-block analysis and generate a control-flow-graph (CFG). We apply several program-analyses, transformations and optimizations. Given the annotated CFG we emit native code for a method with Harpy (i686) in an on demand manner.

At the moment we try to minimize effort, by focusing on essential features of the JVM, for example there is no support for threads yet.

Dependencies

Install GHC via your distro manager. Make sure you install it with shared libaries. On Ubuntu 12.04 LTS that is:

$ sudo apt-get install ghc-dynamic ghc-prof \
  cabal-install libzip-dev libgc-dev

For an easy installation of the remaining packages, you can use the script ./tools/installhaskellenv.sh.

PLEASE NOTE: it deletes your ~/.cabal and ~/.ghc directory first in order to get a fresh cabal install!

Try it

Build the mate executable with (building with cabal isn't supported yet)

$ make

it also builds a simple base library for the Java Runtime, so be sure javac is in your $PATH. There are some working examples in ./tests/, you can execute one with the given Makefile; assume you want to execute ./tests/Fib.java:

$ make tests/Fib

or without the Makefile

$ javac tests/Fib.java
$ ./mate tests.Fib

you can compare the output with your Java JVM (java in your $PATH) with:

$ make tests/Fib.test

we also have a build bot which checks for broken cabal dependencies every night, and it also checks the build with make tests.

Unfortunately, we can't use GNU Classpath yet, but we're working on it, so stay tuned!

matevm's People

Contributors

lewurm avatar haraldsteinlechner avatar

Watchers

James Cloos 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.