Memory Management Strategies

preview_player
Показать описание
In this video we go over various memory management strategies and how they relate to Rust.

#rust #rustlang #letsgetrusty
Рекомендации по теме
Комментарии
Автор

Realy clear and concise. I really enjoy your videos, thank you for doing them. Will you touch on the different heap management schemes in the context of a resource-constrained environment (deeply embedded systems)?

DavidCabanis
Автор

Definitely up for the C++ vs rust vid!
I remember you saying you were a web dev, and that you were drawn towards rust.. Just brutal that you, a web dev, are learning C++ [if you hadn't already] for comparing it with rust! 😬😂😅☠️

newtonchutney
Автор

Some people think RAII stands for "resource acquisition is initialisation". But it doesn't. It stands for "scope-based memory management". -Kate Gregory (paraphrased from memory)

MasterHigure
Автор

Good job overall, Bogdan. I'm not sure what you mean, though, when you say that Rust is not as error-free as GCed languages. Ignoring unsafe and JNI for the moment, in what sense is Rust less memory-safe? And of course in other ways Rust is LESS error-prone than Java, since it has no null pointers and no data races. Also, it is easier in Java to accidentally keep memory you are no longer using from being freed, since in Rust the memory can only be kept alive by one owner. But it sounds like I might be forgetting something?

I also wanted to mention that I get distracted when people say "ek cetera" instead of "et cetera"; perhaps a failing of mine, but I thought you might find the feedback useful since you are becoming a YouTube celebrity! :)

ClearerThanMud
Автор

Looking forward to the upcoming videos

Khushpich
Автор

Your content has helped me (and lots of others, I'm sure) so, so much. Thank you!

danielhadad
Автор

At 3:20, you mention "mostly error free", but what are you referring to? Without using unsafe code, I'm not aware of any way to get memory errors in Rust. So I think OBRM could be 100% error free: Imagine for example a language that does not provide the unsafe keyword, it would be free of any memory errors.

On the other hand, at 4:00 you mention that manual management is ruled out for Rust. I know that you were talking about something slightly different, but people might interpret this as if manual management is not possible with Rust. In reality, it is doable to write unsafe functions that don't use heap objects like String, Vec<T> and Box<T>, but instead use *mut T for all heap operations. This will be very similar to work with as it is working with C.

As for the possibility of having a real runtime garbage collector for Rust, I strongly suspect that this could be created as a crate without any language changes. However, that crate would have to provide re-implementations of all heap types like String, Vec<T> and Box<T> by implementing pass by reference under the hood, and it could operate garbage collection cycles on initialization and drop of its values.

upgradeplans
Автор

Nobody ever talks about the genius of Swift implementing automatic reference counting. Of course it also has it’s pros and cons, but it’s such a clever way of implementing automatic memory management.

adam-the-dev
Автор

I love how you explain everything man keep it up

desireanna
Автор

you make the crab happy
thx for this video a lot

ikazuchi-san
Автор

1:27, the most right seems to be etc instead of ect?😄 btw, nice video.

waterearth
Автор

The cons are that ... you put the car and the cdr together.

pierreabbat
Автор

So Rust's memory management is a bit like semi-automatic for the lack of a better wording, auto cleans the stack and leaves the heap to you as far as i understand. my question is, does that stack cleaning slows down the runtime even the slightest bit compared to the languages like C with no auto management at all?

erenmetesar
Автор

Clean, crisp and productive workflow thoughts. Two request.One is could you please include Swift in memory management segment.Second one is, could we expect a slightly longer version of RAII and rust with algorithms behind them.Anyway thanks again for the small yet informative video. 👍

saipan
Автор

This video felt too long. I would’ve liked to see examples rather than staring at a slide for 5 minutes

BenjaminWheeler