Quartz v5.25

Table Stakes Audit: Gap Coverage Report

Date: February 13, 2026 (created) | Last updated: April 6, 2026 Methodology: Cross-referenced comprehensive feature list (Rust, Go, Zig, Swift, C++, Odin) against Quartz’s actual implementation. Scope: Features rated TABLE STAKES or EXPECTED that are missing or incomplete.

April 2026 Status: 18 of 21 implementation items complete. 3 remaining (slices, re-exports, user macros).


Executive Summary

April 2026 update: Nearly all gaps identified in February have been filled. The language now has sorting, triple-quoted strings, raw strings, full Unicode support, visibility (priv), stack traces, overflow detection, filesystem ops, buffered I/O, path manipulation, postfix ?, thread-local storage, argparse, loop keyword, tuples with destructuring, operator overloading, and puts auto-coercion. Remaining gaps: slices (Slice<T>), re-exports (pub import), user-defined macros.

Original assessment (Feb 2026): Gaps clustered in stdlib holes, string limitations, safety gaps, tooling, and visibility.


Critical Gaps (TABLE STAKES — missing or broken)

These are features every compiled language has. Their absence is a red flag.

G1. Math functions — FALSE GAP

Status: IMPLEMENTED — f64_sqrt, f64_sin, f64_cos, f64_floor, f64_ceil, f64_round, f64_abs, f64_log, f64_exp, f64_pow, f64_atan2 are all registered intrinsics backed by LLVM intrinsics / libc. UFCS aliases available (.sqrt(), .sin(), etc.).

G2. Sorting — DONE (Apr 2026)

Status: ✅ COMPLETE — vec_sort(v), vec_sort_by(v, cmp_fn), v.sort(), v.unique(), v.dedup(), v.reverse() all implemented as builtins with UFCS.

G3. Pointer-sized integer type (usize/isize)

Status: MISSING — everything is Int (i64). No distinct type for indexing. Impact: Low on a 64-bit-only language, but “what’s your index type?” is a basic question. Currently Int is always i64, which is correct on 64-bit but conceptually imprecise. Note: Given Quartz’s existential model (everything is i64), this may be an intentional design choice. Consider adding usize as a type alias for Int at minimum. Effort: Trivial (type alias)


Important Gaps (EXPECTED — most modern languages have these)

G4. Multi-line strings — DONE

Status: ✅ COMPLETE — """...""" triple-quoted strings with automatic indentation stripping. Implemented in lexer.qz.

G5. Raw strings — DONE

Status: ✅ COMPLETE — r"..." raw string literals implemented in lexer.qz.

G6. Unicode / UTF-8 awareness — DONE

Status: ✅ COMPLETE — Full Unicode support: str_chars(), str_bytes(), str_char_at(), str_byte_at(), str_size() (codepoints) vs str_byte_len() (bytes). std/unicode.qz with grapheme clusters, normalization (NFC/NFD/NFKC/NFKD), case folding. for c in "hello" iterates codepoints.

G7. Visibility keywords — DONE

Status: ✅ COMPLETE — priv keyword for private definitions (Ruby-style). Default public, private section at bottom of file.

G8. Stack traces / backtraces on panic — DONE

Status: ✅ COMPLETE — Full DWARF debug metadata (355K+ annotations), frame pointers, backtrace() runtime walker. lldb works with source-level breakpoints, variable inspection, backtraces.

G9. Integer overflow detection — DONE

Status: ✅ COMPLETE — Compile-time overflow detection and runtime overflow checking via LLVM overflow intrinsics.

G10. Filesystem operations — DONE

Status: ✅ COMPLETE — file_exists(), mkdir_p(), dir_list(), file_delete(), rm(), cp(), mv() all available. std/io/file.qz module.

G11. Buffered I/O — DONE

Status: ✅ COMPLETE — std/io/buffered.qz with BufferedReader/BufferedWriter. file_open(), file_read_line(), file_close(), std/io/stream.qz.

G12. Path manipulation — DONE

Status: ✅ COMPLETE — std/io/path.qz with path_join(), path_ext(), path_dirname(), path_basename(), and more.

G13. Error propagation operator (?) — DONE (Apr 6, 2026)

Status: ✅ COMPLETE — Postfix ? restored. map.get("key")?, json_parse(text)?. Coexists with predicate methods (.empty?, .some?) via typechecker disambiguation.

G14. Slices (borrowed view into array/vec)

Status: MISSING — no slice type distinct from Vec Impact: Cannot pass a view into an array without copying. All functions take Vec<T> which is always heap-allocated. Note: Given the existential model, a slice could be a {ptr, len} struct. The str_slice function exists for strings but there’s no general Slice<T> type. Effort: Large (new type, codegen support)

G15. Custom error types

Status: PARTIAL — Result<T, E> is user-defined enum, but no trait-based error system Impact: No impl Error for MyError pattern. Error types are just enum variants. Note: The current approach works. This is more of an ergonomic gap than a blocker. Effort: Medium (trait design + derive support)

G16. Thread-local storage — DONE

Status: ✅ COMPLETE — @thread_local var x = 0 annotation exposed. Emits LLVM thread_local global.

G17. Re-exports

Status: MISSING — no pub use or re-export mechanism Impact: Module authors cannot create clean public APIs that re-export from submodules. Effort: Medium (resolver changes)

G18. Command-line argument parsing — DONE

Status: ✅ COMPLETE — std/argparse.qz with declarative argument parsing.

G19. Debugger support — DONE

Status: ✅ COMPLETE — Full DWARF debug metadata, frame pointers, lldb works with source-level breakpoints, variable inspection, struct field display. Merged with G8.

G20. loop keyword — DONE

Status: ✅ COMPLETE — loop ... end keyword implemented. TOK_LOOP in lexer, ps_parse_loop() in parser.


Nice-to-Have Gaps (common but not blocking)

These are features many languages have but whose absence is acceptable.

GapNotes
Tuples✅ DONE — (Int, String) with destructuring var (a, b) = expr.
Named arguments✅ DONE — connect(host: "localhost", port: 8080).
Type-based overloadingArity overloading exists. Type overloading is controversial.
Operator overloading✅ DONE — Constrained to fixed operator set via traits (Eq, Ord, Add, Sub, etc.).
User-defined macrosZig uses comptime instead. Built-in macros ($unwrap, $try, postfix ?) cover common cases.
Dynamic dispatch / vtablesIntentional design choice; static dispatch via monomorphization.
async/await✅ DONE — async expr, await future, colorblind async with go/channels.
Garbage collectionIntentional omission; manual + arena + Drop model.
128-bit integersUseful for crypto but niche.
Date/time library✅ DONE — std/time.qz with epoch, sleep, calendar.
Big integersLibrary feature in most systems languages.
Reference countingCan be implemented with linear types + Drop.
REPL✅ DONE — quartz repl with readline, syntax highlighting, tab completion.
Hot reloadNice for dev experience but not table stakes.
Generators / yield✅ DONE — Stackless state machines, yield, for-in integration.

Already Covered (no gaps)

These TABLE STAKES / EXPECTED features are fully implemented:

  • Type system: Bool, Int (i8-i64, u8-u64), Float (f32, f64), String, Vec, Map, Set, structs, enums (with data), Option, Result, type aliases, generics, const/var distinction, pointers, recursive types, newtype
  • Control flow: if/else, while, for-in (range + custom iterator), match (with guards, exhaustiveness), labeled break/continue, early return, defer, short-circuit and/or, block expressions, postfix guards
  • Functions: Named, closures/lambdas, first-class, default args, arity overloading, recursion, TCO, HOFs (each/map/filter/reduce/etc.), UFCS, pipeline, associated functions, const def
  • Memory: Stack, heap, arena, arena pools, Drop/RAII, linear types, borrowing (&T, &mut T), volatile, slab allocator
  • Error handling: Result, Option, try/catch, $unwrap/$try macros, panic, assert, static_assert, unreachable
  • Modules: import, from/import, import as, qualified calls, cross-module globals, @cImport
  • Concurrency: spawn/await, channels (buffered, non-blocking, timeout), select, mutexes, atomics (all orderings), structured concurrency (task_group), parallel_map/for/reduce, ring buffer
  • I/O: stdin/stdout/stderr, file read/write, TCP/UDP, HTTP client, event loop (kqueue/epoll), DNS
  • FFI: extern C, C types, variadic extern, string interop, pointer ops, @repr(C), @packed, inline asm, extended asm, @naked, @cImport, C backend, cross-compilation (5 targets)
  • Tooling: Formatter, linter, doc extractor, test framework (bspec), dump flags, optimization levels, IR snapshots, address sanitizer
  • Safety: const-by-default, mutability checking, exhaustive match, Vec bounds checking, linear type safety, borrow checking, newtype safety, typo detection
  • Metaprogramming: const eval, const def, static_assert, @cfg (compound conditions), $unwrap/$try, @cImport, doc comments
  • Strings: Literals, interpolation, concatenation, StringBuilder, format(), str_* functions, UFCS methods, regex literals + matching, symbols, character predicates
  • SIMD: F32x4, F64x2, I32x4, F32x8, FMA, min/max/abs, shuffle, gather/scatter, convert, auto-vectorization hints
  • Numeric: Hex/binary/octal literals, underscore separators (1_000), bitwise ops, bit manipulation (popcount, clz, ctz, bswap, rotl, rotr), random (rand_seed, rand_int, rand_range, rand_float), math (f64_sqrt, f64_sin, f64_cos, f64_floor, f64_ceil, f64_round, f64_abs, f64_log, f64_exp, f64_pow, f64_atan2 + UFCS)
  • Optimization: Constant folding, algebraic identity/annihilator, CSE, copy propagation, DCE, strength reduction, TCO, inlining, dominator tree, GVN, LICM, Polly

Interview Decisions (February 14, 2026)

Interactive interview completed. Each feature was discussed with trade-offs, comparisons, and design considerations. Decisions recorded below.

Decision Summary

FeatureDecisionNotes
G2 — SortingDONEvec_sort(v) + vec_sort_by(v, cmp_fn) + UFCS
G3 — usize aliasDOTrivial type alias for Int
G4 — Multi-line stringsDONE"""...""" triple-quote with indent stripping
G5 — Raw stringsDONEr"..." no-escape literals
G6 — UTF-8 awarenessDONEFull Unicode: graphemes, normalization, case folding
G7 — VisibilityDONEpriv keyword (Ruby-style)
G8 — Stack tracesDONEFull DWARF, frame pointers, lldb integration
G9 — Overflow detectionDONELLVM overflow intrinsics
G10 — Filesystem opsDONEfile_exists, mkdir_p, dir_list, rm, cp, mv
G11 — Buffered I/ODONEBufferedReader/Writer in std/io/buffered.qz
G12 — Path manipulationDONEstd/io/path.qz with join, ext, dirname, basename
G13 — ? operatorDONEPostfix ? restored (Apr 6, 2026). Coexists with predicates.
G14 — SlicesDOSlice<T> as {ptr, len} fat pointer — NOT YET IMPLEMENTED
G16 — Thread-local storageDONE@thread_local annotation
G17 — Re-exportsDOpub use or pub import — NOT YET IMPLEMENTED
G18 — Argparse stdlibDONEstd/argparse.qz
G20 — loop keywordDONEloop ... end
TuplesDONE(Int, String) with destructuring
Operator overloadingDONEConstrained ops via traits (Eq, Ord, Add, etc.)
User-defined macrosDODesign-first — NOT YET IMPLEMENTED
Async/AwaitDONEColorblind async: async/await/go/channels
@x sigilDO@x as shorthand for self.x — NOT YET IMPLEMENTED

Key Design Decisions

Visibility (G7): Default public with priv keyword prefix, following Ruby’s philosophy. Public interface at top of file, private implementation at bottom. Non-breaking change.

? Operator (G13): REVERSED (Apr 6, 2026). Postfix ? restored. ? no longer absorbed into identifiers. Predicates (v.empty?, opt.some?) still work via typechecker disambiguation in tc_expr_try — it detects field access patterns and rewrites to predicate calls.

Async/Await: SKIPPED. Quartz already has OS threads (spawn/await), channels, structured concurrency (task_group), and an event loop. Adding async would be paradigm #5 with function coloring tax. Go and Zig both avoid async — Quartz follows their lead.

User-Defined Macros: Requires dedicated design phase. Must research: Rust proc macros (powerful but complex), Elixir macros (elegant), Zig comptime, Yuescript macros. Error messages must propagate through macros with full source locations. Will not proceed to implementation until design is approved.

Operator Overloading: Constrained design — only a fixed set of operators (+, -, *, /, %, ==, <, etc.) via extend blocks. No custom operators, no implicit conversions. Natural extension of existing UFCS/extend mechanism.


Phase TS: Stack-Ranked Implementation Order

Stack-ranked by: dependencies flow down, smallest/safest first, fixpoint-risky items last. Each item requires: failing tests, C bootstrap, self-hosted, rebuild, fixpoint validation.

RankIDItemStatus
1TS.1loop keyword✅ DONE
2TS.2usize type aliasREMAINING
3TS.3Raw strings r"..."✅ DONE
4TS.4vec_sort / vec_sort_by✅ DONE
5TS.5Path manipulation✅ DONE
6TS.6Filesystem ops✅ DONE
7TS.7Thread-local storage✅ DONE
8TS.8Multi-line strings """..."""✅ DONE
9TS.9Buffered I/O✅ DONE
10TS.10Argparse stdlib✅ DONE
11TS.11UTF-8 awareness✅ DONE
12TS.12Visibility (priv)✅ DONE
13TS.13Integer overflow detection✅ DONE
14TS.14@x sigil (implicit self)REMAINING
15TS.15Stack traces on panic✅ DONE
16TS.16Re-exportsREMAINING
17TS.17Tuples✅ DONE
18TS.18Operator overloading✅ DONE
19TS.19Slices Slice<T>REMAINING
20TS.20User macros — DESIGNREMAINING
21TS.21User macros — IMPLREMAINING

Remaining items (5 of 21)

IDItemEffortNotes
TS.2usize type aliasTrivialType alias for Int
TS.14@x sigilSmall-MedParser + typechecker sugar in extend blocks
TS.16Re-exports (pub import)MediumResolver changes
TS.19Slices Slice<T>Large{ptr, len} fat pointer + range indexing
TS.20-21User macrosLargeDesign phase then implementation