The core floor fixes construction, conversion, text scalar access, higher-order collection transforms, Option/Result helpers, and profile-gated testing without hidden coercion.
Canonical contract
Prelude constructors are Some, None, Ok, and Err; unsolved type variables require an expected type. print accepts a string only. toInt and related conversions use Option or declared failure values rather than exceptions. s.scalars() returns single-scalar strings; string .length remains absent. Free map, filter, and reduce consume only the fixed iterable families.
Public surface
The checked inventory extends the minimum with toIntRadix, fromCodePoint, toFloat, input, Math’s 13 members, string search/trim/split/slice/replace members, Option okOr/okOrElse/map/flatMap, Result map/flatMap, immutable Bytes, fixed-length mutable ByteBuffer, Encoding conversions, hashes, structured format helpers, Date, BigInt, Decimal, and exact JSON decode heads.
Observable behavior
String operations use scalar or explicitly named byte semantics. Higher-order calls evaluate inputs and callbacks in defined collection order. Option.map and optional access preserve/flatten the Option model as specified; Result mapping does not turn faults into Err. Typed JSON requires one written fully known target and returns deterministic $-rooted decode paths on data failure.
Binary assembly
Use ByteBuffer.allocate(length, value = 0) when an algorithm must write many bytes into one contiguous fixed-length value. set, fill, and copy require a let mut receiver root. All indexes, ranges, and byte values (0..255) are checked before a write; an invalid operation raises a fault without partially changing the buffer. Assignment shares the mutable identity, while ByteBuffer.fromBytes copies in and toBytes() creates an immutable snapshot.
let mut row = ByteBuffer.allocate(8)
row.fill(0, 8, 255)
row.set(0, 137)
let mut frame = ByteBuffer.allocate(12)
frame.copy(row, 0, 2, 8)
let payload = frame.toBytes()ByteBuffer itself cannot cross a Web export, participate in equality or ordering, serve as a Map/Set key, be interpolated into text/templates, or be encoded as JSON. Snapshot it to Bytes and encode explicitly at a text or ABI boundary. Release qualification includes a reference optimized-Web throughput check, but its machine-specific threshold is not a portable timing guarantee for every browser or device.
Current support
Core names are checked statically, and the virtual std root exposes a fixed module surface. Host functions such as print and input are available only in environments that provide the required input and output capabilities.
Constraints and exclusions
Do not print non-strings without interpolation, infer an unconstrained None/empty collection, treat strings as arrays, assume user-defined Iterable, catch faults with Result helpers, decode recursive/open/imported nominal schemas, or expose test helpers on the public profile. assert is a function only in test-profile, never a language keyword.
Worked example
function parseAll(values: Array<string>) -> Array<Option<int>> {
return map(values, value => toInt(value))
}
let scalars = "토파즈".scalars()
let parsed = parseAll(["1", "x", "3"])
print("{scalars.length}:{parsed}")