Home /Examples/lib/examples/sleelvac/LEARNING-NOTES.md

LEARNING-NOTES.md

lib/examples/sleelvac/LEARNING-NOTES.md · 44 line(s) · markdown

Sleelvac examples โ€” what to learn here

sleelvac is the standalone SLeeLa compiler product. These examples teach how to build it, how it relates to the sleela command driver, and how to read its diagnostics. They are command guides (.md) because the subject is driving the toolchain, not writing a program.

Read them in order.

The three cases

LevelFileThe one new idea
BasicBASIC-build-and-help.mdBuild the compiler and read its own --help โ€” the source of truth for its flags.
ModerateMODERATE-compile-with-driver.mdUse the sleela driver for the stable check/compile/run path.
AdvancedADVANCED-driver-vs-compiler.mdChoose the right binary, read diagnostics, and respect the integrity gate.

The original CLASSIC-compiler-invocation.md shows the build and the basic driver commands together.

What we want you to take away

  1. Two binaries, one front end. sleela (driver) and sleelvac (compiler product) are built from the same parser and type checker, so they agree on the language. They differ in packaging and command surface.
  2. Trust --help, not assumptions. Because the two tools are separate products, the safe habit is to read sleelvac --help for its exact options rather than copying sleela subcommands and hoping they match.
  3. Diagnostics are addresses. Every error names a file, line, and column. Treat it as a coordinate: open that spot, fix exactly what the message describes, re-check, then build.
  4. Fail closed is on your side. The SHA-256 integrity gate stops a build when the tree does not match its manifest. If you edited a covered file on purpose, regenerate the manifest and re-check โ€” the gate guarantees you build what you intend to.

Try it

make -C impl
./impl/build/sleelvac --help
./impl/build/sleela check lib/examples/sleela/CLASSIC-hello-world.sleela