strict-script strict-script

Packages

@strict-script/self

The strict-script compiler, written in strict-script.

File of src/What it holds
lexer.sts, parser.sts, ast.stsA text read into a tree
types.stsThe types, and when one fits where another is asked for
prelude.stsWhat comes with the language: the methods of arrays, texts, maps, and the functions of the platform
check/The rules: typing, match, errors, mut and ownership, resources, extern
borrow.stsWhich functions only read a parameter, found from their bodies: what lets a value be lent to be read
checked.stsWhat the checker says of a file, and what is read to write its JavaScript
emit.sts, emit/The JavaScript, the declarations and the source map that are written
compile.stsSeveral files, in the order of their imports
diagnostic.sts, keys.sts, text.stsA refusal as a line of text; the key of a node; texts as JavaScript writes them

The checker, in check/:

FileWhat it holds
check.stsOne file: what it declares, in the order that lets each thing name the others, then the bodies
state.stsWhat the checker knows while it goes through a file, and the names in scope
shapes.stsQuestions about a type that need nothing of the file
resolve.stsA type as it is written, to the type the kernel knows
infer.stsWhat the type parameters of a call stand for
fitting.stsWhether a value may stand where it is written
names.stsWhat a name stands for, and what is done with a value that can be changed
offer.stsWhat may be written at one place, for an editor to offer: said by the checker when it gets there
patterns.stsWhat a pattern takes, declares and leaves
exprs.sts, calls.sts, statements.stsExpressions, calls and statements, which check each other in a circle

lib/ is what the compiler wrote for src/. It is kept in the repository, and it is what compiles src/ the next time: the compiler has no other form. After a change to src/:

pnpm self && pnpm build && pnpm self && pnpm build && pnpm test

A test fails when lib/ is not what the compiler writes for src/ today. Never delete lib/: without it nothing builds, and it comes back only from the repository (git checkout HEAD -- packages/self/lib). A change to src/ that the compiler in lib/ refuses, or that makes a compiler that does not work, is undone the same way.

Esc

    Type a word of the language, a rule, a command: mut, extern, match-not-covered.