cksystemsteaching/selfie
FreeAn educational software system of a tiny self-compiling C compiler, a tiny self-executing RISC-V emulator, and a tiny self-hosting RISC-V hypervisor.
About cksystemsteaching/selfie
Selfie is an educational software system from the Computational Systems Group at the University of Salzburg. It provides a self-contained 64-bit implementation of a self-compiling C compiler (starc), a self-executing RISC-V emulator (mipster), and a self-hosting RISC-V hypervisor (hypster), all in a single 12KLOC file. The system is designed for teaching the design and implementation of compilers, runtime systems, operating systems, and virtual machine monitors. It compiles a tiny subset of C called C* to the RISC-U subset of RISC-V, generates ELF binaries that run on real RISC-V hardware, and includes a garbage collector, disassembler, linker, profiler, debugger with replay, L1 caches, and minimal OS support via RISC-V system calls.
Key Features
Pros & Cons
- self-contained educational tool with minimal dependencies
- single-file implementation makes it easy to study and modify
- supports both emulation and execution on real RISC-V hardware
- includes a wide range of system components (compiler, emulator, hypervisor, garbage collector, debugger)
- actively maintained with classroom slides and autograder support
- free and open source under a permissive license
- primarily educational, not intended for production use
- limited to RISC-V architecture (specifically RISC-U subset)
- requires a 64-bit system (LP64) or 32-bit compatibility for compilation
- may have a steep learning curve for beginners unfamiliar with systems programming