Functional Programmers need to take a look at Zig

62 points by doyougnu


bitshift

This was a fun read—thank you for writing it!

Monads are not some kind of obscure math-y thing that only the big brains think are necessary. No, instead monads are a fundamental abstract algebraic description of imperative programming as a computational context.

With kindness, I have to say: my eyes glazed over for a second over that last sentence.

I do agree, though, that a lot of simple concepts are locked up behind complex language. The interesting thing about Zig's IO interface (and about your analogy!) is that it makes the concept much more legible. Before reading your post, the only thing I knew about monads was that they're monoids in the category of endofunctors—i.e., nothing. But now I have a new reference point: oh, they're kind of like Zig's IO interface! I know interfaces. I know passing dependencies into functions. This makes sense.