AtCoder with Rust RustCoder ―― Introduction to Competitive Programming with AtCoder and Rust

/villagepump/Rustlings

  • Interesting (blu3mo)

Rust Links Collection - Qiita

Rust Tour - Let’s go on an adventure!

  • As a starting point

  • let cannot be changed unless it’s mut

    • But can it be redeclared?
  • usize, isize

    • The index of an array is usize
  • There are arrays and slices, right?

    • Whether they are fixed-length or not
    • Arrays are like a version of tuples with n elements
  • No Null in Rust

  • If, match, functions, and blocks without ; at the end are used as return values. This is the best way to create concise logic that returns a value, which can be assigned to a new variable.

  • Memory space

  • Rust’s Error

    • do_something_that_might_fail(432)?
      • If an Error is returned, it becomes return Err(e)
    • If do_something_that_might_fail(432) is executed in main(), main will return with an error and exit
  • Vec

    • Similar to C++‘s vector
    • The vector struct holds a reference to Heap Memory
  • Macro

    • println! and vec! are macros, right?
  • Ownership in Rust

  • Lifetimes

    • I understand that it refers to the period from creation to dropping
    • However, I can’t quite grasp lifetime specifiers
      • I thought lifetimes were determined by the content of the program, but can they be set artificially? Is it okay to have contradictions?
    • The static lifetime, like static variables, lasts until the end of the program
  • Impressions

    • I quite like it
      • It feels clean
      • It seems to aim to do things with fewer essential elements, which is beautiful (?)
    • The constraints around ownership and writing asynchronous code seem difficult
  • Steps to Set Up a Local Rust Development Environment on macOS 2022 - Qiita