Skip to main content

Compiler CLI

cheeku <source.chuchu> [-O0|-O1|-O2|-O3] [-o <executable>] [--cpu generic|native] [--time-compilation] [--emit-ir <file>] [--emit-assembly <file>] [--no-vectorize]

The input must have a .chuchu extension. Options follow the source path; output and optimization flags can appear in either order. Unknown flags and repeated options are errors.

OptionDefaultPurpose
-o <path>main in the working directoryExecutable destination
-O0, -O1, -O2, -O3-O2Optimization level
--cpu genericSelectedGeneric CPU for detected host architecture
--cpu nativeOffHost-specific CPU/features
--time-compilationOffStage timing JSON on stderr
--emit-ir <path>OffLLVM IR after optional optimization
--emit-assembly <path>OffTarget assembly
--no-vectorizeOffDisable loop/SLP vectorizer and interleaving options
--help, -h—Print usage when passed alone

Compile and run​

cheeku hello.chuchu -O2 -o hello
./hello

Compilation does not execute the program. Paths containing spaces are supported when quoted in your shell:

cheeku "my source.chuchu" -o "my program"
./"my program"

Inspect generated code​

cheeku numerical.chuchu -O3 --emit-ir numerical.ll --emit-assembly numerical.s -o numerical

Artifact paths must differ from the input and each other. Existing source/artifact aliases are checked using path normalization and canonicalization.

Compilation timing​

cheeku hello.chuchu --time-compilation -o hello

One JSON object is written to stderr after success. Values are measured seconds:

KeyStage
lex_sTokenization
parse_sParsing
type_sType checking
ir_sLLVM generation and its verification
target_setup_sNative target configuration
optimization_sOptional passes and verification
object_sFinal verification and object emission/write
link_sSystem linker invocation
total_sCompiler API work

Total time need not equal the sum of stages. CLI process startup and timing output are outside API total. See performance for measurement details.

Exit behavior​

--help and successful compilation return status 0. Argument or compilation failures return a failure status and print a diagnostic. Generated runtime check failures separately return status 1 when the executable runs.