Rust (language)
- Static typed language
- Makes use of llvm
- Understand the borrow checker and you won’t fight rust
Borrow Checker
Rust doesn’t have a GC, it simply cleans up after itself. This is due to the borrow checker in Rust.
See this answer on SO.
Rust would know when the variable gets out of scope or its lifetime ends at compile time and thus insert the corresponding LLVM/assembly instructions to free the memory.
Any variable declared gets released outside it’s scope, unless it gets moved.
References:
- Rust’s Borrow Checker - https://doc.rust-lang.org/1.8.0/book/references-and-borrowing.html
Cateogory: [Tech]
Tags: [systems programming] [programming languages]