Zest:一种用于构建灵活易读系统的编程语言
Zest: a programming language for malleable and legible systems

原始链接: https://github.com/jamii/zest

Zest 是一款正在开发中的编程语言,旨在结合 Emacs 等环境的交互性和实时性,以及静态类型、早期绑定和加载顺序独立性的优势。它从 Eve 和 Imp 等研究原型中汲取灵感,同时保持熟悉的命令式语言结构。 主要特性包括基本的控制流、算术运算、比较运算和函数。但是,目前缺少 break/continue/return 语句、互递归函数和完整的别名防止机制。类型系统、专门化和编译时计算功能可用,但需要改进人机工程学设计。 Zest 支持解释型代码和编译型代码,但不能同时使用。解释型代码存在内存泄漏问题,而编译型代码则将所有内容都分配到栈上。堆分配和内存管理尚未实现。错误处理仅限于 panic。 文档中包含嵌入式测试,展示了预期行为和当前行为,并区分了“宽松”和“严格”两种方言。实现仍在积极开发中,文档中描述的意图与测试结果之间可能存在差异。

Hacker News 上出现了一种名为 Zest 的新编程语言,引发了人们的兴趣。该语言由 Droplet、Eve 和 Imp 等实验性语言的作者创建,旨在在其交互模型上进行改进,Eve 使用 Datalog 追踪数据来源,而 Zest 则采用更熟悉的命令式风格。一位评论者指出,Eve 的交互功能是由其 Datalog 设计实现的,并质疑 Zest 如何在保持“大部分熟悉”的命令式方法的同时复制这种功能。他们想知道 Zest 为实现这些交互所做的权衡,以及它是否会成为一个更易于上手的 Eve 版本,具有更低的“奇怪程度预算”和更低的学习曲线。该项目被描述为有趣且值得关注的项目。
相关文章
  • Gleam:Erlang VM 上的类型安全语言 2023-11-09
  • (评论) 2025-03-14
  • (评论) 2024-01-17
  • (评论) 2024-09-15
  • (评论) 2024-09-23

  • 原文

    Zest is a (very wip) programming language for building systems that are both malleable and legible.

    The goal is to:

    • Support the interactivity and liveness of systems like emacs without giving up on civilized luxuries like static typing, early binding, jump-to-definition, load-order independence etc.
    • Support the kinds of interactions I explored in research prototypes like eve and imp but from the well-trodden ground of a mostly-familiar imperative language.

    A good place to start reading is docs/rationale.md. You can also find more notes at scattered-thoughts.net/#zest.

    • Basic control flow, arithmetic, comparisons, functions etc work.
      • Break/continue/return are missing
      • Mutually recursive functions are not supported yet (the interaction with staging is tricky, see #1).
    • There are 2nd-class mutable references, but dynamic/static prevention of aliasing is incomplete.
    • The type system, specialization, and compile-time evaluation more or less work, but the ergonomics could be improved.
    • Code can either be interpreted or compiled, but there is no support yet for mixing both within a single program.
    • Interpreted code leaks memory. Compiled code stack-allocates everything (which is safe because type-system prevents references escaping). There is no heap allocation and no memory management yet. The allocator exists in /lib/runtime.zest but hooking it up to the language requires solving #1 first.
    • The only error-handling available is panic.

    The docs contain embedded tests that look like this:

    // code
    1 + 1
    
    // result
    2
    

    When the lax and strict dialects produce different results, there will be two results in the test:

    // 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 }
    

    The strict dialect doesn't currently have a way to print values from inside the wasm sandbox, so any test that returns a non-integer value will only print undefined in the strict dialect.

    The implementation is in flux. Generally, the docs text will describe the intended behaviour, but the tests will show the current behaviour. The tests can be automatically updated with zig run lib/test.zig -- --rewrite docs/*.md.

    联系我们 contact @ memedata.com