dryftc) provides a command-line interface for compiling Dryft source files and launching an interactive REPL.
Usage
Arguments
Path to the Dryft source file to compile. If omitted, launches the interactive REPL.
Options
Target Selection
Specifies the compilation target. Must be one of the targets defined in
src/targets/.Available built-in targets:gcc- Compiles to C99 and uses GCC for final compilationelf- Compiles directly to x86-64 assembly using NASM
Path to a custom target TOML descriptor file. Use this to define your own compilation pipeline.Example:
Output Control
Specifies the output file path for the generated intermediate representation (IR).The file extension depends on the backend:
- C99 backend:
.cfile - x86 backend:
.asmfile
Only outputs the final Dryft assembly (IR). No external tooling (assembler, linker) will be called.Use this when you want to inspect the generated IR or handle compilation manually.Example:
Only outputs an object file without additional library linking. The assembly step runs, but the final linking step is skipped.Example:
Execution
Runs the final executable immediately after compilation using the pre-defined interpreter from the target specification.Example:
Examples
Basic Compilation
Compile a Dryft program using the default GCC target:a.out executable in the current directory.
Compile and Run
Compile and immediately execute:Using Different Targets
Compile using the x86 backend:Inspecting Generated Code
Generate C99 code without compiling:Custom Target
Use a custom target definition:Exit Codes
The compiler uses standard exit codes:0- Successful compilation- Non-zero - Compilation error or invalid arguments