README
 \ | /
-     -
 / | \

RADIANCE

Radiance is a small statically-typed systems language designed for the Radiant[0]
computer system (https://radiant.computer). It currently targets RISC-V (RV64).

The compiler is self-hosted: written in Radiance, it compiles to RISC-V and
runs inside a RISC-V emulator on x86-64 platforms.

Currently, the Radiance compiler supports most of the R' language. See
https://radiant.computer/system/radiance/prime/ for more information on R'.

[0]: https://radiant.computer

REQUIREMENTS

  * Linux on x86-64
  * Make
  * Radiant's RISC-V Emulator
    (https://code.radiant.computer/emulator/)

BUILDING

  The compiler is self-hosted, so building from source requires bootstrapping
  from a seed binary. A known-good compiler is checked into the repository.

  The Radiant emulator is required to run the compiler and build process
  on x86-64. The build process will look for it in $PATH, unless $RAD_EMULATOR
  is set to its location:

      export RAD_EMULATOR=~/bin/emulator

  Then, build the compiler:

      make

  This uses the emulator to run the seed binary (`seed/radiance.rv64`) which
  compiles the self-hosted compiler source to produce `bin/radiance.rv64.dev`.

  To update the seed to a new fixed point:

      make seed

  This iterates self-compilation stages until two consecutive stages produce
  identical output, proving the compiler faithfully reproduces itself. See
  `seed/README` for full details on the seed workflow, verification, and
  how to handle breaking changes.

USAGE

  Compile a Radiance program:

      emulator -run bin/radiance.rv64.dev \
          -pkg example -mod example.rad -o example.rv64

  Run a compiled binary:

      emulator -run example.rv64

TESTING

  Run all tests:

      make test

  Individual test suites:

      make std-test    # Standard library tests
      make lower-test  # IL lowering tests
      make asm-test    # RV64 code generation tests

PROJECT STRUCTURE

  seed/            Seed compiler binary and update tooling
  compiler/        Self-hosted compiler entry point
  lib/std/         Standard library
  lib/std/lang/    Compiler modules
  lib/std/arch/    Architecture backends
  test/            Test harnesses
  scripts/         Utility scripts
  vim/             Vim syntax files

EDITOR SUPPORT

  Vim syntax files for Radiance (.rad) and RIL (.ril) are in the vim/ folder.
  Copy them to ~/.vim/syntax/ for syntax highlighting.

LICENSE

  Licensed under the MIT License,
  Copyright (c) 2025-2026 Radiant Computer (https://radiant.computer)