https://github.com/superauguste/cursed-zig-errors
Global mutable comptime state in Zig with the global error set
https://github.com/superauguste/cursed-zig-errors
Last synced: 12 months ago
JSON representation
Global mutable comptime state in Zig with the global error set
- Host: GitHub
- URL: https://github.com/superauguste/cursed-zig-errors
- Owner: SuperAuguste
- License: mit
- Created: 2024-08-11T19:10:42.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-12T00:49:23.000Z (almost 2 years ago)
- Last Synced: 2025-06-13T02:57:16.029Z (12 months ago)
- Language: Zig
- Homepage:
- Size: 5.86 KB
- Stars: 24
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cursed Zig Errors
Using Zig's errors in ways you've never seen before to bring back our much beloved
global mutable comptime state. Runs on Zig `master`.
**Please don't actually use this code or code like it.**
A week or two of experience with Zig is probably required to understand this.
For your enjoyment, I recommend viewing in this order (from least to most cursed):
- `concepts.zig` (you can technically run `zig build concepts` but no output will appear)
- `zig build deduplicate` / `deduplicate.zig`
- `zig build type_id` / `type_id.zig`
- `zig build new_last_error` / `new_last_error.zig`
- `zig build counter_increment_only` / `counter_increment_only.zig`
- `zig build counter_complex` / `counter_complex.zig`
- `zig build mapper` / `mapper.zig`
Each example builds on previous examples.
## License
MIT