Implementing a Simple JVM in Rust
summary
Open-source Rust implementation builds a working JVM subset: a bytecode interpreter, classfile parser and loader, constant pool, evaluation stack and heap representation that can load real .class files and execute simple methods. It omits a JIT and implements no GC, relies on an interpreter loop and switch/match dispatch, adds fields, branching, int/double arithmetic, object construction, native method support (eg System.currentTimeMillis) and class bootstrap/CLINIT; tests run via Cargo/crates and the implementation successfully executes small Java programs.
AI-written summary · about
chapters (47)
- 0:00Intro
- 1:12Who am I
- 1:45Java Champion
- 3:00Goals
- 5:29Java Version
- 6:01The JVM
- 12:49The bytecode
- 14:41The class file
- 16:06Invoke code
- 17:18Model local variables
- 18:48Building a first implementation
- 19:18A few things about Rust
- 19:49Rust project structure
- 23:55Non erased generics
- 24:17Algebraic data types
- 26:35Handling of storage
- 27:22Misunderstood assignment semantics
- 27:35Examples of perfectly safe Rust programs
- 27:53If youve programmed in C
- 28:48Lets meet some Rust code
- 29:30TDD
- 30:31Java byte codes
- 31:47Generics
- 32:48OptRec
- 34:23Exact Method
- 34:49Declaration
- 35:06Looping
- 35:29Vectors
- 36:03Advanced
- 36:34eval
- 36:49icons
- 37:12enum
- 38:36colon
- 39:04files
- 39:24Const
- 39:47Runtime Checking
- 40:21Testing
- 43:39FieldHaver
- 44:44Go Clean
- 45:19Test Cycle
- 46:25Top Level
- 47:49Runtime Datastore
- 48:55Class Name
- 49:13Function Pointer
- 49:40Fixing ocelots
- 49:56Bootstrap
- 51:24Whats next
related talks
30mAn Incremental Approach to JIT Construction
19mHow to use a Rust library inside the JVM application
43mRust intro for Java Developers
45mLuckily, You Don’t Have to Rewrite Everything in Rust
27mRust for Java developers
50mConfessions of a Rusty Java developer
56mReady for Rust
36mRusty Runtimes: Building Languages In Rust
