Skip to content

Solo stdlib Phase 2: Map/dict, JSON, date::today (untracked gaps) #45

@hyperpolymath

Description

@hyperpolymath

Solo dialect stdlib — Phase 2 (untracked gaps)

Tracker for the remaining Solo-dialect stdlib primitives needed by estate tooling.

Correction to stale notes: fs_write_file, fs_read_file, fs_create_dir_all, fs_exists, env_args, and format already landed (PR #10, merged 2026-05-04) and are registered in crates/my-lang/src/stdlib.rs (stdlib_functions(), lines ~1493-1580). They are not part of this tracker. In particular mkdir is already covered by fs_create_dir_all.

Verification method

Static source inspection of crates/my-lang/src/stdlib.rs (the authoritative builtin registry) plus crates/my-lang/src/interpreter.rs (Value enum, eval_field, eval_record). The interpreter could not be exercised on ad-hoc .my files in this environment (sandbox blocks running arbitrary interpreted programs), so gaps are confirmed by the absence of any registration for the named builtins and by the structural limits of Value::Record.

Verified-missing primitives

1. Map / dict type (HIGHEST LEVERAGE)

Value::Record(HashMap<String, Value>) exists, but it is only reachable through static, syntax-level field identifiers. eval_field (interpreter.rs:524) matches field: &Ident against record keys — there is no dynamic string-keyed get/set, no construction from computed keys, no key iteration, no membership test. Tooling needs string-keyed maps for config tables, lookup tables, and JSON-shaped data.

Missing builtins: map_new(), map_set(m, k, v), map_get(m, k), map_has(m, k), map_keys(m), map_remove(m, k), map_len(m).

Failing repro /tmp/t_map.my:

fn main() -> Int {
    let m = map_new();
    let m2 = map_set(m, "a", 1);
    let v = map_get(m2, "a");
    println(v);
    return 0;
}

Expected failure: map_new is an undefined identifier (not in stdlib_functions()); program cannot resolve the call.

2. JSON parse / serialize

No json_parse / json_stringify builtins registered. serde_json is a workspace dependency but only used by Rust tooling crates (my-cli, my-dap, my-test), never surfaced to Solo. Depends on (1) for a natural object representation.

Missing builtins: json_parse(s) -> Value, json_stringify(v) -> String.

Failing repro /tmp/t_json.my:

fn main() -> Int {
    let parsed = json_parse("{\"a\": 1}");
    println(parsed);
    let s = json_stringify(parsed);
    println(s);
    return 0;
}

Expected failure: json_parse undefined.

3. date::today / current date

No date builtins. time() returns a Unix timestamp float only — no calendar date. Tooling that stamps generated files (changelogs, scaffolds) needs a YYYY-MM-DD string.

Missing builtins: date_today() -> String (ISO YYYY-MM-DD), optionally date_now_iso8601().

Failing repro /tmp/t_date.my:

fn main() -> Int {
    let d = date_today();
    println(d);
    return 0;
}

Expected failure: date_today undefined.

Not a gap (verified present)

Decomposition

Implementable independently; suggested order Map -> JSON (JSON best represented atop Map) -> date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions