Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
zig
General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I love these sorts of resources! I just created an "awesome list" [1] to keep track of resources specifically centered around learning by example. I've only got a few so far, several of them being from this thread. Contributions welcome!
[1]: https://github.com/b0o/awesome-by-example
This a simplified example to say that each path that depends on a comptime condition, such as the target OS, for example, feels intuitively consistent but in Zig types can (and do) mutate depending on those conditions and if the compiler were to eagerly check dead branches it would find plenty of semantical errors. In the stdlib you can see how `os` corresponds to a different struct definition depending on the target: https://github.com/ziglang/zig/blob/master/lib/std/os.zig#L5...
A few folks are working on gameboy emulators: https://github.com/nrdmn/awesome-zig#emulators
Zig is still "not production ready," embedded is still rough, and you might have to contribute to Ziglang itself to get any particular architecture working appropriately. That said, yes people are using Zig a little for embedded stuff:
https://codelv.com/blog/2020/5/using-zig-and-the-stm32h7-to-...
https://www.mdeditor.tw/pl/2Ap9
Xtensa is less supported. M0 might also have some issues: https://github.com/Schroedingers-Hat/xtensa-zig
I've been meaning to try it out for embedded myself; I'll let you know how it goes.