Build and run programs
Use the Prismio 0.1 command line to run source, build native executables, or emit LLVM IR.
Last verified
Use run for a compile-and-execute loop and build for a persistent artifact. Both commands begin with the same front end: resolve imports, lex and parse source, run semantic and ownership checks, perform allocation analysis, and generate LLVM IR.
prismio run app.psm
prismio build app.psm -o apprun is convenient during development because it performs the build and then launches the resulting program. build is the correct choice when another tool, test, or deployment step needs the output file.
Entry file and imports
The input file is the entry module. Its directory is also the root used to resolve imports. An output ending in .ll emits LLVM IR without linking a native executable:
prismio build app.psm -o app.llFor an entry path project/src/main.psm, import model.user resolves beneath project/src. Changing the working directory does not redefine that source root when the entry path still identifies the same file.
Output modes
The output suffix selects an important build behavior:
- a normal executable path runs the LLVM/object/link pipeline;
- an output ending in
.llpreserves textual LLVM IR and stops before native linking.
Emitted IR is useful for compiler debugging and backend inspection. It is not the canonical source-language specification and may change when lowering improves without a Prismio language change.
prismio build app.psm -o app.ll
llvm-as app.ll -o app.bcThe second command is optional and requires a compatible LLVM toolchain.
Optimization levels
Optimization flags -O0, -O1, -O2, and -O3 are accepted. The build driver currently invokes Clang at -O2 when lowering generated IR to an object, so these front-end flags should not be treated as a stable end-to-end optimization contract yet.
Use -O0 when inspecting the least-transformed front-end output and a higher level only after measuring the actual executable. Since the driver pipeline is still evolving, record the complete command and compiler version with performance comparisons.
Analysis and verification
Add --verify to instrument allocation/free behavior, or --debug for conservative analysis. See the complete CLI reference.
prismio build app.psm -o app --verify
prismio build app.psm -o app --debug--verify helps test ownership-sensitive runtime behavior; it does not replace compile-time move checking. --debug changes analysis posture and is distinct from a general source debugger or guaranteed DWARF workflow.
Use the AIF subcommand to inspect allocation decisions without guessing:
prismio aif app.psm
prismio aif app.psm --why=1
prismio aif app.psm --summaryExit status and failures
When the compiler reports a lexical, parse, type, ownership, code-generation, or linker error, it exits unsuccessfully and does not run the application. A successfully launched program uses the result of main() -> Int as its process status under the current executable convention.
For reproducible bug reports, include the command, prismio --version, selected target, entry-file layout, and the first compiler diagnostic. If the failure appears after IR emission, also test .ll output to separate front-end generation from object/linker setup.