Reference

std/resource

Files a program needs, named by a string literal where the signature says what kind of file it is (docs/design/RESOURCES.md): a Resource ships beside the program and is read while it runs, an EmbeddedBytes and an EmbeddedText are in the binary. A literal where one of them is expected is resolved by the compiler against the file that writes it, and a file that is not there is an error at that line; a String value never becomes one.

fn load(sheet: Resource): String {
  sheet.name()
}

print load("./hero.png")

This is slice 1 of the design: the types, the literal and the stable name. Reading the bytes - embedding them and shipping them - is slices 2 and 3.

Modules

Everything