Zest:一种用于构建可塑和易读系统的编程语言
jamii/zest
main BranchesTags Go to file Code
Folders and files
Name| Name| Last commit message| Last commit date
---|---|---|---
Latest commit
History
580 Commits
build| build
docs| docs
honggfuzz-corpus| honggfuzz-corpus
lib| lib
.gitignore| .gitignore
fuzz-c.sh| fuzz-c.sh
fuzz.sh| fuzz.sh
license.txt| license.txt
readme.md| readme.md
shell.nix| shell.nix
test.html| test.html
test.js| test.js
test.sh| test.sh
test_web.js| test_web.js
View all files
Repository files navigation
Zest
是一种(仍在开发中)的编程语言,用于构建既具有可塑性又易于阅读的系统。
目标是:
- 支持像
emacs
这样的系统的交互性和活跃性,同时又不放弃诸如静态类型、早期绑定、跳转到定义、加载顺序独立性等文明的便利性。 - 支持我在诸如 eve 和 imp 这样的研究原型中探索的交互方式,但从一个大多数人熟悉的命令式语言的良好基础上出发。
一个好的开始阅读的地方是 docs/rationale.md。您还可以在 scattered-thoughts.net/#zest 找到更多笔记。
状态
- 基本的控制流、算术、比较、函数等都可以工作。
- 缺少
Break/continue/return
- 尚不支持相互递归函数(与 staging 的交互很棘手,请参见 #1)。
- 缺少
- 存在二级可变引用,但对别名的动态/静态防止尚不完整。
- 类型系统、 specialization 和编译时评估在很大程度上可以工作,但人机工程学可以改进。
- 代码可以被解释或编译,但尚不支持在单个程序中混合使用两者。
- 解释代码会泄漏内存。编译后的代码将所有内容都stack-allocates(这是安全的,因为类型系统可以防止引用逃逸)。目前还没有堆分配和内存管理。分配器存在于 /lib/runtime.zest 中,但将其连接到该语言需要首先解决 #1。
- 唯一可用的错误处理方式是
panic
。
文档和测试
docs 包含嵌入式测试,如下所示:
// code
1 + 1
// result
2
当 lax 和 strict dialects 产生不同的结果时,测试中将有两个结果:
// code
1 + 'foo'
// lax result
Cannot call zest.Builtin.add with these args: { 1, 'foo' }
// strict result
Cannot call zest.Builtin.add with these args: { i64, string }
strict dialect 目前无法从 wasm 沙箱内部打印值,因此任何返回非整数值的测试都只会在 strict dialect 中打印 undefined
。
'foo'
'foo'
undefined
该实现正在变化中。通常,docs 文本将描述预期行为,但测试将显示当前行为。可以使用 zig run lib/test.zig -- --rewrite docs/*.md
自动更新测试。
关于
没有提供描述、网站或主题。
资源
License
Stars
Watchers
Forks
Releases
No releases published
Sponsor this project
Sponsor Learn more about GitHub Sponsors
Packages 0
No packages published
Languages
- Zig 98.9%
- Other 1.1%