Thread: Rust - Log


Showing posts 1-2 of 2 (oldest first)

#140 | 2026-06-16 15:23:16 UTC
0 replies
↑

/ We've had fast languages like C and C++, and then we've had safe languages like Lisp, Java, and Python. The safe languages were all slower. Common wisdom said that a programming language could either be fast or safe, but not both. Rust has thoroughly disproved this, with speeds rivaling C even when writing safe Rust. What's even more impressive is that Rust achieves safety and speed without using a garbage collector. Garbage collectors can be very useful, but they also tend to waste a lot of memory and/or create CPU spikes during GC collection. But more importantly, GC languages are difficult to embed in other environments. The big innovation leading to this "fast safety" is the borrow checker. ... The gist of it is: each piece of data has exactly one owner. You can either share the data or mutate it, but never both at the same time. That is, you can either have one single mutating reference to it, OR many non-mutating references to the data. / https://rerun.io/blog/why-rust

#141 | 2026-06-17 08:07:52 UTC
0 replies
↑

When you need some memory (to hold some data) you request it from the operating system (for example using the malloc function in C) and when you're done with it, you release it (for example using the free function in C). If you fail to release the memory, you end up with a memory leak. If you accidentally keep a reference to memory that has been released, you get a dangling pointer, which can be a security vulnerability. A garbage collector is a system that does all this for you. Whenever you create an object, the program automatically keeps track of all the references to that object. When the object is no longer referenced anywhere, it automatically releases it, freeing up its memory. This way, the user (mostly) doesn't need to handle any memory resources. Source: https://www.reddit.com/r/explainlikeimfive/comments/io535j/comment/g4bik87 NB: A garbage collector is part of the runtime implementation of the language, not part of the language itself.