Don't Forget to Flush by Andrew Kelley [video]

8 rene_d 1 8/11/2025, 5:23:30 PM youtube.com ↗

Comments (1)

ivanjermakov · 3h ago
I wonder how Zig will tackle ergonomics of parameter cluttering. I imagine most function signatures end up looking like so:

    fn foo(allocator: Allocator, io: IO, ...) !... {}
It's great in that it's explicit on what function is about to do (heap allocation and other i/o), but someone has to type all of that...

I think Odin went with implicit context system[1], making some state accessible across function boundaries, but it seems to be against Zig's philosophy on explicit control flow.

In practice it might end up being not a big deal, especially considering that both allocator and io can be shoved into struct's fields:

    fn foo(self: *Bar) !... {
        _ = self.allocator;
        _ = self.io;
    }
Props to Andrew for going against the grain and making unorthodox decisions - the only way to get out of the local minimum.

[1]: https://odin-lang.org/docs/overview/#implicit-context-system