Skip to content

typeobject/wheeler

Repository files navigation

Wheeler

Note that Wheeler is an early work in progress and many things don't work yet.

Wheeler is a programming language for reversible computing and quantum computing. A verified reversible function can run as ordinary classical code or be lifted coherently for quantum execution, so the same implementation serves both domains.

The language keeps inverse execution, VM rewind, coherent permutations, quantum adjoints, measurement, replay, compensation, and retry distinct. Familiar class and method syntax lowers to one verified reversible typed IR: ordinary destructive work declares bounded history or a barrier, rev work declares an exact inverse, coherent work declares a finite permutation, and unitary work declares an adjoint-bearing quantum region. Irreversible effects and affine quantum resources stay explicit.

Example

classical class Counter {
    state long count = 0;

    rev void increment() {
        count += 1;
    }

    entry void main() {
        increment();
        increment();
        assert(count == 2);

        reverse {
            increment();
            increment();
        }
        assert(count == 0);
    }
}

The compiler generates increment's inverse. The reverse block executes new inverse operations in reverse lexical order; it does not rewind saved machine history.

Wheeler currently includes a reversible VM, backend-neutral quantum regions, an ideal state-vector target, asynchronous target jobs, OpenQASM 3 lowering, and Tree-sitter tooling.

Read next

Executable examples:

License

Wheeler is licensed under the Apache License 2.0.

About

A reversible, concurrent virtual machine and programming language.

Topics

Resources

License

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages