Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/birbe/jvm
Take two! Pure-Rust implementation of the 20th JVM spec
https://github.com/birbe/jvm
compiler java jvm openjdk20 rust wasm
Last synced: 24 days ago
JSON representation
Take two! Pure-Rust implementation of the 20th JVM spec
- Host: GitHub
- URL: https://github.com/birbe/jvm
- Owner: birbe
- Created: 2023-06-10T12:36:45.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-03-06T13:07:16.000Z (8 months ago)
- Last Synced: 2024-03-06T14:30:45.029Z (8 months ago)
- Topics: compiler, java, jvm, openjdk20, rust, wasm
- Language: Rust
- Homepage:
- Size: 361 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Experimental JVM on WASM
This repo is my experiment in making a pure-Rust JVM that supports running both on native platforms
and WebAssembly.On WebAssembly, it takes advantage of the GC extension to the WASM spec, meaning in theory the Java objects get garbage-collected
by the browser's garbage collector instead of one written within WASM.At the moment it's just a toy and is non-functional.
Things I've worked on so far, include but are not limited to (and in no particular order or amount of success):
- [x] Java classfile parsing
- [x] Extremely basic non-garbage collected heap for native
- [x] Dynamic linking of the WASM modules generated at runtime
- [x] Basic interop between Rust and WASM objects
- [x] Implemented part of the interpreter
- [x] Java bytecode control flow to WASM (using the stackifier algorithm)Things that are notably missing:
- [x] A lot of instructions
- [x] Most of the important instructions like for dynamic dispatch (they're either partially (incorrectly) implemented or entirely unimplemented)
- [x] Garbage collection (on native platforms)Originally it only ran on native, but now it only runs on WASM as that's where I'm doing most of my testing.
Eventually I'll properly refactor it's internal APIs to support conditionally compiling with the proper parts enabled
for each specific platform.