Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rust Lightning Talk on Guru SP - May 2022

Rust Lightning Talk on Guru SP - May 2022

bezelga

May 31, 2022
Tweet

More Decks by bezelga

Other Decks in Technology

Transcript

  1. Holy Crab! 🦀 1. Preciso confessar que estou apaixonado 🥰

    2. Why Memory management in Rust is so cool 😎 3. Assinatura de métodos revelam muita coisa 4. Parsing JSON in a typed way
  2. @Kaia Health Internal Platform • CLI in Rust • Backend

    Ruby • Terraform, Kubernetes, Helm
  3. Memory management styles • Manually allocate / free memory (seg

    fault / double free) • Garbage Collector (Ruby, Python, Golang, Java, Erlang, c) • Ownership / Borrowing (Rust only as far as I know)
  4. Rust brings to language design and compile time the memory

    management By using Ownership and Borrowing
  5. Ownership Rules 1. Each value in Rust is owned by

    variable. 2. When the owner goes out of scope, the value will be deallocated. 3. There can be Only ONE owner at a time.
  6. This avoids double free in compile time 2. When the

    owner goes out of scope the value will deallocated
  7. 🤔 Como faz para passar uma variável para uma função

    e ainda continuar usando ela na main?