Rich Domain Model for JVM Bytecode and Framework to interpret and transpile it.
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
classlib Minor fix in Web API Jan 19, 2019
core #87 Fix static class initialization order Jan 21, 2019
integrationtest Added more demos Jan 18, 2019
manual Further optimized WASM code size Dec 28, 2018
maven Enhanced Classlib Jan 3, 2019
.gitignore #18 Use LocalVariableTable for variable name generation Dec 21, 2017
.travis.yml Fixed #61 Upgrade to OpenJDK 11 Oct 17, 2018
LICENSE Initial commit Apr 13, 2017
README.md Added more demos Jan 18, 2019
pom.xml Enhanced Classlib Jan 3, 2019

README.md

Bytecoder

Bytecoder is a Rich Domain Model for Java Bytecode and Framework to interpret and transpile it to other languages such as JavaScript, OpenCL or WebAssembly.

Current travis-ci build status: Build Status Maven Central

High Level Goals

  • Ability to cross-compile JVM Bytecode to JavaScript, WebAssembly, OpenCL and other languages
  • Primary compile targets are JavaScript and WebAssembly
  • Allow integration with other UI-Frameworks such as vue.js
  • Use other tool chains such as Google Closure Compiler to further optimize generated code
  • Backed by OpenJDK 11 as JRE Classlib

Compiling strategies

The JVM Bytecode is parsed and transformed into an intermediate representation. This intermediate representation is passed thru optimizer stages and sent to a backend implementation for target code generation.

The JavaScript backend transforms the intermediate representation into JavaScript.

The WebAssembly backend transforms the intermediate representation into WebAssembly text and binary code.

The OpenCL backend is used to compile single algorithms into OpenCL and execute them on the GPU. This backend is designed to enhance existing programs running on the JVM to utilize the vast power of modern GPUs.

Demos

Demo screenshot

Demo
JBox2D Demo compiled from Java to JavaScript
JBox2D Demo compiled from Java to WebAssembly
JBox2D Demo compiled from Kotlin to JavaScript
JBox2D Demo compiled from Kotlin to WebAssembly
vue.js integration Demo compiled to WebAssembly
Lua4J Demo compiled to JavaScript
Lua4J Demo compiled to WebAssembly

User Manual

The Bytecoder User Manual is available here.