Skip to content

Compiler CLI

jiangc compiles Jiang source files. The current compiler can emit LLVM IR, object files, or link an executable through the host C compiler.

Terminal window
./build/jiangc --emit-llvm tests/samples/minimal.jiang

By default, LLVM IR is written to standard output. Use -o to write it to a file:

Terminal window
./build/jiangc --emit-llvm tests/samples/minimal.jiang -o minimal.ll
Terminal window
./build/jiangc --emit-obj tests/samples/minimal.jiang -o minimal.o

This stops after object generation and does not link an executable.

Without an explicit --emit-* mode, jiangc creates a temporary object file and asks the host cc to link an executable:

Terminal window
./build/jiangc tests/samples/minimal.jiang -o minimal

Then run:

Terminal window
./minimal
echo $?

The current minimum runtime boundary still uses the host C runtime for low-level services, mainly:

  • malloc
  • free
  • printf
  • abort

This is expected during the current compiler development stage.