Swarnim Arun

@swarnimarun

Learning Rust: A Borrow At a Time

Submitted Mar 5, 2023

Learning Rust can be quite tedious, not knowing what to do when the borrow checker is complaining and how to structure your code around, feels like it is more pain than it’s worth sometimes.

Hence this talk is about stepping through some code examples, that may not work, and look at borrow checker complaints, and how to improve the code to calm it down. And possibly help build the intuition to understand what the borrow-checker truly wants from us.

We shall also discuss some code-related things in Rust that allow for escape from this mess(a discussion on understanding Cells and Send, Sync markers) and some examples where Rust’s borrow-checking saved my bacon in production code, where C++ would have left me hanging.


Swarnim Arun
Rust Engineer @ DeepSource


Prerequisites for the talk:

  • Basic understanding of Rust Language
  • Some familiarity with memory management(understanding of pointers)

slides @ swarnimarun.github.io/learning-rust
slides repo

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Hosted by

A community of rust-lang contributors and end-users from Bangalore. We also have presence on the following telegram channels https://t.me/RustIndia https://t.me/keralars https://t.me/fpncr Twitter handle: https://twitter.com/rustlangin more