Lyric
A statically typed application language with a bytecode VM — standalone, and embeddable in a host with a capability-based sandbox.
What changed in v4.1.0 — 2026-08-27
Instant and Duration join the library's conformances. Additive: no existing program
changes meaning, and nothing was deprecated or removed.
Added
InstantandDurationconform toEquatable,Ordered,HashableandDisplay. Every other value type in the library has carried these; the two time types never did, so comparing two instants meant unwrapping both toepochMillis(), sorting aList<Instant>was not possible at all, and neither type could be printed or used as aMapkey.if (started < finished) { // Ordered println(finished.since(started)); // Display -> "3500ms" } sortList(stamps); // the reason Ordered is on the type seen.set(finished, "done"); // HashableInstant.show()is the textiso()writes — the one textual form the type has.Duration.show()is the millisecond count with its unit (3500ms,-500ms), NOT a scaled3.5s: the type counts whole milliseconds, and a rendering that divides them promises a precision the value does not carry.compareis three comparisons rather than a subtraction of the two fields. Two instants far enough apart overflow that subtraction and it answers with the opposite sign.+and-did not arrive with them.plus,minusandsinceare methods, and an operator beside them would be a second way to write one calculation;Instant - Instantis aDurationbesides, which the homogeneous operator interfaces do not express.