Skip to content

feat(lang): string_split/replace/slice, int/float_parse, bool_to_string, 7 map built-ins#66

Merged
escapeboy merged 1 commit into
masterfrom
post1/string-map-builtins
Apr 30, 2026
Merged

feat(lang): string_split/replace/slice, int/float_parse, bool_to_string, 7 map built-ins#66
escapeboy merged 1 commit into
masterfrom
post1/string-map-builtins

Conversation

@escapeboy
Copy link
Copy Markdown
Owner

Summary

  • Adds 13 new built-in operations continuing the __builtin_* pattern (opcodes 0x9A–0xA6)
  • String: string_split, string_replace, string_slice, int_parse, float_parse, bool_to_string
  • Map: map_get, map_set, map_remove, map_contains_key, map_keys, map_values, map_len
  • Value::Map is BTreeMap<String, Value> — all map keys are String, determinism guaranteed

Test plan

  • 21 new tests added in crates/llmvm/src/tests.rs
  • cargo test -p boruna-vm — 187 tests pass
  • cargo test -p boruna-compiler — all pass
  • cargo clippy --workspace -- -D warnings — clean

🤖 Generated with Claude Code

…ng, map built-ins

Adds 13 built-in operations continuing the __builtin_* pattern (opcodes 0x9A–0xA6):
StringSplit, StringReplace, StringSlice, IntParse, FloatParse, BoolToString,
MapGet, MapSet, MapRemove, MapContainsKey, MapKeys, MapValues, MapLen.
21 new VM tests added; all compiler + VM gates pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@escapeboy escapeboy merged commit 23d97a3 into master Apr 30, 2026
1 of 5 checks passed
@github-actions
Copy link
Copy Markdown

Bench compare

Threshold for regression: ≥ 10% slower mean.

Benchmark Mean change 99% CI
compile_crud_admin_template -2.99% [-3.31%, -2.75%]
compile_medium_program -2.41% [-2.75%, -2.19%]
compile_small_program -5.54% [-5.87%, -5.20%]
evidence_build_5_steps +0.32% [-2.33%, +2.31%]
evidence_build_empty -0.16% [-0.85%, +0.66%]
evidence_verify_10_steps +1.08% [-0.18%, +2.45%]
evidence_verify_5_steps +2.16% [-0.84%, +4.46%]
vm_call_dispatch_loop/iters=1000 +3.34% [+2.94%, +3.59%]
vm_call_dispatch_loop/iters=10000 +4.03% [+3.96%, +4.10%]
vm_pure_loop/iters=1000 -0.20% [-0.80%, +0.20%]
vm_pure_loop/iters=10000 -0.39% [-0.47%, -0.31%]
vm_pure_loop/iters=100000 +0.35% [+0.14%, +0.63%]
vm_record_loop/iters=1000 +4.77% [+4.65%, +4.88%]
vm_record_loop/iters=10000 +4.32% [+4.09%, +4.53%]

✅ No benchmark regressed past threshold.

@escapeboy escapeboy deleted the post1/string-map-builtins branch May 17, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant