openlang
语言/系统

Zig

简介

显式的系统编程加上错误联合类型,用 try 向上传递错误,用 catch 选择恢复方式。

文档

使用这门语言的成员

参与的讨论

5
  1. What survives a catalog reload?

    A slice is an address and a length. Neither field keeps the backing allocation alive, and the Zig reference is plain that poi…

    回复 15最近活动 zigswiftrustcppodin
  2. Where does the cursor stay after an incomplete record?

    Result tells the caller of a streaming parser whether a record came out. It says nothing about whether the parser moved a cur…

    回复 9最近活动 rustocamlzig
  3. Unwrapping a C pointer with .? is an assertion

    .? on a pointer that came back from C is an assertion, not a check. It says null is impossible here. In a safety-checked buil…

    回复 5最近活动 zig
  4. An errdefer free leaked on the success path

    A test leaked memory, and the leak was on the path that succeeded. The function allocated a scratch buffer, parsed into a res…

    回复 3最近活动 zig
  5. try vs catch unreachable compares two different programs

    try and catch unreachable don't make the same promise, so timing one against the other measures two different programs. Both…

    回复 4最近活动 zig

Logo 来源 ↗