Phase 12 TypeBox統合ABI設計完了: C ABI + Nyash ABI革命的統合

主な成果:
- TypeBox(型情報をBoxとして扱う)による統合ABI設計
- C ABI + Nyash ABIの完全統合仕様書作成
- 3大AI専門家(Gemini/Codex/ChatGPT5)による検証済み
- ChatGPT5の10個の安全性改善提案を反映
- README.mdのドキュメント更新(全起点から到達可能)

MapBox拡張:
- string型キーサポート(従来のi64に加えて)
- remove/clear/getOr/keysStr/valuesStr/toJson実装
- keys()/values()のランタイムシムサポート(TypeBox待ち)

その他の改善:
- Phase 11.9(文法統一化)ドキュメント追加
- Phase 16(FoldLang)ドキュメント追加
- 非同期タイムアウトテスト追加
- 各種ビルド警告(未使用import等)は次のリファクタリングで対応予定

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-09-02 09:26:09 +09:00
parent da96bcb906
commit de99b40bee
40 changed files with 4017 additions and 1014 deletions

View File

@ -0,0 +1,13 @@
// Async await timeout smoke (fixed API)
// Expects await to time out and return Result.Err("Timeout")
// @env NYASH_AWAIT_MAX_MS=100
static box Main {
main() {
fut = env.future.delay(500)
res = await fut
print(res.toString())
return res
}
}

View File

@ -0,0 +1,11 @@
// MapBox int-key support smoke
static box Main {
main() {
local m = new MapBox()
m.set(1, 42)
local v = m.get(1)
if v == 42 { return 0 }
return 1
}
}

View File

@ -0,0 +1,12 @@
// MapBox toJson smoke (int values only in current impl)
static box Main {
main() {
local m = new MapBox()
m.setS("x", 1)
m.setS("y", 2)
local js = m.toJson()
if js.length() == 0 { return 1 }
return 0
}
}

View File

@ -0,0 +1,39 @@
// MapBox extended ops smoke: remove/clear/keysStr/getOr and string keys
static box Main {
init { console }
main() {
me.console = new ConsoleBox()
local m = new MapBox()
// int keys
m.set(1, 10)
m.set(2, 20)
// string keys via typed helpers
m.setS("alpha", 100)
m.setS("beta", 200)
// getOr for missing keys
local gx = m.getOr("missing", 7)
if gx != 7 { return 1 }
// remove existing
local r1 = m.remove("alpha")
// remove non-existing
local r2 = m.remove("zzz")
if r1 != true { return 2 }
if r2 != false { return 3 }
// keysStr contains beta and not alpha
local ks = m.keysStr()
// naive contains check using StringBox concat/length
// we leverage toString and simple equality by building markers
me.console.log(ks)
// Simple heuristic: ensure size > 0
if ks.length() == 0 { return 4 }
// clear
m.clear()
if m.size() != 0 { return 5 }
return 0
}
}

View File

@ -0,0 +1,15 @@
// MapBox string-key support smoke
static box Main {
main() {
local m = new MapBox()
m.set("alpha", 1)
m.set("beta", 2)
local a = m.get("alpha")
local b = m.get("beta")
if a == 1 {
if b == 2 { return 0 }
}
return 1
}
}

View File

@ -0,0 +1,15 @@
// MapBox string-key (typed methods) support smoke
static box Main {
main() {
local m = new MapBox()
m.setS("alpha", 1)
m.setS("beta", 2)
local a = m.getS("alpha")
local b = m.getS("beta")
if a == 1 {
if b == 2 { return 0 }
}
return 1
}
}