3 ms·
Whenever I work in Rust, I find myself having a good time mucking around with the abstractions, but not really getting anything done toward the proble
by shadowmint 11y ago
Whenever I work in Rust, I find myself having a good time mucking around
with the abstractions, but not really getting anything done toward the
problem I’m trying to solve.
I hear this a lot.
There's a lot of good stuff in rust, but people seem to get massively caught
up in making the borrow checker happy and lose sight of the actual task.
Maybe the idea of a drop in GC type for rust
(ie. https://github.com/Manishearth/rust-gc/ https://github.com/Manishearth/rust-gc/) has some merit after all...
- eddyb 11y agoA safe GC would be immutable by default, so you end up with a lot of Cells (or worse, RefCells) to emulate a mutable GC like JS or Go.
- Manishearth 11y agoPretty easy to do `type MyGc<T> = Gc<RefCell<T>>`. Even better, put trait objects everywhere. Now we're Java. Go sit in a corner and think about what you've done :P When designing rust-gc with mystor at one point I joked about writing a syntax extension that converts everything in a crate to a GCd, RefCelld, trait object, so that Java programmers have no problem converting.
- pcwalton 11y agoThe original post was talking about abstractions. The borrow check is not an abstraction.
- shadowmint 11y agoOk, sure: Making the borrow checker happy with their abstractions... You've seen iton #rust too, Im sure. People trying to make a genric reusable thread safe Foo and getting stuck with the borrow checker rather than making a specifc solution to a problem that uses unsafe or whatever and actually solves the problem. I know Ive seen it several times. Safe good code is better, but it's also a distraction in many problem domains.