Skip to content

lyledean1/zjvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zjvm

A toy implementation of the Java Virtual Machine (JVM) 7 specification written in Zig. This JVM can execute Java bytecode including object creation, method calls, and field access. It implements core JVM concepts like the heap, call frames, and method dispatch.

I've written a blog post about it here.

Still work in progress, see here for a list of implemented features.

Quickstart

Requires Zig 0.15 if you are on Mac, you can run brew install zig and Docker is required.

docker run --rm -v $(pwd):/workspace -w /workspace openjdk:7 javac example/src/main/java/basic/*.java
zig build run -- example/src/main/java/basic Fibonacci

Features

See FEATURES.md for a comprehensive list of implemented and planned JVM features.

Build and Run

Compile the Java examples:

docker run --rm -v $(pwd):/workspace -w /workspace openjdk:7 javac example/src/main/java/basic/*.java

Build and run the Zig VM with the following examples:

Fibonacci

zig build run -- example/src/main/java/basic Fibonacci

Test example

zig build run -- example/src/main/java/basic Test

For Loop

zig build run -- example/src/main/java/basic Loops

About

JVM in Zig

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors