Skip to content

Missing Features (v0.1 Gap Analysis)

This document lists features, modules, and behaviors described in the AIVI Language Specification vs. the v0.1 Rust Implementation.

Note to Users: AIVI v0.1 is primarily an interpreted language embedding a CST-to-Kernel pipeline. Native Rust code generation exists as an experimental backend that emits standalone Rust logic for a limited subset of AIVI (see Native Codegen below). The interpreter remains the most complete backend today.

1. Syntax & Language Features

FeatureSpec SectionImplementation StatusNotes
GeneratorsGeneratorsImplementedDesugared to Church-encoded lambdas in kernel.rs. generate blocks supported. loop/recurse inside generators partial.
DecoratorsDecoratorsImplemented (Syntax)Parsed and validated; only standard decorators allowed.
User-defined DomainsDomains, Units, and DeltasImplementedDomainDecl exists in CST/HIR.
PatchingPatching RecordsImplementedPatch alias exists; desugaring logic present.
or fallbackEffects: or fallbackImplementedFallback-only sugar for Effect (after <- in effect {}) and Result (expression form).

2. Type System

FeatureSpec SectionStatusNotes
Higher-Kinded TypesThe Type SystemStructurally ImplementedKind enum (Star/Arrow) and builtins (List: *->*, Effect: *->*->*) exist in checker.rs. Complex inference scenarios may vary.
Row PolymorphismThe Type SystemImplementedOpen records and row extension/restriction logic present in checker.rs.
Effect TypingEffectsImplementedEffect E A is a first-class type; attempt/pure/fail are built-ins.

3. Standard Library Status

ModuleStatusBackend
aivi.regexImplementedBacked by runtime/builtins/regex.rs.
aivi.i18nImplemented (Minimal)Properties catalogs + key/message sigils + placeholder type checking. Placeholder rendering uses the runtime's default formatting (locale-neutral; no CLDR/ICU formatting in v0.1).
aivi.net.httpImplementedBacked by runtime/url_http.rs.
aivi.net.serverImplementedBacked by runtime/http.rs (using aivi_http_server).
aivi.dbPartialdatabase.rs exists in stdlib/runtime, likely SQLite wrapper.
aivi.mathImplementedExtensive math.rs in stdlib.

4. Tooling & Execution

ComponentStatusNotes
Native CodegenExperimental (Partial)aivi build can emit standalone Rust logic via [build].codegen = "native". Current limitations include incomplete builtins/stdlib coverage plus gaps in native runtime feature coverage (e.g. some index paths and raw expressions).
Package ManagerImplemented (Minimal)Cargo-backed search/install plus package/publish wrappers. Dependency installs validate [package.metadata.aivi] and enforce kind = "lib"; publishing validates aivi.tomlCargo.toml metadata consistency.
LSPImplementedaivi_lsp crate exists with diagnostics, formatting, and definition lookup.

Walkthrough: The v0.1 Reality

If you are using AIVI v0.1 today, you are using a high-integrity interpreter.

  1. The Code is the Truth: The crates/aivi/src/ directory contains the definition of the language.

    • syntax.rs / cst.rs define what you can write.
    • checker.rs defines a surprisingly capable type system (HKTs, Classes, Rows).
    • runtime/ implements the "magical" effects and IO.
  2. Performance:

    • Code is lowered to a Kernel IR and interpreted.
    • It is fast enough for scripting, servers (via Tokio integration), and tooling.
    • It is not yet generating optimized WASM for high-performance compute, though the type system allows expressing it.
  3. The "Rust" Target:

    • When you run aivi build, you get a Rust binary (via cargo).
    • With codegen = "embed", the binary contains your HIR program as JSON and runs it via the interpreter runtime.
    • With codegen = "native", the generated Rust corresponds to the AIVI logic directly (experimental; partial coverage).