A reversible, concurrent virtual machine and programming language.
This project is just an experiment and is still in the early stages of development. You should probably come back later once I'm sure it'll work at all.
The Wheeler Virtual Machine provides a platform for writing and executing perfectly reversible programs, including support for concurrent execution. Every operation can be reversed, enabling exact reconstruction of previous program states.
Key features:
- Perfect reversibility of all operations.
- Concurrent execution with reversible synchronization.
- Quantum-inspired instruction set.
- Modern Java implementation.
- Comprehensive testing framework.
- Java 22 or higher
- Gradle 8.5 or higher
Build the project:
./gradlew build
Compile a Wheeler program:
./gradlew wheelc -Psource=examples/HelloWorld.w
Run a Wheeler program:
./gradlew wheel -Pfile=HelloWorld.wc
wheeler-core
: Core virtual machine implementationwheeler-compiler
: Wheeler language compilerwheeler-runtime
: Runtime libraries and supportwheeler-tools
: Development and debugging toolswheeler-examples
: Example programs and tests
// Basic counter example demonstrating reversibility
classical class Counter {
rev int count = 0;
rev void increment() {
count++;
}
rev void decrement() {
count--;
}
pure int get() {
return count;
}
rev static void main(String[] args) {
Counter c = new Counter();
// Forward execution
c.increment();
c.increment();
System.out.println(c.get()); // 2
// Reverse execution
reverse {
c.increment();
c.increment();
}
System.out.println(c.get()); // 0
}
}
For additional examples, see wheeler-examples.
See CONTRIBUTING.md for guidelines on how to contribute to the project.
Wheeler is licensed under the Apache License 2.0 - see LICENSE for details.
Inspired by:
- John Wheeler's "It from Bit" concept.
- Bennett's work on reversible computation.
- The Java Virtual Machine.
Wheeler is currently in early development. The API and bytecode format are subject to change.
If you use Wheeler in your research, please cite:
@software{wheeler_vm_2024,
title = {Wheeler Virtual Machine},
author = {TypeObject},
year = {2024},
url = {https://github.com/typeobject/wheeler}
}