Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think a good compromise between a DI framework and having to pass everything individually would be some kind of Context object. It could be created to hold an Allocator, IO implementation, and maybe a Diagnostics struct since Zig doesn't like attaching additional information to errors. Then the whole Context struct or parts of it could be passed around as needed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: