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

> On the other hand this type of extreme customization means that even for somebody very familiar with the language you still have to be on your toes because innocuous looking code could behave surprisingly due to comptime shenanigans.

Could you give some concrete examples of this?



Only thing I can think of is something blowing up when cross-compiling to a different target because there's no code in the static if branch to handle that architecture (e.g. stdlib doesn't officially support WASI). But that's not really comptime's fault per se IMHO; you can break things in similar ways in golang, for example.

Unlike C, zig's comptime doesn't have grammar altering abilities




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

Search: