prelude

package
v0.2.13 Latest Latest
Warning

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

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

README

The standard prelude

No type is built in. std.tdl declares the roots every other TDL file depends on, and a project may point prelude at a replacement directory.

The collection and optionality sugar resolves through these 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>.

std.tdl is embedded in the binary and loaded into an outer scope beneath every file, so a file may declare a name the prelude already has and its own wins. Its declarations are merged into the model untagged: to a backend they are declarations like any other, which is what lets a replacement change what a collection is without any backend learning about it.

tdl ir --prelude other.tdl lowers against a different one, and sema.WithPrelude is the library equivalent. Nothing in the compiler knows what List means; it knows only that [T] is spelled List<T>.

Documentation

Overview

Package prelude embeds the standard prelude, the TDL source declaring the roots every other file depends on.

No type is built in. `[T]` is `List<T>` and `T?` is `Option<T>` only because something declares `List` and `Option`, and a project may point at a replacement that declares them differently.

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