Skip to content
Bi1kuPublic

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

Requiem

Requiem is a compact, object-oriented programming language with C-family syntax. Source files use .rq; the compiler emits portable .rqb bytecode which is executed by the Requiem virtual machine.

The implementation is written in dependency-free C11. Its compiler pipeline is lexer → Pratt parser → AST optimizer → bytecode compiler → stack VM.

Build

make
./bin/requiem version

For an optimized link-time-optimized build, run make release.

Run a source program directly or compile it first:

./bin/requiem run examples/objects.rq
./bin/requiem compile examples/objects.rq -o objects.rqb
./bin/requiem exec objects.rqb
./bin/requiem disasm objects.rqb

Language sketch

class Counter {
    init(start) { this.value = start; }
    increment() { this.value = this.value + 1; }
    get() { return this.value; }
}

var counter = Counter(40);
counter.increment();
counter.increment();
println(counter.get());

Functions, lexical blocks, if/else, while, for, arrays, classes, inheritance, methods, first-class functions, and native I/O are part of the language. The optimizer performs constant folding, dead branch and unreachable code elimination, safe small-function inlining, and bounded loop unrolling.

See the language guide and the implementation architecture. Run make test for the regression suite or make sanitize && make test for ASan/UBSan validation.

The C sources are grouped by responsibility under src/api, src/frontend, src/optimizer, src/bytecode, src/runtime, src/stdlib, src/core, and src/cli; the architecture guide documents the dependency flow.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages