Skip to content

Rust runtime 迁移与 kvlang 类型/运行时重构 - #4

Merged
miaobyte merged 66 commits into
masterfrom
rust
Aug 16, 2026
Merged

miaobyte merged 66 commits into
masterfrom
rust

Conversation

@miaobyte

Copy link
Copy Markdown
Contributor

概览

rust 分支合并到 master:66 个提交,260 文件(+3900/-1680)。核心是把 kvlang 迁移到 Rust runtime,并完成类型系统与运行时的一系列重构。

主要变更

Rust runtime

  • 新增 Cargo 工程(Cargo.toml/Cargo.lock、build 配置、main.rs CLI 入口)
  • kvcpu/rwir/keytree/layout/vthread 等模块逐步补齐 Rust 实现(Go 与 Rust 双实现并存)

类型系统

  • stringbytecharbytechar/{utf32,utf8,ascii} 三编码 char 类型系统
  • 引入 kindexp(数组类型标注),写槽类型标注校验
  • parser 新增 num/any 类型类(多态签名)

数组

  • 移除分离数组 <>/a<i> 语法,统一 [] + array.* 命名空间算子(scatter/compact/append/slice)

rwir 运行时

  • 命名空间 /sys/rwir/rwir,移除 /sys op 命令队列与 rwir/dispatch
  • 新增 rwir/ext 扩展运行时框架(Ext/Op/Register/Serve/RunSeq/WriteFinalPC
  • terminal I/O 迁移 devicerwirext/term,移除终端发现层
  • math 基础算子(abs/min/max/sign)下沉 stdlib/math.kv

其他

  • stdlib 源码内置(go:embed .kv)+ lib 隐式 init()
  • random.uint64/int63/intn 内建,time.duration → time/duration 重命名
  • 新增 12-struct wip 教程,test.py 支持 # wip 跳过

验证

  • go build ./...go vet ./... 通过
  • tutorial 87 示例为主要回归手段

🤖 Generated with Claude Code

miaobyte and others added 30 commits August 11, 2026 07:38
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
miaobyte and others added 27 commits August 14, 2026 05:21
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@miaobyte
miaobyte merged commit 43f0cb4 into master Aug 16, 2026
1 of 4 checks passed
@miaobyte
miaobyte deleted the rust branch August 16, 2026 00:49
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