GC free and raw pointer free programming in Rust... and Nim.

GC free and raw pointer free programming in Rust... and Nim.

Andrew Francis

Just want to give some response on the article and initiative by Andreas Rumpf, author of Nim programming language, about memory safe and thread safe future of Nim.

I think that in #Rust ARC and RAII destructors techniques are more good at memory management, and with ownership & borrow checker through type system and special pointer types (boxing pointers in types of Rc и Arc traits) keep guaranties of memory integrity and keep thread safety.

So, nothing new! But GC free and raw pointer free programming are the good trends for Nim and other system languages!



&type, &mut type, &'a type, &'a mut type - borrowed pointer types and borrow for a pointer life-time


https://doc.rust-lang.org/book/references-and-borrowing.html


*const type, *mut type - raw pointers


https://doc.rust-lang.org/book/raw-pointers.html


This is the main pointer types in which other types are wrapped, i.e. boxed (boxing model).



https://doc.rust-lang.org/std/rc/struct.Rc.html - smart pointer type with ARC abilities (reference counted) for single-threaded code.


https://doc.rust-lang.org/std/sync/struct.Arc.html - tread-safe smart pointer type with ARC abilities (reference counted) for multi-threaded code.



By Andrew Francis for @Technologique channel


Report Page