Skip to content

Nova Oracle 0.1.4 (alpha)

Pre-release
Pre-release

Choose a tag to compare

@unitcraft unitcraft released this 11 Nov 19:57

Nova Oracle 0.1.4 (alpha)

This release consolidates fixes since Oracle 0.1.0.

Built from 14bc6bb5a.

The Windows, Linux, and source archives were refreshed with the standard-library changes from 1e02814e2. This adds the optional fs.read buffer_size argument (default 8 KiB) and simplifies GraphemesIter.count() while preserving iteration after counting. The compiler binaries and release tag are unchanged. SHA256SUMS lists the refreshed archives.

Five Roads fixes

  • Fix C emission for value-enum methods that match on self and for exported constants accessed through whole-module imports. Qualified constants preserve their module identity even when another module exports the same name.
  • Use the expected channel type when inferring constructors, validate qualified constructor names against it, and carry the module-qualified type through emission.
  • Fix value-record name collisions such as NovaValue_Output. Order synthesized definitions with their dependencies and emit peer-record literals with their fields.
  • Fix unit-variant constructors in generic sums and a compiler crash when resolving a display channel (registry 1967).
  • Regenerate the Carina shell template and require package tests to run and pass within explicit deadlines.

New in 0.1.4

  • Sum values of the expected sum type are emitted unchanged instead of acquiring an extra wrapper (registry 1965).
  • Bare Ok, Err, and Some calls use the expected Option or Result type when a file-local sum declares the same name (registry 1966).
  • The Windows ZIP ships the Rust compiler as nova.exe, with no nova-compat.exe or Carina (registry 1968).
  • The Linux archive includes the Rust compiler executable alongside the standard library and runtime sources. The published 0.1.3 archive contained the library and runtime, but no executable.
  • Fix C type ownership for imported and colliding records, including the SQLite FFI example, and keep the C emitter within its source-size budget.
  • Restore garbage-collection diagnostics linkage in malloc-mode builds. Linux CI can build Boehm GC from the pinned source.

Fixes carried forward from Oracle 0.1.3

  • The final 0.1.3 reissue fixed a PostgreSQL regression. When same-file variant candidates tie, a bare record variant such as Complete retains the ambiguity until the expected type resolves it.

Highlights

The language

  • print/println → Io (owner decision, canon-exact): signatures
    carry Io (extern "nova" fn println(...items []any) Io -> ());
    enforcement per D62 rule 1 (--strict-effects names a missing Io with
    an exact hint). The lowering is a synthesis: args become one interpolated
    string through the existing display engine (honest
    E_INTERP_NO_DISPLAY for user types instead of the old %lld garbage),
    then a single dispatch through the Io.write_out op with the lazy D431
    default. The ~190-LOC nova_print_* dispatch family is gone. Behavior
    notes: a multi-arg call is one write; println(char) prints UTF-8; a
    user type without @display is a clean compile error.
  • io.read_line[R Read] — one line over the Read protocol (up to and
    including the first \n, consumed but not included; Ok("") = EOF).
    Byte-wise reads keep the documented fill-semantics of read_in intact
    (line input works against the fill-only stdio primitive).

The compiler

  • Item 126 (both doors + remainder): a bare-None if-branch unifies
    with the other branch's Option[X] — in the checker's join, in the
    value emitter, and (the remainder) in the storage probe: one shared
    decision pipeline where hand-maintained copies had diverged twice.
  • Compiler and runtime fixes cover fluent assign-back (16), Atomic-in-value-record closure
    evidenced: fluent assign-back (16), Atomic-in-value-record closure
    evidence (17, D447), consume bindings without C preprocessor macros
    (18), the stdout drain past 4 KB (20), nested module resolution (25).
  • Item 49 (resolution half): a call the checker resolved to a concrete
    fn no longer gets hijacked into a foreign same-named generic's mono arm.
  • Module-local name preference for bare variant names when several
    sums declare them (the keystone of the 49/29 family).

Latent compiler defects

The Io wave put std.io into every compile unit, stress-testing the
single-CU name machinery. Seven latent defects (any program importing
std.io alongside same-named types could have hit them since 0.1.0):

  1. A match arm's inner variant tag resolved first-wins by import
    order
    — a same-named variant in another sum silently won (toml's
    ParseTomlError.UnexpectedEof vs io's ErrorKind.UnexpectedEof).
    Fixed: the operand's/scrutinee's declared type is authoritative
    (together with defect 7 below).

  2. A foreign function's local of a common name (base) clobbered the
    flat CU-wide type map
    — a user fn of that name emitted as an
    undeclared local read (n96).

  3. @field-hoisted snapshot locals emitted without a type when the
    declaring module wasn't emitted in the CU.

  4. A value-record named through an Option/Result typedef had no struct
    definition
    in the C (field has incomplete type).

  5. The same for an erased generic base used by value in a method stub.

  6. @/@field outside any method silently compiled into an
    undeclared nova_self and now reports E_SELF_OUTSIDE_METHOD.

  7. The fail(e) handler-literal param was bound as nova_str at any
    E
    while throw stores the typed pointer — the handler read a
    wrong-typed payload. Fixed by inheriting E from the with header,
    plus an operand-first is operator.

Also in this tag (between 0.1.2 and 0.1.3)

  • Carina development tooling adds oracle-free CI, measures compatibility
    against the examples corpus, and reports language drift from the pinned
    bootstrap seed.

  • Native-build tooling and test harness reliability improvements for Carina.

Fixes carried forward from Oracle 0.1.2

Highlights — what got fixed

Checker and codegen

  • Indexing the result of str.split(sep) is a clear checker error now
    (item 42): the checker silently accepted parts[0] and the code generator
    died with an INTERNAL-PANIC pointing into generated C. Per D238/D249 a lazy
    iterator declares no @index; the new [E_NO_INDEX_IMPL] names the
    iteration form (for part in text.split(sep)).
  • A generic sum with mixed-payload variants compiles (item 8,
    Output[I] enum Send(I) | Log(str)): both constructor doors route to the
    monomorphized instance instead of a never-defined static dispatcher and a
    void*-boxed payload.
  • Turbofish record construction gets an actionable error (item 54):
    [E_GENERIC_TURBOFISH_LIT] names the canonical bare form (D55
    construction), which compiles and runs already.
  • Option-bound generic inference desanitizes the pointer id: inferring S solely from a protocol method
    product's workaround-mark sweep): inferring S solely from a protocol method
    returning Option[S] bound a mangled Nova_ChatState_p into every S
    position — broken C, and a cross-file infection through the test-unit
    inlining channel. Turbofish-less chat-form generics now infer like their
    alula counterparts.
  • A detach consume binding survives across match arms: the fiber body's
    unconditional var_types removal killed the
    parent entry after the first arm; the second arm's capture came out empty
    (use of undeclared identifier). Scoped save/restore, gated to fiber
    bodies.
  • Chan[Option/Result/record] code-generates: two nested-mono
    doors — the dependency edge trimmed a _p that was part of a node name,
    and pointer-field payloads needed forward typedefs in their own instance.

Runtime (item 19, the pipe hangs)

  • Root 2 fixed — a parked pipe fiber is always freed: the orphan-drain
    cancel is now periodic, and the cancel walk adds an idempotent direct
    wake. The next cancel tick recovers a missed wake.

  • The remaining lost-wake window has a diagnostic trace
    (NOVA_DIAG_ITEM19_R3=1, off by default). Periodic cancellation lets the
    process exit if the window is hit.

Fixes carried forward from Oracle 0.1.1

Highlights — what got fixed

Silent miscompilations (the worst class)

  • A bare record-variant constructor whose name is also a type name
    (Ok(Message { ... }) where another package declares a Message sum)
    was typed as the unrelated type — the PostgreSQL driver and Polaris
    could not be linked into one program (spike item 30). The literal now
    keeps its own sum; a record (or alias-to-record) of the same name keeps
    the record reading.
  • A qualified variant pattern/literal Sum.Variant { ... } beside a
    same-named record
    was judged by the last segment: no tag check, fields
    read straight off the sum struct, nova_int binders (item 48). The
    owner sum decides; a bare pattern resolves against the scrutinee's own
    sum first (the N279 discipline).
  • A nested generic pattern Some(Answer(reply)) bound reply to NULL
    — the check passed, the program printed garbage (item 10): the mono
    payload type was not registered for variant sub-patterns. It is now.
  • Record-pattern match bindings were untyped, so an import std.text
    in a neighbour module hijacked a variable named text in another module
    (item 32) — and, as a side effect of this fix, a latent cross-module
    read of Duration's private nanos field in std/concurrency/retry
    surfaced and was corrected to the public @compare/@max.

Checker and parser

  • Protocol-bound generic inference reaches let bindings (items 12/13):
    ro r = run_once(...) over M Machine[S, B] no longer loses the local's
    type — 28 explicit-turbofish workarounds in the product become
    unnecessary. Cases with no inference anchor still require turbofish
    (deliberately unchanged).
  • for x in [literal, ...] over enum variants, record constructors
    and nested arrays now compiles (items 33/36/52, one root cause).
  • A record literal inside brackets of a match scrutinee parses
    again, and if cond { a } else { b } as a call argument still does
    (item 51).
  • A module in a second-level folder may declare its full package path
    again (item 25): declaration and import paths finally agree.
  • leak_ab: a peer test-file's a/b parameters no longer leak into
    the prelude's member fast-path when a file is embedded (item 47).

Standard library and runtime

  • fs.create_dir_all on the in-memory test FS now creates every parent
    level
    (mock_fs parity with the real FS, item 55); a bare create_dir
    under a missing parent is NotFound, like the real FS.

  • SHA-256 no longer rebuilds its round-constant table on every round:
    a PBKDF2/SCRAM login on a debug (-O0) build drops by 15-40% (item 57);
    digests are unchanged.

  • A pipe-callback race is closed (item 19, root 1 of 3): the
    operation registration is cleared before the done-store, so a late NULL
    store can no longer erase the next operation's registration and park a
    fiber forever.

  • NOVA_WORKSPACE_ROOT sets the workspace root for the Carina build path.

Known limitations

  • Oracle remains alpha. The API is not frozen, and garbage collection is stop-the-world.
  • The rare pipe wake-loss window (item 19, root 3) is still tracked.

Downloads

  • Windows x86_64: extract the ZIP and dot-source setup-env.ps1 in PowerShell. The ZIP includes the runtime and Boehm GC headers and libraries.
  • Linux x86_64: extract the tarball and run source setup-env.sh in Bash. Install a C toolchain, CMake, Make and the Boehm GC development package (libgc-dev on Debian and Ubuntu).
  • The source tarball and SHA256SUMS are attached to this release.