News for hackers. Stuff that matters.
Re:Zig self hosted compiler is now capable of building itself by melony on Saturday April 16, 2022 @03:07PM (#31055138)
The problem is that when lifetimes cause you problems, it can force the entire feature development to stop until the problem is fixed. There is no reasonable escape hatch or alternative (clone doesn't always work).
Re:Zig self hosted compiler is now capable of building itself by klabb3 on Saturday April 16, 2022 @03:23PM (#31055273)
+1. My programming style normally consists of trial-and-error style prototyping for a couple of iterations, and then later refining that into something that's solid and robust. I find Rust's inofficial "prototyping mode" difficult to combine with it's regular "production grade mode" for practical purposes.
Re:Zig self hosted compiler is now capable of building itself by pornel on Monday April 18, 2022 @09:49PM (#31078999)
Rc/Arc is usually the escape hatch. I presume you put raw pointers under the "no reasonable" caveat, but if the borrow checker is wrong and you're right, they can be the right tool too. They're not unreasonable if the alternative was to use a different language that couldn't guarantee this safety either.

I know dealing with the borrow checker can feel like a dead-end sometimes, but dealing with it is something that you can learn. Things that it can't handle fall into a handful of common patterns (like self-referential structs). Once you learn what not to do, you can recognize and avoid the issues even before you write the code.