Skip to content

Primitive Types

Table: scroll horizontally to read all columns.

TypeMeaningCurrent use
TextA sequence of bytes, including whitespace.Write a backtick-delimited literal, such as `hello`; store, compare, or print it.
NumberA finite binary64 number, such as 7 or -12.5.Store, compare, or print it. Integer spellings use the same number type.
TruthA Boolean value: true or false.Store, compare, print, or use it as a condition.
ThingA value retaining its concrete runtime type.Hold different value categories at an explicitly broad boundary.
Byte / BytesAn owned sequence of bytes.Construct from Text and read numbered bytes.
PointerA managed reference to a typed value.Copy handles to share a target; checked reads and writes.
NullAn explicit absence value.Initialize a value with Null; distinct from an unassigned slot.

Primitive types describe data; lexical types describe words. Collections and Functions use the same ownership rules.

Declarations, assignment, and reading values

Section titled “Declarations, assignment, and reading values”

A declaration names a value: Define "count" as 7. Runtime assignments take effect in source order, and every continuing path must assign a value before reading it. Declaring a type does not promise an implicit initial value.

The public-values program gives Text, Number, and Truth explicit initial values, then displays them with Show:

demo/paragraphs/public-values.l
Publicly define "Greeting" as `public`.
Publicly define "Count" as 7.
Publicly define "Enabled" as true.
Create "Shared" as a New Public Dictionary.
Create Shared's "Display|-s|-ed|-ing|-er" for Showing any Text.
Show Greeting.
Show Count.
Show Enabled.

Complete program. Source: demo/paragraphs/public-values.l.

Example evidence

Public paragraph scalars and project-owned vocabulary Dictionary. existing-witness-not-run. Evidence guide.

Assignment, Function arguments/results and captures snapshot ordinary values, recursively through collections; embedded Pointers retain their shared target. App handles retain process identity. Stored Output keeps its invocation's bytes after reruns. See capture environments.

Backticks delimit Text. Interior bytes are retained, except that a backslash immediately before an escaped backtick is removed when the literal is unquoted. This is not general escape decoding: backslash followed by n remains two characters. Text has no implicit newline. Show writes it exactly; imported IO.Print appends one LF. See the IO reference.

Text preserves UTF-8, invalid UTF-8 octets, NUL, whitespace, and markup punctuation. Native encoding preserves these bytes without replacement characters. Browser displays cannot faithfully represent every octet; use the original source bytes for byte-sensitive examples.

Text supports equality with Text. General ordering, numeric conversion, indexing, concatenation operators, code-point iteration, and Unicode normalization are not currently exposed as L operations. Native definitions can supply target-specific operations.

docs/examples/lexical-text-escapes.l
Show `A backtick: \``.
Show `The characters \n stay backslash and n`.
Show `雪 {braces} <DEF> ordinary text`.

Fragment. Source: docs/examples/lexical-text-escapes.l.

Example evidence

Documentation-only Text operands illustrating escaped backticks, literal backslash-n, Unicode, braces and interior markup; static inspection, not execution. static-inspection. Evidence guide.

The first Text contains a backtick; the second retains the two bytes \n; the third retains Unicode, braces, and an interior <DEF> marker as data. Successive Show calls write adjacent text. This fragment does not define a Bytes constructor or an escape for arbitrary octets.

Number uses finite IEEE-754 binary64 (float64 in Lyger, f64 in Rust). It is not an arbitrary-precision integer, and L has no source integer-width family.

The number parser accepts these forms. Source token boundaries also apply; parser acceptance alone does not make a spelling a complete standalone token.

Source spellingRepresented consequence
3, +3, 3.0The same binary64 value
-12.5Negative finite fraction
1e6One million
0x1.8p+1Three
1_000One thousand
9007199254740993Rounded to the representable value 9007199254740992
5e-324Smallest positive subnormal
1e-4000Underflows to positive zero
-1e-4000Underflows to negative zero

Positive and negative zero retain their sign through native encoding. Overflow, such as 1e999, rejects with its range error preserved. Numeric-looking declared words can resolve as names. Although the lower parser recognizes nonfinite spellings, native scalar emission and typed definition binding reject NaN and Infinity.

Number supports equality and order comparisons with Number. Text/Number comparisons do not coerce. The English source grammar has no general arithmetic operator expressions; native logeme calculations are a separate interface.

IO.Print uses shortest round-tripping binary64 formatting, corresponding to strconv.FormatFloat(value, 'g', -1, 64). One million prints as 1e+06, followed by LF.

docs/examples/values-number-printing.l
Use IO's Print from `io` as "Print".
Create "Worker" as a New Basic App.
The App Prints 3.5.
The App Prints -12.5.
The App Prints 1000000.

Fragment. Source: docs/examples/values-number-printing.l.

Example evidence

Documentation-only App-body fragment drawn from the source-number parity witness; no lifecycle instructions or execution of this fragment. static-inspection. Evidence guide.

The three calls print 3.5, -12.5, and 1e+06, each followed by LF when the App runs. This fragment supplies only the App body. The first program shows the lifecycle and output handling needed to execute it.

The literals are lowercase true and false. A bare condition requires Truth; equality requires another Truth. Number and Text have no implicit truthiness. The grammar's ?~? notation is a type matcher, not a source literal.

Configured not/negative forms express negation in conditions, not a general prefix operator. Joined Boolean conditions are currently rejected by outer instruction lowering; no short-circuit behavior is defined.

testdata/phase1/language/lang-13.l
Use IO's Print from `io` as "Print".
"message" is `condition`.
"enabled" is true.
Create "Worker" as a New Basic App.
The App Prints message.
Run Worker.
If enabled equals true, await Worker, else exit.
Define "result" as Worker's Output.
Show result.

Complete program. Source: testdata/phase1/language/lang-13.l.

Example evidence

Complete LANG-13 program: Truth equality chooses Await and then reads finalized App output. Existing native witness, not run here. existing-witness-not-run. Evidence guide.

enabled receives a Truth. Comparing it with true selects await Worker; the following declaration snapshots the finalized Output. Replacing true with backtick Text changes the type and does not create truthiness.

Thing preserves a contained runtime type and checks typed reads. It does not coerce values into Text. IO.Print selects typed rendering definitions for Text, Number, Truth and Null:

docs/examples/values-thing-printing.l
Use IO's Print from `io` as "Print".
Create "Worker" as a New Basic App.
The App Prints `ready`.
The App Prints 7.
The App Prints true.

Fragment. Source: docs/examples/values-thing-printing.l.

Example evidence

Documentation-only public Print calls supplying Text, Number and Truth to the private native Thing parameter; static composition, no execution claim. static-inspection. Evidence guide.

The public Print action composes private rendering and writing Functions. This fragment supplies an App body; declaration alone does not run it.

Thing does not provide dynamically typed arithmetic, unrestricted reflection, or printing for every application or collection value. Its usable arguments depend on the definition and native consumer.

Define "buffer" as a New Bytes of `raw`. copies Text bytes. Define "octet" as a New Number from buffer at 1. reads the zero-based byte as Number. Indices must be nonnegative integers within bounds; Bytes mutation is not exposed. Byte is vocabulary for byte-oriented storage, not an additional numeric-width family.

Define "message" as `first`.
Define "handle" as a New Pointer of message.
Define "shared" as handle.
Put `second` in shared.
Define "selected" as a New Text from handle.
Show selected.

The Pointer owns a copy of the initial value. Both handles share that target, so this prints second; message remains first. Target types are checked. Pointer and capture-environment writes reject ownership cycles. Reads release their checked borrow before a nested call or Await. The last owner releases the target; there is no pointer arithmetic or user-managed deallocation.

Define "nothing" as Null. initializes an absence value; Show writes null. A typed Null read still evaluates its source and checks its type, index or key. Null does not replace definite assignment. The separate native-definition Null atom displays <nil>.

Compiler labels are separate from public types: ID, None, and Unknown track resolution; Lexeme stores lexical definitions; invalid sentinels indicate compiler state. An Error value can be created from Text or read from a failed App, stored and passed like other values. Reading an absent App Error rejects; it does not fabricate an Error.

Matching Text, Number, and Truth values can be compared; ordering is Number-only. No implicit cross-scalar coercion is promised. Definition slots separately check their required argument kinds.

The repeated-activation demo contrasts an App alias with a Text snapshot:

demo/paragraphs/repeated-activation.l (lines 10–17)
Use Repeat as "Worker".
Run Worker.
Await Worker.
Define "snapshot" as Repeat's Output.
Run Worker.
Await Worker.
Show snapshot.
Show Repeat's Output.

Fragment. Source: demo/paragraphs/repeated-activation.l (lines 10–17).

Example evidence

App alias and scalar Output snapshot excerpt; requires earlier App declaration and continuation. Full demo has existing native witnesses. existing-witness-not-run. Evidence guide.

Worker and Repeat refer to the same App. After the first join, snapshot holds that invocation's Output. Running the App again does not update snapshot: Show snapshot reads the stored scalar, while Show Repeat's Output reads the later invocation. Both invocations happen to print the same message. This excerpt depends on the demo's earlier declarations.

Primary sources: value tags, primitive storage and loading, type spellings, native encoding, definition encoding, and typed orchestration. Existing witnesses: Number encoding, numeric resolution, raw Text, Text encoding, IO numeric formatting, stored-value invariants, and scalar conditions. Example labels distinguish complete programs from fragments; website validation does not execute L.


Canonical source: docs/spec/values.md.