Featured image of post Stanford CS110L Notes 1

Stanford CS110L Notes 1

Stanford CS110L Notes intro | lec01 | lec02

Rust —— A language empowering everyone to build reliable and efficient software.

Intro

Official Course Website

CS 110L: Safety in Systems Programming

My Homework Repository

GitHub - UnicoCN/learn-rust

Lec01: Why Rust

  • Why not C/C++?
    • Security Issue
      • buffer overflow
      • integer overflow(signed → unsigned)
  • Why not GC’ed language?
    • downsides of GC
      • Expensive
      • Disruptive
      • Non-deterministic
      • Precludes manual optimization
    • can not solve memory leak completely

Lec02: Memory Safety

  • Why is it so easy to screw up in C?
    • Dangling Pointers
    • Double Frees
    • Iterator Invalidation
    • Memory Leaks
  • Ownership Rules
    • Each value in Rust has a variable that’s called its owner
    • There can only be one owner at a time
    • When the owner goes out of scope, the value will dropped
  • Lifetime

Written by Jiacheng Hu, at Zhejiang University, Hangzhou, China.

comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy