Browse by type
Full-Stack is a self-contained compiler pipeline for a small systems language (HLL). It carries source all the way to machine code and runs the result on a built-in RISC-V CPU, with every stage inspectable in a graphical IDE:
HLL source -> IR -> RISC-V assembly -> ELF object -> virtual machine
The whole toolchain is written in Rust and runs either natively (egui desktop IDE
and a fsc CLI) or fully client-side in the browser via WebAssembly, VM included.
The kernel target boots a real S-mode operating system on the VM: paging, processes,
a filesystem, an interactive shell, a line editor, and a compiler toolchain that runs
inside the VM so you can write, compile, assemble, and run a program without ever
leaving the machine.
.hll or .s file in the in-VM editor, compile it with cc, assemble it with as,
link it with ld, and run the result, all without leaving the guest. The compiler (/bin/cc),
assembler (/bin/as), and linker (/bin/ld) are themselves HLL programs compiled by
this toolchain and executed as user processes.Boot the kernel target (the IDE's machine dock, or fsc run kernel.elf) and you land
at a shell prompt running as pid 1:
$ ls
/bin
/home
$ cd home/src
$ edit hello.hll ; line editor: append, insert, substitute, delete, write
$ cc hello.hll hello.s ; compile HLL -> assembly, inside the VM
$ as hello.s hello.o ; assemble -> a relocatable object
$ as stdlib.s stdlib.o ; assemble the tiny stdlib it links against
$ ld stdlib.o hello.o hello ; link the objects -> a runnable ELF
$ run hello ; exec it as a child process; the shell reaps it
HLL0
Y
[exit 36]
$ as array.s array.elf ; as can also wrap a standalone .s straight into a runnable ELF
$ run array.elf
[exit 42]
$ cube ; spinning wireframe cube in the framebuffer tab (WASD to rotate)
$ mandelbrot ; Mandelbrot set rendered to the framebuffer
$ life ; Conway's Game of Life on a toroidal grid
The shell, editor (edit), compiler (cc), assembler (as), and linker (ld) are
ordinary HLL programs in programs/user/, compiled by this pipeline and
installed into the filesystem image. Nothing about them is privileged, they reach the
kernel only through ecall.
cargo run --release (or the hosted web build)
opens a small IDE built with egui:
HLL is a small systems language built around explicit, predictable memory access:
T* is a pointer and is never implicitly dereferenced; use @ptr to read or write
through it, and &var to take an address..field = value (a leading : introduces a type, never a value),
with omitted fields zero-filled and contextual inference of the struct type.enum/match with exhaustiveness checking and literal patterns, and a ? operator
for error propagation.interface bounds on type parameters, and dynamic
interface values for runtime polymorphism.impl blocks, plus non-capturing lambdas
and function pointers.fmt := import("format"), then fmt.format_into(buf[..], "user={name}")),
extensible through a Format interface.defer for deterministic cleanup, and new / free for manual memory management.asm { } blocks for inline RISC-V assembly, and C interop through external
declarations.assert, panic, and print built in, and a small standard library shared between
hosted and kernel targets: heap allocators, Vec, owned strings, arena and pool
allocators, and text formatting.The language (HLL v2) is considered feature-complete. The full grammar and semantics are in the language specification.
HLL Source
-> Lexer / Parser tokens, AST
-> Semantic Analysis type checking, diagnostics
-> IR Compiler typed SSA IR
-> RISC-V Emitter register allocation, slot coloring, RV64IMAFD assembly
-> Assembler per-file .o objects (.text/.data/.rodata/.bss + symbols)
-> Object Linker symbol resolution + relocation -> ELF-64
-> Virtual Machine 5-stage pipelined CPU
.o and is linked with full relocation, exactly like a real
toolchain. No source concatenation happens before assembly.See the specifications for the full detail of each stage.
# Native desktop IDE (egui)
cargo build --release
cargo run --release
# CLI only (fsc)
cargo build --release --bin fsc
cargo run --release --bin fsc -- help
# Run the test suite
cargo test
# Web build (requires trunk: cargo install trunk)
trunk serve # dev server with hot-reload
trunk build --release # static bundle in dist/
The browser build runs the entire stack client-side, including the VM: you can boot the kernel, use the shell, and run the framebuffer demos without installing anything. A live build is hosted at lpc4.github.io/Full-Stack.
fsc)cargo build --release --bin fsc
fsc hll-to-ir program.hll -o program.ir # compile to IR
fsc hll-to-asm program.hll -o program.s # compile to assembly
fsc hll-to-asm program.hll --emit-o -o program.o # compile to relocatable object
fsc link main.hll utils.hll -o program.elf # compile and link multiple sources
fsc run program.hll # compile and run on the VM
fsc run program.s # load raw assembly text
fsc run kernel.elf # load a pre-linked ELF
| Path | Contents |
|---|---|
src/ |
The IDE: editor, machine dock, debugger, inspectors, pipeline, sessions |
crates/hll-to-ir/ |
Lexer, parser, semantic analysis, IR compiler, stdlib bundles |
crates/ir-to-asm/ |
IR to RISC-V assembly: register allocation, slot coloring, peephole |
crates/asm-to-binary/ |
Assembler, linker, ELF output (executables and relocatable objects) |
crates/virtual-machine/ |
VM: 5-stage CPU pipeline, caches, MMU, devices, bus |
crates/os-runtime/ |
Boot firmware, kernel sources, and standard library |
crates/fs-utils/ |
Shared .build manifest parser and syntax highlighting |
programs/user/ |
Boot-FS userspace tools, demos, samples, and fixtures |
programs/example/ |
Host-compiled example HLL programs, one folder per program |
programs/lessons/ |
Guided RISC-V assembly lessons, one folder per lesson |
programs/test/ |
Golden compiler fixtures and integration HLL inputs |
benches/ |
Reproducible compiler and VM benchmark suite, analysis, and figures |
tests/ |
Rust integration tests (VM execution, compiler suite, kernel boots) |
guide/ |
Full-Stack Guide generator, authored lesson, figures, theme, and WASM sandbox |
Each crate has a specification covering its design and contract.
| Area | Document |
|---|---|
| HLL language | _LANG_SPECIFICATIONS.md |
| IR design | _IR_SPECIFICATIONS.md |
| RISC-V backend | _RISCV_SPECIFICATIONS.md |
| VM and CPU | _VM_SPECIFICATION.md |
| OS and kernel runtime | _OS_SPECIFICATION.md |
Each crate also has a README.md with its flow, public API, and module layout.
cargo test
cargo test -- --nocapture # show UART output
The suite spans unit tests, golden IR/assembly snapshots in programs/test/, VM
execution tests that compile HLL and assert on UART output, and kernel integration
tests that boot the shell, assemble and run a program in the guest, and verify a clean
exit.
Dual-licensed under either of MIT or Apache 2.0, at your option.
browse all types & interfaces →
$ claude mcp add Full-Stack \
-- python -m otcore.mcp_server <graph>