News for hackers. Stuff that matters.
Re:I Believe Zig Has Function Colors by xigoi on Saturday April 09, 2022 @10:29AM (#30968346)
If a compiler assumes that a function is pure, while it's actually not pure, it may end up performing optimizations that break the logic, such as changing `x = f(); y = f()` into `x = f(); y = x`. And so might a human when refactoring.
Re:I Believe Zig Has Function Colors by simulate-me on Saturday April 09, 2022 @02:49PM (#30970830)
This illustrates my point perfectly. Theoretical refactoring or optimizations are just hypothetical situations that may or may not occur. Needing to proliferate a function color incurs a real cost in terms of development efficiency. You should get something concrete if you pay the price. Until that happens, such language features are unlikely to gain widespread popularity.