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

> Zig's comptime is what's known in formal languages to be referentially transparent (it basically means that you cannot distinguish between two otherwise identical objects that differ only in their reference name) while macros are not.

In general this is true, but it is possible to write a hygienic macro engine that is referentially transparent. Many (likely most) macro engines are indeed unhygienic though. I am not convinced that comptime is a better approach than a well designed hygienic macro system but it is an interesting research area.



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

Search: