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

Oops, sorry. I meant that macros are referentially opaque, and therefore strictly more expressive than comptime: https://news.ycombinator.com/item?id=26375027

> my criticisms of Zig's comptime could be levied at Rust's macros.

Except that comptime is nothing at all like macros, even though, as it turns out, it can replace enough of their use to make them unnecessary in low-level languages.

> I worry, perhaps unreasonably, that it's going to lead to fragmentation in the way generics are handled in various libraries, leading to headaches and incompatibilities.

But generics in Zig are just functions, and so the problem should be no better but no worse than any API. comptime is drastically less "crazy" or "weird" or hard to make compatible than macros, which Zig doesn't have at all.



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

Search: