prelude

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

README

The standard prelude

No type is built in. std.tdl declares the primitives, collections, options, SI base units, and the Entity class that every file depends on.

The sugar resolves through its names: [T] is List<T>, {T} is Set<T>, {K -> V} is Map<K, V>, T? is Option<T>, and T | null is Nullable<T>. The compiler knows those spellings and nothing about what the types mean.

std.tdl is embedded in the binary and loaded in a scope beneath every file, so a file's declaration of the same name wins. Its declarations reach backends like any other, so a replacement prelude can change what a collection is without a backend change. Use one with tdl ir --prelude other.tdl, or sema.WithPrelude from Go.

Documentation

Overview

Package prelude embeds the standard prelude, the TDL source declaring every type, including `List` and `Option`, that sugar such as `[T]` and `T?` names.

Index

Constants

View Source
const Name = "std.tdl"

Name is what the standard prelude is called in diagnostics.

Variables

View Source
var Source string

Source is the standard prelude.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL