Hi. I noticed something ...
An Allocator consists of a pointer and a vtable. The various allocators from std all have an allocator() method that returns an Allocator with pointers to the relevant context and functions. This allow other functions and structs to accept an Allocator as a parameter and field.
A Writer is a function (generic type) taking a comptime with a context type, error type, and write function pointer. The various things from std that can be written to implements a writer() method, but these must return a Writer(...), typically defined in the same scope. Therefore, functions that use a writer as parameter usually use writer: anytype, such that they can accept any writer. Moreover, it is not possible to store an arbitrary writer in a struct.
Why was the Writer (and Reader) designed this way? Why do they not use the same pattern as Allocators? This would allow them to be stored in a struct, make function signatures better, and help the lsp too.
