查看原文
其他

Zig 月报 202304

写代码的西瓜 EmacsTalk 2023-10-17

观点/教程

  • • When should I use an UNTAGGED Union?[1]: Loris 的文章,作者利用访问 untagged union 的未赋值字段是一种 safety-checked UB 的行为,来解决数组成员被重新赋值过的情况。

  • • Data driven polymorphism[2]: 作者用 Zig 来进行实现 Clojure 语言中的 defmulti[3],来实现『动态派发』的效果

  • • Testing and Files as Structs[4]: 作者演示了一个文件作为 struct 的效果,这样导入时就可以用 const Node = @import("Node.zig") 的方式了。

  • • Sneaky Error Payloads[5]: 一种在错误中携带上下文信息的方式,上一期的月报也有类似讨论。 Errors and Zig[6]

  • • Regular Expressions in Zig[7]: 由于 Zig 现在不支持 C 中的 bitfields,因此无法直接使用 Posix 的 regex.h ,这篇文章介绍了一种解决方法。

  • • Zig Build System[8]: 对 Zig build 系统的介绍

  • • Reasonable Bootstrap[9]: 探讨了编译器如何实现自举的方式

  • • Data Oriented Parallel Value Interner[10]: Matklad 探讨了如何实现一个高性能的 Interner

  • • TigerStyle! (Or How To Design Safer Systems in Less Time)[11]: Systems Distributed 23 视频。B 站链接[12]

  • • What Is a Database?[13]: Systems Distributed 23 视频,B 站链接[14]

项目/工具

  • • Coming Soon to a Zig Near You: HTTP Client[15]: 对标准库 std.http 的介绍。

  • • Zig Bits 0x3: Mastering project management in Zig[16]: 介绍了如何更好地维护一个 Zig 项目,包括:新增依赖、增加测试覆盖率、增加文档、基于 GitHub Action 做持续集成等。

  • • ityonemo/zigler[17]: zig nifs in elixir

  • • Ziggifying Kilo[18]: 使用 Zig 重写 kilo[19] 编辑器,目前仅能在 Linux 上运行

  • • jakubgiesler/VecZig[20]: Vector implementation in Zig

  • • b0bleet/zvisor[21]: Zvisor is an open-source hypervisor written in the Zig programming language, which provides a modern and efficient approach to systems programming.

Zig 语言更新[22]

引用链接

[1] When should I use an UNTAGGED Union?: https://zig.news/kristoff/when-should-i-use-an-untagged-union-56ek
[2] Data driven polymorphism: https://zig.news/rutenkolk/data-driven-polymorphism-45bk
[3] defmulti: https://clojuredocs.org/clojure.core/defmulti
[4] Testing and Files as Structs: https://zig.news/aryaelfren/testing-and-files-as-structs-n94
[5] Sneaky Error Payloads: https://zig.news/ityonemo/sneaky-error-payloads-1aka
[6] Errors and Zig: https://notes.eatonphil.com/errors-and-zig.html
[7] Regular Expressions in Zig: https://www.openmymind.net/Regular-Expressions-in-Zig/
[8] Zig Build System: https://en.liujiacai.net/2023/04/13/zig-build-system/
[9] Reasonable Bootstrap: https://matklad.github.io/2023/04/13/reasonable-bootstrap.html
[10] Data Oriented Parallel Value Interner: https://matklad.github.io/2023/04/23/data-oriented-parallel-value-interner.html
[11] TigerStyle! (Or How To Design Safer Systems in Less Time): https://www.youtube.com/watch?v=w3WYdYyjek4
[12] B 站链接: https://www.bilibili.com/video/BV1fm4y1C7XL
[13] What Is a Database?: https://www.youtube.com/watch?v=MqbVoSs0lXk
[14] B 站链接: https://www.bilibili.com/video/BV1gP41117zY/
[15] Coming Soon to a Zig Near You: HTTP Client: https://zig.news/nameless/coming-soon-to-a-zig-near-you-http-client-5b81
[16] Zig Bits 0x3: Mastering project management in Zig: https://blog.orhun.dev/zig-bits-03/
[17] ityonemo/zigler: https://github.com/ityonemo/zigler
[18] Ziggifying Kilo: https://bingcicle.github.io/posts/ziggifying-kilo.html
[19] kilo: https://github.com/antirez/kilo
[20] jakubgiesler/VecZig: https://github.com/jakubgiesler/VecZig
[21] b0bleet/zvisor: https://github.com/b0bleet/zvisor
[22] Zig 语言更新: https://github.com/ziglang/zig/pulls?page=1&q=+is%3Aclosed+is%3Apr+closed%3A2023-04-01..2023-05-01

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存