CLI usage¶
Arkoi builds a single compiler executable. The CLI is centered around compiling one or more .ark inputs and selecting which pipeline stages should run.
Basic usage¶
arkoi_language [options] <inputs...>
Common options¶
-h,--helpshows the help text--versionprints the compiler version-o,--output <file>sets the output file name-v,--verboseprints the commands used during compilation-c,--compile-onlystops after generating assembly-a,--assemble-onlystops after assembling object files-l,--link-onlystops after linking-r,--runlinks and runs the output binary--emit-asmwrites.sfiles--emit-cfgwrites.dotcontrol-flow graph files--emit-ilwrites.ilfiles
Typical workflow¶
- Build the compiler.
- Run it on a source file.
- Use
--emit-il,--emit-cfg, or--emit-asmwhen you want to inspect the pipeline. - Use
--runwhen you want the produced binary executed immediately.
Examples¶
Compile and run a program:
arkoi_language example/hello_world/hello_world.ark --run
Generate assembly without linking:
arkoi_language example/hello_world/hello_world.ark --compile-only --emit-asm
Emit intermediate language and a CFG:
arkoi_language example/hello_world/hello_world.ark --emit-il --emit-cfg
Use a custom output name:
arkoi_language example/hello_world/hello_world.ark --output hello
Notes¶
Examples use the executable produced in build/bin/arkoi_language, while the command-line help text shown by the binary uses the same options described above.