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
reject · parsing · Verification · not-run
example.tpzThe retired block opener is rejected without a closerOpen in Playground →
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.
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
run · runtime · Verification · not-run
example.tpzAdd and subtract Duration values
import std.io { writeLine }
let sum =1s +500ms
let difference =2s -500ms
writeLine("{sum}")
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.
No stderr.
Expected stdout
1500ms
1500ms
This exact example has not been executed.
Multiply a Duration by an int in either order
run · runtime · Verification · not-run
example.tpzMultiply a Duration by an int in either order
import std.io { writeLine }
let count =3
let left =500ms * count
let right = count *500ms
let constructed =1ms * count
writeLine("{left}")
writeLine("{right}")
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.
No stderr.
Expected stdout
1500ms
1500ms
3ms
This exact example has not been executed.
Compare Duration values by milliseconds
run · runtime · Verification · not-run
example.tpzCompare Duration values by milliseconds
import std.io { writeLine }
let first =1s
let same =1000ms
let later =2s
writeLine("{Eq.equals(first, same)}")
writeLine("{Order.compare(first, later) <0}")
writeLine("{first == same}")
writeLine("{first != later}")
writeLine("{first < later}")
writeLine("{first <= same}")
writeLine("{later > first}")
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.
No stderr.
Expected stdout
true
true
true
true
true
true
true
true
This exact example has not been executed.
Display millisecond literals and extract int milliseconds
run · runtime · Verification · not-run
example.tpzDisplay millisecond literals and extract int milliseconds
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.
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
run · runtime · Verification · not-run
example.tpzPhysical CR uses the same multiline text and indentationOpen in Playground →
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.
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
run · runtime · Verification · not-run
example.tpzFinite floats use positional text with a decimal point
Render the largest finite float and the smallest normal and subnormal
run · runtime · Verification · not-run
example.tpzRender the largest finite float and the smallest normal and subnormal
import std.io { writeLine }
let largest =179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
let smallestNormal =0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002225073858507201383090232717332404064219215980462331830553327416887204434813918195854283159012511020564067339731035811005152434161553460108856012385377718821130777993532002330479610147442583636071921565046942503734208375250806650616658158948720491179968591639648500635908770118304874799780887753749949451580451605050915399856582470818645113537935804992115981085766051992433352114352390148795699609591288891602992641511063466313393663477586513029371762047325631781485664350872122828637642044846811407613911477062801689853244110024161447421618567166150540154285084716752901903161322778896729707373123334086988983175067838846926092773977972858659654941091369095406136467568702398678315290680984617210924625396728515625
let smallestSubnormal =0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625
Negative underflow retains zero sign while NaN drops its sign
run · runtime · Verification · not-run
example.tpzNegative underflow retains zero sign while NaN drops its signOpen in Playground →
import std.io { writeLine }
let negativeTiny =-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
let nan =0.0/0.0
let negativeNan =-nan
writeLine("{0.0}|{-0.0}|{negativeTiny}")
writeLine("{nan}|{negativeNan}")
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.
No stderr.
Expected stdout
0.0|-0.0|-0.0
NaN|NaN
inf|-inf
This exact example has not been executed.
Derived Show renders record fields and Set elements with the same float rule
run · runtime · Verification · not-run
example.tpzDerived Show renders record fields and Set elements with the same float rule
import std.test { assertContains }
record Reading derives Show {
value: float,
samples: Set<float>,
}
let sample =Reading {
value: 1000000000000000.0,
samples: set { 1000000000000000000000.0, 0.0000001 },
}
let text =Show.show(sample)
assertContains(text, "1000000000000000.0")
assertContains(text, "1000000000000000000000.0")
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.
No stderr.
No stdout.
This exact example has not been executed.
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.