This project is an attempt to write a minimal JVM using Rust.
It is a hobby project, built for fun and for learning purposes. The code quality is definitely not production ready - there are not enough tests, there isn't enough documentation, and some parts might not be idiomatic Rust since I'm just learning it. 😊
The code is licensed under the Apache v2 license.
The current code can execute a very simple program.
- reading class files
- class attributes
- methods
- code
- exception tables
- attributes
- source code mappings
- attributes
- code
- field
- attributes
- execution
- data types
- primitives
- int
- short
- char
- byte
- long
- float
- double
- boolean
- object
- primitive arrays
- object arrays
- multidimensional arrays
- primitives
- new object instances creation
- static methods invocation
- virtual methods invocation
- modelling of super classes
- abstract methods
- control flow
- exceptions
- object allocations and garbage collection
- threading
- tons of other features :-)
- data types
The code is currently structured in three crates:
utils
, which contains some common code, unrelated to the JVM;reader
, with the.class
file reader and the data structure for modelling them;vm
, which contains the virtual machine that can execute the code.
There are some unit test and some integration tests - probably not enough, but since this is not production code but just a learning exercise, I'm not that worried about it.