4 ms·
Section relevant to the title starts at 25:34.
by tbillington 3y ago
Section relevant to the title starts at 25:34.
- dindresto 3y agoAs direct link: https://signalsandthreads.com/future-of-programming/#2534 https://signalsandthreads.com/future-of-programming/#2534
- jt2190 3y ago> … [T]he notion of this sort of finer level of control is definitely accurate. But Rust gives up something really big to do what they do. They give up garbage collection. Within Jane Street and generally in programming, I think a lot of the time garbage collection is fantastic, right? It allows us to program without worrying about these low-level details that for most programs, we don’t need to. > So, for instance, when I’m writing the OCaml compiler—which is written in OCaml, of course—I do want it to be performant, but I don’t really care about microsecond latency. And so, I’m happy to write my compiler in a way that allocates a bunch of memory and then when it’s done with that memory, the garbage collector comes and gets rid of it. This is really, really convenient. In Rust, we don’t have that. In Rust, we are forced to think about memory, allocation, and deallocation at every point in time. And this gives us this fine level of control, but it comes at a real cost, and it means now we’re sort of fighting against this ‘pay-as-you-go principle’ that we were talking about earlier. In Rust, for memory, you don’t pay as you go. Everyone has to pay all the time for Rust fine memory control. So we wanna keep the high-level, garbage-collected OCaml for most applications, and then when we really want to have this fine level of control, we wanna have that, too. > And so, some of the work that we’re doing is around adding that finer level of control, but just where we need it. Link to 25:34: https://signalsandthreads.com/future-of-programming/#2534 https://signalsandthreads.com/future-of-programming/#2534
- oersted 3y agoThank you for copying this over, it really helps have a proper conversation about it. At least from this snippet, it sounds like the author hasn't used Rust much and they are mainly imagining what it would be like to use Rust. In my experience, you do not think about memory management in Rust at all, it is just deallocated when it goes out of context, it feels as automatic as garbage collection. You do need to be more mindful of ownership, but it feels very natural, if someone is not holding the potato it drops and gets destroyed (deallocated), it interacts well with our physical intuitions.
- pjmlp 3y agoUntil one tries to write a GUI or any kind of graphics application.
- kaba0 3y agoSince memory management is about determining when will a given memory region become no longer needed, thinking about ownership (and more importantly lifetimes) is for all practical purposes manual memory management.