Skip to content
Topazdocs

Search documentation

Specification 6.0

Use arrow keys to choose a result. Press Enter to open.

Type an API name, diagnostic number, rule, or project topic.

    Download →

    Design decisions

    Lexical structure and literals

    Line endings preserve statement boundaries

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Editors can save the same file with LF, CRLF or CR. Treating one of those endings as horizontal space can change where statements end.

    Decision

    • LF, CRLF and lone CR each count as one line break in source.
    • Every physical line break inside a block comment is preserved as the same statement boundary. Later replaced by Comments use one line at a time →

    Examples

    CRLF separates completed statements

    example.tpzCRLF separates completed statementsOpen in Playground →
    1. import std.io
    2. let value = 1
    3. -2
    4. io.writeLine("{value}")
    Expected outputExit code 0
    1
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1

    Bare CR separates completed statements

    example.tpzBare CR separates completed statementsOpen in Playground →
    1. import std.io
    2. let value = 1 -2
    3. io.writeLine("{value}")
    Expected outputExit code 0
    1
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1

    Bare CR ends a line comment

    example.tpzBare CR ends a line commentOpen in Playground →
    1. import std.io
    2. // comment io.writeLine("after")
    3. io.writeLine("tail")
    Expected outputExit code 0
    after
    tail
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. after
    2. tail

    Alternatives considered

    • Keep treating lone CR as horizontal space. Saving the file with different line endings could change its statement boundaries.

    Why

    The same statements work across file formats used by different editors and operating systems.

    Changed rules Horizontal space and newlines →Statement boundaries →

    Resolved pending items Carriage returns and comment-contained line breaks →

    Version history

    A former block-comment opener follows the operator rules

    Adopted November 16, 2026 · 6.0.0 · Being verified

    Problem

    The spelling /* at the start of a line can look like a comment opener. Once it is read as two operators, the diagnostic needs to identify the token that failed.

    Decision

    • The parser reads /* as / followed by *. If a preceding line contains an expression, / continues it and TPZ2001 points to *, where an operand was required.
    • At the start of a program with no preceding expression, the parser rejects the / itself.

    Examples

    The retired block opener is rejected without a closer

    example.tpzThe retired block opener is rejected without a closerOpen in Playground →
    1. let value: int = 1
    2. /* unfinished
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during parse. Nonzero exit.

    Alternatives considered

    • Stop a line-leading / from continuing the previous line. Moving a line break across division could change the meaning of an expression.
    • Give /* a special diagnostic. The retired spelling would need a dedicated token and rule again.

    Why

    The same division rule governs line continuation, and the error points to the missing operand.

    Changed rules Block comment spellings are rejected →Statement boundaries →

    Comments use one line at a time

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A multiline explanation could use consecutive line comments or one block comment. The block form also needed a rule for nesting.

    Decision

    • Start a comment with //. It ends at the line break.
    • There are no block comments /* */.

    Examples

    A block comment on one line is rejected

    example.tpzA block comment on one line is rejectedOpen in Playground →
    1. import std.io
    2. let value = 1 /* no line break */ +2
    3. io.writeLine("{value}")
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during parse. Nonzero exit.

    Parentheses do not admit block comments

    example.tpzParentheses do not admit block commentsOpen in Playground →
    1. import std.io
    2. let value = (1 /* before after */ +2)
    3. io.writeLine("{value}")
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during parse. Nonzero exit.

    Alternatives considered

    • Keep both line and block comments. The same multiline explanation would have two forms, and block comments would still need separate nesting rules.
    • Keep only block comments. Comments need one form, and block comments bring extra rules such as nesting.

    Why

    Write a longer explanation with consecutive // lines. A short note in the middle of a line keeps its meaning on the line above.

    Changed rules Block comment spellings are rejected →

    Version history

    Newlines separate statements and discarding a value is explicit

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A semicolon could separate statements and also change the result at the end of a block. Tidying separators could therefore change the value returned.

    Decision

    • Use a line break to separate statements. Semicolons are unavailable.
    • Use let _ = expression to discard a value. A line break, blank line or comment before the closing delimiter leaves the final value unchanged.

    Examples

    A semicolon cannot discard a block tail

    example.tpzA semicolon cannot discard a block tailOpen in Playground →
    1. function value() { 7; }
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during parse. Nonzero exit.

    • TPZ2001 →

      expected-statement-separator at example.tpz:1:21

    A semicolon cannot separate program items

    example.tpzA semicolon cannot separate program itemsOpen in Playground →
    1. let first = 1; let second = 2
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during parse. Nonzero exit.

    • TPZ2001 →

      expected-statement-separator at example.tpz:1:14

    Alternatives considered

    • Allow semicolons as statement separators. Line breaks and semicolons would remain two ways to separate statements.
    • Use a semicolon to discard a block's final value. A separator would also decide the result of the block.

    Why

    Readers can distinguish layout from an intentional discard.

    Changed rules Statement boundaries →

    Identifiers must already be in NFC

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Two Korean names can look alike while containing different code points. Name lookup needs a rule for those spellings.

    Decision

    • Write identifiers in Unicode 16 NFC. After the initial character, combining characters in Mn, Mc and Me are allowed, but default-ignorable characters are excluded.
    • String scalars and UTF-8 data retain their original values.

    Examples

    Use the NFC spelling throughout the source

    example.tpzUse the NFC spelling throughout the sourceOpen in Playground →
    1. let café: int = 1
    2. let 가: int = 2
    3. let K: int = 3
    4. let value: int = café + 가 + K
    Expected outputExit code 0
    No stdout.
    $ topaz check example.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Reject decomposed source names

    example.tpzReject decomposed source namesOpen in Playground →
    1. let café = 1
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during lex. Nonzero exit.

    Combining marks continue NFC names

    example.tpzCombining marks continue NFC namesOpen in Playground →
    1. let q́: int = 1
    2. let का: int = q́
    3. let x⃝: int = का
    4. loop 'q́ { break 'q́ }
    Expected outputExit code 0
    No stdout.
    $ topaz check example.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Reject an invisible Hangul filler in a name

    example.tpzReject an invisible Hangul filler in a nameOpen in Playground →
    1. let aㅤ = 1
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during lex. Nonzero exit.

    Preserve composed, decomposed, and invisible string data

    example.tpzPreserve composed, decomposed, and invisible string dataOpen in Playground →
    1. import std.io
    2. let composed = "é"
    3. let decomposed = "é"
    4. let hangul = "가"
    5. let invisible = "a͏‍️"
    6. let inserted = "{decomposed}"
    7. io.writeLine(composed.encodeUtf8().toHex())
    8. io.writeLine(decomposed.encodeUtf8().toHex())
    9. io.writeLine(hangul.encodeUtf8().toHex())
    10. io.writeLine(invisible.encodeUtf8().toHex())
    11. io.writeLine(inserted.encodeUtf8().toHex())
    Expected outputExit code 0
    c3a9
    65cc81
    e18480e185a1
    61cd8fe2808defb88f
    65cc81
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. c3a9
    2. 65cc81
    3. e18480e185a1
    4. 61cd8fe2808defb88f
    5. 65cc81

    Alternatives considered

    • Accept identifier spellings exactly as entered. Visually identical names could refer to different bindings.
    • Normalize identifiers automatically. The source would no longer show directly which spelling needed normalization.

    Why

    NFC makes the spelling of names explicit and preserves the underlying code points in string data.

    Changed rules Canonical source spelling →Identifier characters →Preserved Unicode string data →

    Radix prefixes and hexadecimal digits use lowercase

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Capitalizing a prefix or a hexadecimal digit could produce a second spelling for the same literal. The value was unchanged.

    Decision

    • Write 0b for binary and 0x for hexadecimal, both in lowercase.
    • Write hexadecimal digits a through f in lowercase as well.

    Examples

    Reject uppercase hex prefix

    example.tpzReject uppercase hex prefixOpen in Playground →
    1. let value = 0Xff
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during parse. Nonzero exit.

    • TPZ2001 →

      malformed-numeric-literal at example.tpz:1:13

    Reject uppercase binary prefix

    example.tpzReject uppercase binary prefixOpen in Playground →
    1. let value = 0B1010
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during parse. Nonzero exit.

    • TPZ2001 →

      malformed-numeric-literal at example.tpz:1:13

    Reject uppercase hex digit

    example.tpzReject uppercase hex digitOpen in Playground →
    1. let value = 0xA
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during parse. Nonzero exit.

    • TPZ2001 →

      malformed-numeric-literal at example.tpz:1:13

    Read lowercase radix literals

    example.tpzRead lowercase radix literalsOpen in Playground →
    1. import std.io { writeLine }
    2. writeLine("{0xff}")
    3. writeLine("{0b1010}")
    4. writeLine("{0xabcdef}")
    Expected outputExit code 0
    255
    10
    11259375
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 255
    2. 10
    3. 11259375

    Alternatives considered

    • Allow uppercase prefixes and uppercase hexadecimal digits. Capitalization would give the same value more spellings.

    Why

    Source uses the same conventions as standard hexadecimal output.

    Changed rules Integer spellings →

    Durations display as milliseconds and report overflow

    Adopted November 9, 2026 · 6.0.0 · Being verified

    Problem

    Adding a duration or multiplying by a negative factor can exceed the supported interval. A displayed value also needs a readable literal spelling.

    Decision

    • Duration supports addition, subtraction, integer multiplication in either order, comparison, display and toMillis(). Display uses a literal such as 1500ms. Build a duration from an integer with 1ms * n.
    • Overflow, negative results, negative factors and integer overflow in toMillis() produce TPZ4004 at runtime.
    • Topaz 6.0 gives Duration no JSON conversion.

    Examples

    Add and subtract Duration values

    example.tpzAdd and subtract Duration values
    1. import std.io { writeLine }
    2. let sum = 1s + 500ms
    3. let difference = 2s - 500ms
    4. writeLine("{sum}")
    5. writeLine("{difference}")
    Expected outputExit code 0
    1500ms
    1500ms
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1500ms
    2. 1500ms

    Multiply a Duration by an int in either order

    example.tpzMultiply a Duration by an int in either order
    1. import std.io { writeLine }
    2. let count = 3
    3. let left = 500ms * count
    4. let right = count * 500ms
    5. let constructed = 1ms * count
    6. writeLine("{left}")
    7. writeLine("{right}")
    8. writeLine("{constructed}")
    Expected outputExit code 0
    1500ms
    1500ms
    3ms
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1500ms
    2. 1500ms
    3. 3ms

    Compare Duration values by milliseconds

    example.tpzCompare Duration values by milliseconds
    1. import std.io { writeLine }
    2. let first = 1s
    3. let same = 1000ms
    4. let later = 2s
    5. writeLine("{Eq.equals(first, same)}")
    6. writeLine("{Order.compare(first, later) < 0}")
    7. writeLine("{first == same}")
    8. writeLine("{first != later}")
    9. writeLine("{first < later}")
    10. writeLine("{first <= same}")
    11. writeLine("{later > first}")
    12. writeLine("{same >= first}")
    Expected outputExit code 0
    true
    true
    true
    true
    true
    true
    true
    true
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true
    2. true
    3. true
    4. true
    5. true
    6. true
    7. true
    8. true

    Display millisecond literals and extract int milliseconds

    example.tpzDisplay millisecond literals and extract int milliseconds
    1. import std.io { writeLine }
    2. let delay = 1500ms
    3. let minute = 1m
    4. let second = 1s
    5. let zero = 0ms
    6. let endpoint = 18446744073709551615ms
    7. let intEndpoint = 9223372036854775807ms
    8. writeLine(Show.show(delay))
    9. writeLine("{delay.toMillis()}")
    10. writeLine("{minute.toMillis()}")
    11. writeLine("{second.toMillis()}")
    12. writeLine("{zero}")
    13. writeLine("{endpoint}")
    14. writeLine("{intEndpoint.toMillis()}")
    Expected outputExit code 0
    1500ms
    1500
    60000
    1000
    0ms
    18446744073709551615ms
    9223372036854775807
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1500ms
    2. 1500
    3. 60000
    4. 1000
    5. 0ms
    6. 18446744073709551615ms
    7. 9223372036854775807

    Reject a Duration subtraction below zero

    example.tpzReject a Duration subtraction below zero
    1. let earlier = 1ms
    2. let later = 2ms
    3. let difference = earlier - later
    Expected outputNonzero exit
    No stdout.
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during run. Nonzero exit.

    • TPZ4004 →

      duration-negative-difference at example.tpz:3:18

    Reject a millisecond count outside int

    example.tpzReject a millisecond count outside int
    1. let delay = 9223372036854775808ms
    2. let count = delay.toMillis()
    Expected outputNonzero exit
    No stdout.
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during run. Nonzero exit.

    • TPZ4004 →

      duration-to-millis-overflow at example.tpz:2:13

    Alternatives considered

    • Provide a separate conversion function for integers. The function and multiplication would construct the same duration.
    • Use a separate type per unit. There is already one unit, milliseconds, so no unit agreement is needed.
    • Provide division. Durations are built from a literal and multiplication alone, so operations do not overlap.
    • Display in reduced larger units such as 1s500ms. Durations display in milliseconds so there is one display form.

    Why

    Arithmetic and display use one unit, and an out-of-range operation identifies its failure.

    Changed rules Duration values and operations →

    Resolved pending items Duration operations beyond timeout admission →

    Every template tag uses the same escapes

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Moving between a regex and a shell template means knowing when a backslash is interpreted. A description that differs from accepted input makes that hard to predict.

    Decision

    • Use the same escape grammar for all template tags.
    • Document the escape sequences that the grammar accepts.

    Examples

    Unknown escape in a r template

    example.tpzUnknown escape in a r templateOpen in Playground →
    1. let value = r"\d"
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during lex. Nonzero exit.

    Every tag cooks the same single-line escapes

    example.tpzEvery tag cooks the same single-line escapesOpen in Playground →
    1. import std.io
    2. let pattern = r"\n\r\t\\\"\{\}"
    3. io.writeLine(pattern.parts[0])
    4. let command = sh"\n\r\t\\\"\{\}"
    5. io.writeLine(command.parts[0])
    6. let query = sql"\n\r\t\\\"\{\}"
    7. io.writeLine(query.parts[0])
    Expected outputExit code 0
    
    
    	\"{}
    
    
    	\"{}
    
    
    	\"{}
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. \"{}
    2. \"{}
    3. \"{}

    Alternatives considered

    • Keep raw backslashes and separate delimiter rules for r. Regex templates would require their own backslash and brace rules.

    Why

    The source escape layer works the same way for every tag.

    Changed rules String escape values →Tagged-template construction and display →

    Resolved pending items Tagged-template value contract →

    Source line endings leave string values unchanged

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Saving a file with multiline strings can change its line ending style. The file format should leave string content and indentation behavior predictable.

    Decision

    • Read each physical LF, CRLF or lone CR in a string literal as one newline.
    • Use an escape for an actual CR in string data. Multiline indentation follows the same rule for every line ending.

    Examples

    Physical CR uses the same multiline text and indentation

    example.tpzPhysical CR uses the same multiline text and indentationOpen in Playground →
    1. import std.io
    2. let value = """ first second """
    3. io.writeLine(value.encodeUtf8().toHex())
    Expected outputExit code 0
    66697273740a7365636f6e640a
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 66697273740a7365636f6e640a

    Escaped carriage returns remain character data

    example.tpzEscaped carriage returns remain character dataOpen in Playground →
    1. import std.io
    2. let opening = """\rhead"""
    3. let single = "S\rE"
    4. let multi = """
    5. M\rN
    6. """
    7. io.writeLine(opening.encodeUtf8().toHex())
    8. io.writeLine(single.encodeUtf8().toHex())
    9. io.writeLine(multi.encodeUtf8().toHex())
    Expected outputExit code 0
    0d68656164
    530d45
    4d0d4e0a
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0d68656164
    2. 530d45
    3. 4d0d4e0a

    Alternatives considered

    • Normalize LF and CRLF alone. A source file with CR line endings could produce a different string from otherwise identical code.

    Why

    Changing an editor's line ending setting leaves string values unchanged.

    Changed rules Multiline newline values →Multiline closing indentation →

    Path.from constructs paths from strings

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Code that turns text into a path could use a tag or a function. Developers had to learn whether the two spellings meant different things.

    Decision

    Remove the p tag. Call Path.from to construct a path from text.

    Examples

    Path construction uses Path.from instead of the p tag

    example.tpzPath construction uses Path.from instead of the p tagOpen in Playground →
    1. let value = p"notes"
    Expected outputNonzero exit
    $ topaz check example.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during parse. Nonzero exit.

    Path.from normalizes literal and interpolated text

    example.tpzPath.from normalizes literal and interpolated textOpen in Playground →
    1. import std.io
    2. import std.path { Path }
    3. function normalized(text: string) -> string {
    4. match (Path.from(text)) {
    5. case Ok(value) => value.toString()
    6. case Err(error) => error
    7. }
    8. }
    9. let directory = "notes"
    10. io.writeLine(normalized("./{directory}//draft/../chapter.tpz"))
    11. io.writeLine(normalized("notes\\draft\\..\\chapter.tpz"))
    12. io.writeLine(normalized("notes/.."))
    13. io.writeLine(normalized("Notes/가.TPZ"))
    Expected outputExit code 0
    notes/chapter.tpz
    notes/chapter.tpz
    .
    Notes/가.TPZ
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. notes/chapter.tpz
    2. notes/chapter.tpz
    3. .
    4. Notes/가.TPZ

    Alternatives considered

    • Give the p tag new path semantics. Creating a path would require a second spelling and a separate rule.
    • Keep the p tag as it is. Paths should have one way to be built.

    Why

    Path construction has the same name wherever it appears. Path.join joins segments safely, and Path.from reads a string as a path.

    Changed rules Registered template tags →Construct a normalized Path with Path.from →

    Whitespace-only source lines become blank lines in strings

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A multiline string can contain a line that looks empty but has indentation. Keeping the indentation would give it a different value from an empty line.

    Decision

    • On source lines made entirely of spaces and tabs, remove that whitespace and keep the newline.
    • Preserve data produced by escapes and interpolation.

    Examples

    Blank source lines ignore indentation

    example.tpzBlank source lines ignore indentationOpen in Playground →
    1. import std.io
    2. let indented = """
    3. A
    4. B
    5. """
    6. let unindented = """A
    7. B"""
    8. let tagged = r"""
    9. A
    10. B
    11. """
    12. io.writeLine(indented.encodeUtf8().toHex())
    13. io.writeLine(unindented.encodeUtf8().toHex())
    14. io.writeLine(tagged.parts[0].encodeUtf8().toHex())
    Expected outputExit code 0
    410a0a0a420a
    410a0a42
    410a0a420a
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 410a0a0a420a
    2. 410a0a42
    3. 410a0a420a

    Escaped and inserted whitespace remains data

    example.tpzEscaped and inserted whitespace remains dataOpen in Playground →
    1. import std.io
    2. let inserted = " \t"
    3. let value = """
    4. A
    5. \t
    6. {inserted}
    7. B
    8. """
    9. io.writeLine(value.encodeUtf8().toHex())
    Expected outputExit code 0
    410a090a20090a420a
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 410a090a20090a420a

    Alternatives considered

    • Keep the indentation on whitespace-only lines. Invisible indentation would change the resulting string.

    Why

    Blank lines read as they look, and escapes or interpolation can still add intentional whitespace.

    Changed rules Whitespace and interpolation in multiline strings →

    String interpolation and derived Show write finite floats without an exponent

    Adopted November 18, 2026 · 6.0.0 · Being verified

    Problem

    Interpolation or derived display could drop the fractional part of a large integral float. Its text then looked like an integer.

    Decision

    • For nonzero finite values in interpolation or derived display, choose a decimal with the fewest significant digits that rounds back to the same binary64 value.
    • Among those candidates choose the closest to the exact value. If two are equally close, take the one with an even final digit.
    • Write it in fixed notation and keep at least one digit after the decimal point.
    • Keep 0.0, -0.0, inf, -inf and NaN. NaN carries no sign or payload in the text.

    Examples

    Finite floats use positional text with a decimal point

    example.tpzFinite floats use positional text with a decimal point
    1. import std.io { writeLine }
    2. let large = 1000000000000000.0
    3. let larger = 1000000000000000000000.0
    4. let small = 0.0000001
    5. let sum = 0.1 + 0.2
    6. let shortSignificand = 1000000000000000128.0
    7. writeLine("{large}")
    8. writeLine("{larger}")
    9. writeLine("{small}")
    10. writeLine("{sum}")
    11. writeLine("{shortSignificand}")
    Expected outputExit code 0
    1000000000000000.0
    1000000000000000000000.0
    0.0000001
    0.30000000000000004
    1000000000000000100.0
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1000000000000000.0
    2. 1000000000000000000000.0
    3. 0.0000001
    4. 0.30000000000000004
    5. 1000000000000000100.0

    Render the largest finite float and the smallest normal and subnormal

    example.tpzRender the largest finite float and the smallest normal and subnormal
    1. import std.io { writeLine }
    2. let largest = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
    3. let smallestNormal = 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002225073858507201383090232717332404064219215980462331830553327416887204434813918195854283159012511020564067339731035811005152434161553460108856012385377718821130777993532002330479610147442583636071921565046942503734208375250806650616658158948720491179968591639648500635908770118304874799780887753749949451580451605050915399856582470818645113537935804992115981085766051992433352114352390148795699609591288891602992641511063466313393663477586513029371762047325631781485664350872122828637642044846811407613911477062801689853244110024161447421618567166150540154285084716752901903161322778896729707373123334086988983175067838846926092773977972858659654941091369095406136467568702398678315290680984617210924625396728515625
    4. let smallestSubnormal = 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625
    5. writeLine("{largest}")
    6. writeLine("{smallestNormal}")
    7. writeLine("{smallestSubnormal}")
    Expected outputExit code 0
    179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0
    0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022250738585072014
    0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0
    2. 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022250738585072014
    3. 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005

    Negative underflow retains zero sign while NaN drops its sign

    example.tpzNegative underflow retains zero sign while NaN drops its signOpen in Playground →
    1. import std.io { writeLine }
    2. let negativeTiny = -0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
    3. let nan = 0.0 / 0.0
    4. let negativeNan = -nan
    5. writeLine("{0.0}|{-0.0}|{negativeTiny}")
    6. writeLine("{nan}|{negativeNan}")
    7. writeLine("{1.0 / 0.0}|{-1.0 / 0.0}")
    Expected outputExit code 0
    0.0|-0.0|-0.0
    NaN|NaN
    inf|-inf
    
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0.0|-0.0|-0.0
    2. NaN|NaN
    3. inf|-inf

    Derived Show renders record fields and Set elements with the same float rule

    example.tpzDerived Show renders record fields and Set elements with the same float rule
    1. import std.test { assertContains }
    2. record Reading derives Show {
    3. value: float,
    4. samples: Set<float>,
    5. }
    6. let sample = Reading {
    7. value: 1000000000000000.0,
    8. samples: set { 1000000000000000000000.0, 0.0000001 },
    9. }
    10. let text = Show.show(sample)
    11. assertContains(text, "1000000000000000.0")
    12. assertContains(text, "1000000000000000000000.0")
    13. assertContains(text, "0.0000001")
    Expected outputExit code 0
    No stdout.
    $ topaz run example.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Alternatives considered

    • Drop .0 from large integral floats. The same type would become indistinguishable from integers at an arbitrary magnitude.
    • Use an exponent for large and small values. That spelling could not be pasted directly as a finite float literal.

    Why

    Displayed finite values round-trip as literals and remain visibly distinct from integers.

    Changed rules Decimal float values and text rendering →

    Path.from is the single path constructor

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Several constructors could normalize the same input in the same way. Calling normalize on an already normalized path leaves it unchanged.

    Decision

    • Use Path.from to construct a path from text.
    • Remove constructors that perform the same normalization and remove the identity operation normalize.

    Examples

    Path.from normalizes literal and interpolated text →

    Use an existing Path directly

    example.tpzUse an existing Path directlyOpen in Playground →
    1. import std.path { Path }
    2. function keep(value: Path) -> Path { value }
    Expected outputExit code 0
    No stdout.
    $ topaz check example.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Alternatives considered

    • Keep the existing constructors and normalize. The same operation would remain available under several names.

    Why

    One name identifies where a path is constructed and normalized.

    Changed rules Construct a normalized Path with Path.from →