Ristretto VM
Ristretto VM is a Java Virtual Machine implementation written in pure Rust. It executes Java bytecode by interpreting class files loaded through the Ristretto classloader.
Features
- Standard runtime classes backed by LTS versions of AWS Corretto.
- Flexible class loading from directories, JARs, JMODs, JImage files, and URLs.
- Built-in support for reading, writing, and strictly verifying Java bytecode.
- Interpreter support for all Java byte codes including invokedynamic.
- Fully asynchronous, non-blocking execution using Rust async/await for:
- java.lang.Thread
- java.io & java.nio
- java.net
- A low-pause, concurrent, and parallel mark-and-sweep garbage collector.
- Parallel Just-In-Time (JIT) compilation for x86-64, aarch64, s390x, and riscv64 architectures.
- WebAssembly (WASM) compilation support for single-threaded edge and browser deployments.
Examples
use ;
use ClassPath;
async
Feature flags
ristretto_vm uses feature flags to address compile time and binary size uses.
The following features are available:
| Name | Description | Default? |
|---|---|---|
audio |
Enables javax.sound support |
Yes |
startup-trace |
Enables startup tracing | No |
tls-native-tls |
Enables Native TLS support | No |
tls-rustls-aws-lc-rs |
Enables Rustls with the AWS-LC crypto provider | No |
tls-rustls-ring |
Enables Rustls with the Ring crypto provider | Yes |
url |
Enables URL class path entries | No |
The TLS backend features are alternatives. To select a non-default backend without compiling Ring,
disable default features and enable tls-native-tls or tls-rustls-aws-lc-rs, together with any
other required features such as audio.