compiler/
lib/
scripts/
seed/
test/
vim/
.gitignore
353 B
.gitsigners
112 B
LICENSE
1.1 KiB
Makefile
3.0 KiB
README
2.5 KiB
std.lib
1.0 KiB
std.lib.test
252 B
README
raw
| 1 | |
| 2 | \ | / |
| 3 | - - |
| 4 | / | \ |
| 5 | |
| 6 | RADIANCE |
| 7 | |
| 8 | Radiance is a small statically-typed systems language designed for the Radiant[0] |
| 9 | computer system (https://radiant.computer). It currently targets RISC-V (RV64). |
| 10 | |
| 11 | The compiler is self-hosted: written in Radiance, it compiles to RISC-V and |
| 12 | runs inside a RISC-V emulator on x86-64 platforms. |
| 13 | |
| 14 | Currently, the Radiance compiler supports most of the R' language. See |
| 15 | https://radiant.computer/system/radiance/prime/ for more information on R'. |
| 16 | |
| 17 | [0]: https://radiant.computer |
| 18 | |
| 19 | REQUIREMENTS |
| 20 | |
| 21 | * Linux on x86-64 |
| 22 | * Make |
| 23 | * Radiant's RISC-V Emulator |
| 24 | (https://code.radiant.computer/emulator/) |
| 25 | |
| 26 | BUILDING |
| 27 | |
| 28 | The compiler is self-hosted, so building from source requires bootstrapping |
| 29 | from a seed binary. A known-good compiler is checked into the repository. |
| 30 | |
| 31 | The Radiant emulator is required to run the compiler and build process |
| 32 | on x86-64. The build process will look for it in $PATH, unless $RAD_EMULATOR |
| 33 | is set to its location: |
| 34 | |
| 35 | export RAD_EMULATOR=~/bin/emulator |
| 36 | |
| 37 | Then, build the compiler: |
| 38 | |
| 39 | make |
| 40 | |
| 41 | This uses the emulator to run the seed binary (`seed/radiance.rv64`) which |
| 42 | compiles the self-hosted compiler source to produce `bin/radiance.rv64.dev`. |
| 43 | |
| 44 | To update the seed to a new fixed point: |
| 45 | |
| 46 | make seed |
| 47 | |
| 48 | This iterates self-compilation stages until two consecutive stages produce |
| 49 | identical output, proving the compiler faithfully reproduces itself. See |
| 50 | `seed/README` for full details on the seed workflow, verification, and |
| 51 | how to handle breaking changes. |
| 52 | |
| 53 | USAGE |
| 54 | |
| 55 | Compile a Radiance program: |
| 56 | |
| 57 | emulator -run bin/radiance.rv64.dev \ |
| 58 | -pkg example -mod example.rad -o example.rv64 |
| 59 | |
| 60 | Run a compiled binary: |
| 61 | |
| 62 | emulator -run example.rv64 |
| 63 | |
| 64 | TESTING |
| 65 | |
| 66 | Run all tests: |
| 67 | |
| 68 | make test |
| 69 | |
| 70 | Individual test suites: |
| 71 | |
| 72 | make std-test # Standard library tests |
| 73 | make lower-test # IL lowering tests |
| 74 | make asm-test # RV64 code generation tests |
| 75 | |
| 76 | PROJECT STRUCTURE |
| 77 | |
| 78 | seed/ Seed compiler binary and update tooling |
| 79 | compiler/ Self-hosted compiler entry point |
| 80 | lib/std/ Standard library |
| 81 | lib/std/lang/ Compiler modules |
| 82 | lib/std/arch/ Architecture backends |
| 83 | test/ Test harnesses |
| 84 | scripts/ Utility scripts |
| 85 | vim/ Vim syntax files |
| 86 | |
| 87 | EDITOR SUPPORT |
| 88 | |
| 89 | Vim syntax files for Radiance (.rad) and RIL (.ril) are in the vim/ folder. |
| 90 | Copy them to ~/.vim/syntax/ for syntax highlighting. |
| 91 | |
| 92 | LICENSE |
| 93 | |
| 94 | Licensed under the MIT License, |
| 95 | Copyright (c) 2025-2026 Radiant Computer (https://radiant.computer) |