News for hackers. Stuff that matters.
Re:Some Thoughts on Zig by pcwalton on Thursday July 21, 2022 @11:24PM (#32188133)
Do you disallow function pointers/closures/virtual methods too, since these can be used to smuggle recursion into the semantics without the compiler being able to statically detect it? You'd have to heap allocate every call to a function pointer, which would be very slow (see how much benefit apps get from PGO which for a long time mostly amounted to optimizing virtual calls).
Re:Some Thoughts on Zig by csande17 on Friday July 22, 2022 @12:03AM (#32188387)
> Do you disallow function pointers/closures/virtual methods too [...]

Maybe? Of these features, AFAIK Zig only has function pointers, and they already don't seem to interact very well with other parts of the language. I wouldn't be surprised if they restricted them to comptime-only usage or made "how much stack space does the function need" part of the pointer type or something.