#How does Zig’s safety features compare to Rust? Will Zig ever adopt a borrow checker?

1 messages · Page 1 of 1 (latest)

vestal prawn
#

will probably never implement a borrow checker in the language

#

What safety are you looking for

Memory safety I guess we have the slices index-out-of-bounds panics on debug/release-safe

clear berry
#

Probably not a borrow-checker though

vestal prawn
#

I have a few ideas

clear berry
#

👀

vestal prawn
#

I don't even like the borrow checker

clear berry
#

A borrow checker would be an interesting debug feature but I'm not sure I understand how it would work with Zig's semantics in general

vestal prawn
#

So getting in the question, Zig wants also to provide tooling to check this stuff

#

not integrated in the language itself, but letting people build on top of the toolchain

#

On top of what already the language have checks for

clear berry
#

Yeah, well put - the general approach has been to include ways to detect bad behavior when running the program, like ubsan, Valgrind, tracing integration, rather than intrusive language constructs

pliant marsh
#

I think something more akind to semantics of RefinedC as general solution would be more feasible, but composable proof code / annotations is still research.