Giter Site home page Giter Site logo

ahead_class_vm's Introduction

Ahead Class VM

Target is to create compiler, which translates JVM (Java Virtual Machine) runnable class files to C++ code.

Traditional Java VM is either intrepreted or JIT (Just-in-time) compiled. Aim of this tool is to translate generate class file to C++ code which can be compiled to native binary ahead of time.

These C++ files are then compiled to native code with any compatible C++ compiler. This way we hopefully can get native, and faster applications. While doing the translation, we may apply some optimizations on generated code.

Provides library for implementing basic structures and system classes, as well as translator itself.

Building

First install dependencies (for example on Ubuntu/Debian):

sudo apt-get install libgc-dev libjemalloc-dev

You need meson and ninja.

mkdir build
cd build
meson ..
ninja

Translating applications

After that you should have src/ahead_class_vm binary, which is the translator.

Next you need some class files. There's included one in examples folder. Compile it with java compliler:

cd ../examples
javac hello.java
cd ../build

# Rebuilds translator and generates C++ code, and compiles it with g++
../tools/translate.sh ../examples/hello.class

# Run translated application
./hello

State

Ahead Class VM is still experimental, and currently implements only basic functionality. Missing many opcodes, support for multiple class files, etc.

LICENSE

MIT, see LICENSE.

ahead_class_vm's People

Contributors

jroivas avatar

Watchers

 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.