Module stdlib

Module stdlib 

Source
Expand description

The standard library’s Beck half, carried inside the compiler.

compiler/lib/README.md divides the standard library in two: a host’s table or grammar is a primitive in crate::prelude, and composition is a file written in Beck. The primitive half has always been in the binary. This is the other half, in the binary for the same reason — so that import bignum means the library this compiler was built with, wherever the program being compiled happens to sit.

adr/0018 is the decision and the alternatives it was taken over; 10 D23 is the language-level rule:

import x resolves against the root module’s own directory first, and against the standard library second.

The directory-first half is what keeps the files here editable: lib/decimal.beck imports bignum and gets the file beside it, so working on the library does not mean rebuilding the compiler to see the change. A program anywhere else gets this copy.

Constants§

MODULES
Every module in compiler/lib/, under the name an import writes.

Functions§

has
Whether name is a standard-library module.
names
Every name a program can import without a file beside it.
source
The source of a standard-library module, if there is one by that name.
sources
The module as the project loader wants it.