GithubHelp home page GithubHelp logo

code4jvm's Introduction

code4jvm

code4jvm is a high-level JVM bytecode generation library for writing compiler backends. It allows generating Java-like code without worrying about low-level features, while still supporting JVM features that cannot be expressed in Java.

The core code4jvm library consists of:

  • Automatic stack management and local variable slot tracking
  • Stack map frame generation (with control flow tracing)
  • An extensible expression system that allows generation of custom bytecode
  • Simple control flow (basic blocks, jumps)
  • Java-like type conversions (complex casts, boxing)
  • Exception handling (including try-finally block support)

On top of this, some higher-level features are included:

  • Structured control flow (conditional blocks, loops)
  • Method calls, including use of constructors
  • Arithmetic and bitwise operations
  • String concatenation
  • Enum classes

Under the hood, JVM bytecode is generated using the low-level ASM library.

Usage

As of now, the only use case worth of mentioning is lua4jvm, a work-in-progress Lua 5.4 implementation for JVM.

Status

This library is work-in-progress. It is being worked on in author's spare time, and there are no guarantees about when bug fixes or new features will be available. Additionally, code4jvm is not yet published on Maven central. Naturally, there are also zero guarantees about API stability.

As you might notice, the documentation is also quite sparse. There are Javadocs, but beyond them you'd have to learn by example.

In short: don't use this in production. If you just want to hack around, feel free to open issues (or even pull requests!).

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.