News for hackers. Stuff that matters.
Re:Crabtime: Zig's Comptime in Rust by throwawaymaths on Saturday March 22, 2025 @02:14PM (#43447515)
in practice aside from interfaces the only thing you can't do at comptime is to generically attach declarations (member functions, consts) to a container type (the best you can do is to do it on a case by case basis).

you could probably cobble together an interface system with @comptimeError, but because of the time order of compilation stages, a failed method call will trigger the compiler error before your custom interface code, making it effectively useless for the 90% of cases you care about.

if I'm not mistaken in principle a small change to the compiler could amend this situation

There are no comments on this comment yet.