Skip to content


Choose a tag to compare
@z1h z1h released this 20 May 02:12

Z1h Programming Language Update Announcement

Dear Z1h Users,

We are pleased to announce a new update to the z1h programming language. This update enhances the functionality and ease of operation of the language. The main updates include:

  1. Implementation of Leading Argument in Method Calls: You can now invoke methods by leading the argument (e.g., (arg)foo), which acts the same as the traditional foo(arg), providing a more flexible syntax structure.

  2. Enhancements and Reimplementation of Operators:

  • The ^ operator has been reimplemented to allow execution without a left value and to preserve type during calculations.
  • The xor symbol has been extended to support multiple continuous xor operations.
  1. Introduction of pipeline_operator: Added the pipeline operator to enrich the capabilities of functional programming.

  2. Array Methods Expansion:

  • Added array.prototype.distinct method for array deduplication.
  • The array.prototype.toBucket method now supports returning the bucket content with the result, optimizing data processing workflows.
  1. Extended Parsing of Tilde Operators:
  • Implemented the tilde ~ for referencing the last line's execution result.
  • The double tilde ~~ refers to the last invoked method's execution result.
  • Added method binding with ~[number], enhancing code readability and flexibility.
  1. Syntax Parsing Adjustments:
  • When the dot symbol.field lacks an lvalue, the default lvalue becomes variable 'a', suitable for quickly declaring method bodies, such as ['aaa', 'bbb'].map{.repeat(3)}.
  • Adjusted the implementation of automatically adding parentheses with #, ##, ###, etc., optimizing syntactic consistency.
  1. Web REPL Enhancements:
  • Supported key shortcuts Ctrl+Newline and Shift+Ctrl+Newline for adding lines more conveniently.
  • Fixed minor bugs with code scrolling in Web REPL, improving the tool's stability and user experience.

PS: The updated syntax, syntax-sugar and built-in functions in this version have been tested for forward compatibility, so please feel free to use them

For more information, please visit our official website
We hope these updates will facilitate your programming work. Download the latest version to experience these new features!

Happy Coding!

z1h Development Team


  1. 方法调用参数前置支持: 现在可以通过前置参数来调用方法, 例如 (arg)foo,这与传统的 foo(arg) 调用方式效果相同,为编写代码提供了更灵活的语法结构。

  2. 操作符增强与重实现:

  • ^ 符号已经重新实现,现在它可以在没有左值的情况下运行,并且在计算时保留类型。
  • 对 xor 符号进行了扩展,支持多个连续的 xor 操作。
  1. 新实现的pipeline_operator:引入了pipeline操作符,进一步丰富了函数式编程的能力。

  2. 数组方法扩展:

  • 新增 array.prototype.distinct 方法,用于数组去重。
  • array.prototype.toBucket 方法现支持返回加入结果的bucket内容,优化了数据处理流程。
  1. 波浪号操作符的扩展解析:
  • 实现了波浪号 ~ 的功能,用于引用最后一行的执行结果。
  • 双波浪号 ~~ 用于引用最后一次调用的方法的执行结果。
  • 使用 ~[数字] 进行方法的bind操作,增加了代码的可读性和灵活性。
  1. 调整语法解析:
  • 当 .field 没有左值时,默认左值为变量 'a',适合快速声明方法体,如 ['aaa', 'bbb'].map{.repeat(3)}。
  • 调整了权重自动添加括号的 #、##、### 等符号的实现,优化了语法的一致性。
  1. Web REPL工具的增强:
  • 支持 Ctrl+换行符 和 Shift+Ctrl+换行符 快捷键,使新增加一行的操作更加便捷。
  • 解决了 Web REPL 上下翻代码时的小bug,提升了工具的稳定性和用户体验。

PS: 本次版本更新的语法、语法糖和内置函数等, 均经过了向前兼容的测试, 请放心使用. 由于语法层面调整较大, 所以将版本1.1.0升级到1.2.0