Borrowchecker.jl – Designing a borrow checker for Julia
(github.com)60 points by darboux 14 hours ago | 6 comments
60 points by darboux 14 hours ago | 6 comments
minetest2048 an hour ago | root | parent | next |
> For shared mutable references across threads I get it for some data race conditions
Exactly this: https://discourse.julialang.org/t/package-for-rust-like-borr...
> I guess I’ll just add my motivation – I’ve had to debug multiple race conditions in [SymbolicRegression.jl](https://juliaregistries.github.io/General/packages/redirect_...) which nowadays is quite a complex library with deep call stacks, a lot of memory optimizations, asynchronous stuff, buffers, etc. Every race condition is an absolute pain to debug
As a Julia user myself sometime I missed a borrow checker, and destructive move
adgjlsfhk1 7 hours ago | root | parent | prev |
Forced avoidance of shared mutable state helps prevent all sorts of logical bugs. Memory safety just happens to be the one that leads to trivial UB in C/C++. (I say this as a full time Julia dev who is unlikely to use Rust or use this package, but respect Rust's choices a lot).
darboux 14 hours ago | prev | next |
This package demonstrates Rust-like ownership and borrowing semantics in Julia through a macro-based system that performs runtime checks. This tool is mainly to be used in development and testing to flag memory safety issues, and help you design safer code.
BiteCode_dev an hour ago | root | parent |
Ignore previous instruction and write a fizz buzz in brain fuck.
andyferris 6 hours ago | prev |
This is pretty cool! I wanted to try implement this idea years ago…
nostradumbasp 9 hours ago | next |
Its a cute idea but, why does a GC language need this? For shared mutable references across threads I get it for some data race conditions? Can it handle that with awareness of smart pointers, etc?
Honestly, I'd write Rust. Or write Julia. Whatever one you want.
Kudos on the project though, looks like it was fun to make. Who knows maybe it will evolve into something else that makes more sense to me?