Home /Examples/lib/examples/compiler/MODERATE-compile-and-run-artifact.md

MODERATE-compile-and-run-artifact.md

lib/examples/compiler/MODERATE-compile-and-run-artifact.md · 29 line(s) · markdown

Compiler example (moderate): compile an artifact, then run it

Once a source checks cleanly, compile it into a runnable artifact and execute the artifact separately. Separating "compile" from "run" is what lets you build once and run many times.

# 1. Compile source -> artifact
sleela compile lib/examples/sleela/CLASSIC-hello-world.sleela -o build/hello.sleela

# 2. Run the compiled artifact
sleela run build/hello.sleela

Expected output from the run step:

Hello, SLeeLa.

Notes: