modules/foundation/ + web/js/foundation_bridge.jsPure-C runtime for Date / Calendar / URL math (compiled into foundation.wasm) plus a JS bridge for things that need browser APIs (UserDefaults / JSON / Date formatting / Unicode classification).
All date math is plain C — Gregorian-only. foundation.wasm exports these; user code reaches them via Date.now, Calendar.current.dateComponents(...), etc.
RFC 3986–compatible parsing in pure C — no allocator surprises, output strings live as long as the input.
Functions that need browser APIs — exposed under the Foundation:: namespace by web/js/foundation_bridge.js.
Foundation types known to the type system. Concrete coverage matches the runtime function tables above.
Epoch-seconds Double. Initialisers, comparison, distance(to:), addingTimeInterval, ISO formatting via bridge.
Gregorian calendar; .current returns the system locale. dateComponents(_:from:) / date(from:) / range(of:in:for:) all wired.
Component extraction + manipulation. URLComponents.queryItems setter materialises through __url_appending_query_items.
Backed by localStorage in the browser; .standard works with set/get/remove for primitive types.
Top-level parse + dictionary key lookup + array index lookup via the bridge. Encoder/Decoder generic Codable not yet auto.
Class registered; encoding works for primitive types and dictionaries via JSONSerialization fall-back.
Class registered; .string(from: Date()) dispatches to __date_iso8601.
Format string subset (yyyy / MM / dd / HH / mm / ss / MMMM / MMM / EEEE / EEE).
Class registered for legacy bridging; no message-passing runtime.
Type registered (see ir_lowering/data.c); subscript + count basic, no NSData bridging.
Foundation surfaces outside the current scope. Most need either a JS API binding or a non-trivial Gregorian-calendar generalisation.
No virtual filesystem in the browser; would need OPFS or in-memory FS.
fetch() bridge not yet wired. AsyncImage uses raw fetch directly.
Observer plumbing absent; no KVO/NS bridge.
Only "en_US" hardcoded paths exercised. Real Locale.current + bcp47 codes not honoured.
Currency / percent / scientific styles not implemented.
No regex engine; Swift 5.7 regex literals also unimplemented.
No process model in WASM browser env.
Type slot unfilled; styled text not supported.
Pre-Swift-Concurrency queue model — superseded by Task in our runtime.
Unit family + dimensional analysis not implemented.
NSError is a class registered for sema; user errors are Swift Error all the way down.
No on-disk bundle; UserDefaults via localStorage is the practical replacement.
Only "gregorian" implemented — no buddhist / hebrew / islamic / chinese.
Encoder / Decoder runtime works for primitives; struct ↔ JSON requires manual coding currently.
Old NSKeyedArchiver / Unarchiver not implemented.