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

Zig handles this with lazy compilation: code is parsed, but not even type checked, until the compiler reaches it.

This can lead to the occasional rude surprise when finally reaching code I've been working on for awhile, but haven't yet connected to the rest of the project. But it means there's no need for tree shaking, because nothing gets in until it gets used. One of my favorite things about the language.



its such a useful technique. tiny binaries ftw!!




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

Search: