by atemerev · 3y ago · 0 comments
Sorry, not interested. I can’t think in Rust. Tried many times. Things like dynamically updated graphs are nearly impossible to write in Rust, and concurrency is less than pleasant. Fighting the borrow checker is not my idea of a good time.
I don’t understand why everyone is so fascinated with Rust. I am like 3 times less productive there, and there is absolutely no pleasure for me in writing Rust code.
I’ll stick to Python and C++, thank you.
I'm a Rust connoisseur, but I'd agree with 'nearly impossible to write', which is why I'd (first of all) try to grab a library, assuming I'm doing anything complicated with graphs. If it's very simple and specific, I'd try to go through the list of possible graph representations (eg. adjacency lists), and pick a suitable one, but never store nodes directly, rather store indices (while the nodes are stored in some sort of vector).
Requires a bit of boilerplate in the beginning, but pays off when actually needing to work with your data.
Can you expand on this? I’ve taken only a cursory look on Rust and it’s not obvious to me what are the specific constraints that would cause this.
https://doc.rust-lang.org/book/ch15-04-rc.html
for things that are too dynamic for borrow checking.
Reference counting works great for the things it is good for but it does get into trouble with cycles and many of us would say that Java's memory allocator/garbage collector is worth what it costs.
My opinion is that automated memory management is a key concept for software reuse and if you look at the problems of the C/C++ world this is pivotal. That is, the range of memory management relationships you might want between a library and its client is pretty wide, I mean sometimes you want a library to make its own buffers, other times you want to hand it an existing buffer, if it is building graphy structures it needs to allocate stuff, do you really want it to use malloc? do you want to pass it your own malloc? etc.
The Java answer of providing a standard answer to allocation and garbage collection makes libraries composable with code in a way that Rust struggles with. (In the end rust libraries have to fall back to RC when complexity gets too high)
(and basically implementing your own cycle-aware garbage collector, which again is not my idea of a good time).