Compiler CLI
jiang compiles Jiang source files. The current compiler can emit LLVM IR, object files, or link an executable through the host C compiler.
Release packages retain jiangc as a compatibility link for existing scripts; new commands should use jiang.
Version and Help
Section titled “Version and Help”--version prints the Jiang compiler version, host target, and LLVM version.
Check Only
Section titled “Check Only”This parses, resolves, and type checks the program without emitting LLVM IR, an object file, or an executable.
Emit LLVM IR
Section titled “Emit LLVM IR”By default, LLVM IR is written to standard output. Use -o to write it to a file:
Emit an Object File
Section titled “Emit an Object File”This stops after object generation and does not link an executable.
Link an Executable
Section titled “Link an Executable”Without an explicit --emit-* mode, jiang creates a temporary object file and asks the host cc to link an executable:
Then run:
Debug and Release Modes
Section titled “Debug and Release Modes”jiang defaults to debug mode:
Release mode enables LLVM optimization:
Use --jobs when you need to cap compilation concurrency:
Targets
Section titled “Targets”Use --target for LLVM IR or object output:
Hosted executable linking is native-toolchain only. Release packages support macOS arm64 and Linux x86_64; Linux hosted programs use the system libc. Linux aarch64, Wasm, WASI, and Windows targets currently have narrower or experimental output boundaries, and Linux no-libc executable support is not yet available.
Linker Options
Section titled “Linker Options”Use --linker to select the program used for final linking:
Pass extra linker arguments with repeated --link-arg options:
Runtime Boundary
Section titled “Runtime Boundary”Hosted builds use the target host’s C runtime and native linker toolchain. Release compilers include
the LLVM libraries used by jiang, so running a packaged compiler does not require a separate
libLLVM or liblld installation.
Generation
Section titled “Generation”Run the package root generator or select a configured alias:
See reflection and generation for entry contracts, configuration, output replacement and caching.