hc [--modules] [--import-builtin] [--no-std] [--typecheck] [--trace-inference <file:line>] [--emit <output-type>] [-o <file>] [--verbose] [<inputs> ...]
Compiles <inputs>
and produces an output <file>
of the specified <output-type>
.
Not implemented
Compile <inputs>
as separate modules.
Example:
// In `Sources/Hello/Hello.hylo`
import Greetings
public fun main() {
greet("World")
}
// In `Sources/Greetings/Greetings.hylo`
public fun greet(_ name: String) {
print("Hello, ${name}!")
}
hc --modules Sources/Hello Sources/Greet -o hello
Running this command will:
- Build the source files in the
Sources/Hello
directory into a module namedHello
- Build the source files in the
Sources/Greetings
directory into a module namedGreetings
- Link the
Hello
andGreetings
modules as an executable namedhello
.
Import the built-in module. Allows using Hylo's built-in types and functions (e.g., Builtin.terminate()
) in Hylo code.
Do not include the standard library module.
Compile in freestanding mode (don't use libc).
Type-check the input file(s). Exits the compilation pipeline after type-checking and does not produce an output file.
Enable tracing of type inference requests at the given line.
Example:
hc --typecheck --trace-inference main.hylo:16 main.hylo
Running this command will show a trace of the type constraint solver for all root expressions at line 16 of main.hylo
.
Emit the specified output type (default: binary
). Each type represents a stage of the compilation pipeline.
<output-type> |
Description |
---|---|
raw-ast |
AST before type checking |
raw-ir |
Hylo IR before mandatory transformations |
ir |
Hylo IR |
llvm |
LLVM IR |
intel-asm |
Intel Assembly |
binary |
Executable binary |
Example:
hc --emit raw-ast -o main.json main.hylo
Running this command will parse main.hylo
, write the untyped AST in main.json
, and exit the compilation pipeline.
Write output to <file>
.
Use verbose output.
Output the compiler version.