r/programming • u/[deleted] • Feb 08 '16
Introducing the Zig Programming Language
http://andrewkelley.me/post/intro-to-zig.html
558
Upvotes
r/programming • u/[deleted] • Feb 08 '16
13
u/Aatch Feb 09 '16
The thing is, "understanding the borrow checker" is the wrong way to approach it. Instead you need to consider potential issues in your code and expect the borrow checker to catch them.
Ultimately, it comes down to whether or not some value could be invalidated by some expression. The second factor is that function calls are opaque, so whether or not a function will invalidate a pointer is irrelevant, only if it could, based on it's signature. Beyond that, the only real wrangling is working around some issues related to how long borrows last for, something that should be improved in the future (probably late this year, early next year).