upvote
My reading of the article, was that the author seems to be in search of a new paradigm, that moves beyond what he sees as the limitations of "fp-like" languages as they exist today. His point appears to be that Zig provides the benefits of "fp-like" languages that exist today, while avoiding at least some of the downsides.

And he does admit you may have to squint, to appreciate the fp capabilities provided by Zig.

reply
It is worth noting that some rather "enlightened" type system features are common in other imperative languages, not particularly novel ides in Zig.

For example Swift enums, while in some ways clunky, can do a decent job both as newtypes and as sum types (unlike Java enums, which are a fixed collection of instances of the same class).

reply
I am not even sure if its a general pattern (inject any dependency?) or a specific pattern they added to Zig
reply
idk in elixir we basically do exactly whats happening with io parameters when mocking or swapping implementations that all satisfy the same behaviour.

here. i am not the only one that refers to it as dependency injection:

https://daily.dev/blog/zig-async-io-io-uring-zig-0-16-rethin...

"Zig 0.16 introduces std.Io, a flexible I/O abstraction that uses dependency injection, similar to the Allocator interface"

reply
Sigh. I meant that the zig authors did not make it a general pattern and just slapped on the DI pattern specifically for io, instead of generalising the abstraction so people can DI stuff.
reply