2024년 고려대학교 MatKor 스터디 - Rust 기초 프로그래밍 + 블로그 만들기

Overview

2024-MatKor-Rust-Blog

2024-MatKor-Rust-Blog is the material(lecture notes, examples and assignments) repository for learning Rust programming language and making a simple blog at Korea University Club 'MatKor' in 2024 Spring.

Contents

  • Week 0 (3/18) [Lecture]
    • Introduction
  • Week 1 (3/18) [Assignment] [Solution]
    • Hello, World
      • What is Rust?
      • Benefits of Rust
      • Playground
    • Types and Values
      • Hello, World
      • Variables
      • Values
      • Arithmetic
      • Type Inference
    • Control Flow Basics
      • if Expressions
      • Loops
      • break and continue
      • Blocks and Scopes
      • Functions
      • Macros
    • Tuples and Arrays
      • Arrays
      • Tuples
      • Array Iteration
      • Patterns and Destructuring
    • Assignment #1
  • Week 2 (3/25) [Assignment] [Solution]
    • References
      • Shared References
      • Exclusive References
      • Slices: &[T]
      • Strings
    • User-Defined Types
      • Named Structs
      • Tuple Structs
      • Enums
      • Static
      • Const
      • Type Aliases
    • Pattern Matching
      • Matching Values
      • Destructuring
      • Let Control Flow
    • Methods and Traits
      • Methods
      • Traits
      • Deriving
    • Assignment #2
  • Week 3 (4/1) [Assignment] [Solution]
    • Generics
      • Generic Functions
      • Generic Data Types
      • Generic Traits
      • impl Trait
    • Standard Library Types
      • Standard Library
      • Documentation
      • Option
      • Result
      • String
      • Vec
      • HashMap
    • Standard Library Traits
      • Comparisons
      • Operators
      • From and Into
      • Casting
      • Read and Write
      • Default, struct update syntax
      • Closures
    • Assignment #3
  • Week 4 (4/8) [Assignment] [Solution]
    • Memory Management
      • Review of Program Memory
      • Approaches to Memory Management
      • Onwership
      • Move Semantics
      • Clone
      • Copy Types
      • Drop
    • Smart Pointers
      • Box
      • Rc
      • Trait Objects
    • Borrowing
      • Borrowing a Value
      • Borrow Checking
      • Interior Mutability
    • Lifetimes
      • Lifetime Annotations
      • Lifetime Elision
      • Struct Lifetimes
    • Assignment #4
  • Week 5 (4/29) [Assignment] [Solution]
    • Iterators
      • Iterator
      • IntoIterator
      • FromIterator
    • Modules
      • Modules
      • Filesystem Hierarchy
      • Visibility
      • use, super, self
    • Testing
      • Test Modules
      • Other Types of Tests
      • Compiler Lints and Clippy
    • Error Handling
      • Panics
      • Try Operator
      • Try Conversions
      • Error Trait
      • thiserror and anyhow
    • Unsafe Rust
      • Unsafe
      • Dereferencing Raw Pointers
      • Mutable Static Variables
      • Unions
      • Unsafe Functions
      • Unsafe Traits
    • Assignment #5
  • Week 6 (5/13) [Lecture] [Assignment] [Solution]
    • Closures
      • Capturing Variables
        • Closures that Borrow
        • Closures that Steal
      • Function and Closure Types
      • Closure Performance
      • Closures and Safety
        • Closures that Kill
        • FnOnce
        • FnMut
        • Copy and Clone for Closures
      • Callbacks
      • Using Closures Effectively
    • Assignment #6
  • Week 7 (5/20) [Lecture] [Assignment] [Solution]
    • Macros
      • Macro Basics
        • Basics of Macro Expansion
        • Unintended Consequences
        • Repetition
      • Built-in Macros
      • Debugging Macros
      • Building the json! Macro
        • Fragment Types
        • Recursion in Macros
        • Using Traits with Macros
        • Scoping and Hygiene
        • Importing and Exporting Macros
      • Avoiding Syntax Errors During Matching
      • Beyond macro_rules!
    • Assignment #7
  • Week 8 (5/27) [Lecture] [Example] [Assignment] [Solution]
    • Concurrency, Part 1
      • Fork-Join Parallelism
        • spawn and join
        • Error Handling Across Threads
        • Sharing Immutable Data Across Threads
        • Rayon
      • Channels
        • Sending Values
        • Receiving Values
        • Running the Pipeline
        • Channel Features and Performance
        • Thread Safety: Send and Sync
        • Piping Almost Any Iterator to a Channel
        • Beyond Pipelines
    • Assignment #8
  • Week 9 (6/3) [Lecture] [Assignment] [Solution]
    • Concurrency, Part 2
      • Shared Mutable State
        • What Is a Mutex?
        • Mutex<T>
        • mut and Mutex
        • Why Mutexes Are Not Always a Good Idea
        • Deadlock
        • Poisoned Mutexes
        • Multiconsumer Channels Using Mutexes
        • Read/Write Locks (RwLock<T>)
        • Condition Variables (Condvar)
        • Atomics
        • Global Variables
    • Assignment #9
  • Week 10 (7/1) [Lecture] [Example]
    • Asynchronous Programming, Part 1
      • From Synchronous to Asynchronous
        • Futures
        • Async Functions and Await Expressions
        • Calling Async Functions from Synchronous Code: block_on
        • Spawning Async Tasks
        • Async Blocks
        • Building Async Functions from Async Blocks
        • Spawning Async Tasks on a Thread Pool
        • But Does Your Future Implement Send?
        • Long Running Computations: yield_now and spawn_blocking
        • Comparing Asynchronous Designs
        • A Real Asynchronous HTTP Client
    • Assignment #10
  • Week 11 (TBA)
    • Asynchronous Programming, Part 2
    • Assignment #11
  • Week 10 (TBA)
    • Foreign Function Interface (FFI)
    • Rust and WebAssembly
    • Assignment #12

References

How To Contribute

Contributions are always welcome, either reporting issues/bugs or forking the repository and then issuing pull requests when you have completed some additional coding that you feel will be beneficial to the main project. If you are interested in contributing in a more dedicated capacity, then please contact me.

Contact

You can contact me via e-mail (utilForever at gmail.com). I am always happy to answer questions or help with any issues you might have, and please be sure to share any additional work or your creations with me, I love seeing what other people are making.

License

The class is licensed under the MIT License:

Copyright © 2024 Chris Ohk.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You might also like...
Integra8 rust integration test framework Rust with a focus on productivity, extensibility, and speed.

integra8 Integra8 rust integration test framework Rust with a focus on productivity, extensibility, and speed. | This repo is in a "work in progress"

Neofetch but in Rust (rust-toml-fetch)
Neofetch but in Rust (rust-toml-fetch)

rtfetch Configuration Recompile each time you change the config file logo = "arch.logo" # in src/assets. info = [ "", "", "yellow{host_n

Rust Sandbox [code for 15 concepts of Rust language]

Rust-Programming-Tutorial Rust Sandbox [code for 15 concepts of Rust language]. The first time I've been introduced to Rust was on January 2022, you m

TypeRust - simple Rust playground where you can build or run your Rust code and share it with others

Rust playground Welcome to TypeRust! This is a simple Rust playground where you can build or run your Rust code and share it with others. There are a

Rust Imaging Library: A high-level Rust imaging crate.

ril Rust Imaging Library: A performant and high-level Rust imaging crate. Documentation • Crates.io • Discord What's this? This is a Rust crate design

In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang.
In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang.

Learn Rust What is this? In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang. This is usef

Game Boy Emulator written in Rust, as a way to fully grasp the Rust programming language

Flan's Game Boy Emulator Game Boy Emulator written in Rust, as a way to get hands-on with the Rust programming language, and creating a proper project

Code Examples in Rust. Reviewing RUST

There are some RUST example code here. Run like this cargo run --example enums cargo run --example iterator ... You can learn about RUST coding from

Rust implementation of Andrej Karpathy's micrograd for purposes of learning both ML and Rust.

micrograd_rs Rust implementation of Andrej Karpathy's micrograd for purposes of learning both ML and Rust. Main takeaways Basically the same takeaways

Owner
Chris Ohk
@microsoft MVP, @CppKorea Founder, @reinforcement-learning-kr Administrator, @RustFestEU Global 2021 Organizer
Chris Ohk
Simple autoclicker written in Rust, to learn the Rust language.

RClicker is an autoclicker written in Rust, written to learn more about the Rust programming language. RClicker was was written by me to learn more ab

null 7 Nov 15, 2022
Rust programs written entirely in Rust

mustang Programs written entirely in Rust Mustang is a system for building programs built entirely in Rust, meaning they do not depend on any part of

Dan Gohman 561 Dec 26, 2022
Rust 核心库和标准库的源码级中文翻译,可作为 IDE 工具的智能提示 (Rust core library and standard library translation. can be used as IntelliSense for IDE tools)

Rust 标准库中文版 这是翻译 Rust 库 的地方, 相关源代码来自于 https://github.com/rust-lang/rust。 如果您不会说英语,那么拥有使用中文的文档至关重要,即使您会说英语,使用母语也仍然能让您感到愉快。Rust 标准库是高质量的,不管是新手还是老手,都可以从中

wtklbm 493 Jan 4, 2023
A library for extracting #[no_mangle] pub extern "C" functions (https://docs.rust-embedded.org/book/interoperability/rust-with-c.html#no_mangle)

A library for extracting #[no_mangle] pub extern "C" functions In order to expose a function with C binary interface for interoperability with other p

Dmitrii - Demenev 0 Feb 17, 2022
clone of grep cli written in Rust. From Chapter 12 of the Rust Programming Language book

minigrep is a clone of the grep cli in rust Minigrep will find a query string in a file. To test it out, clone the project and run cargo run body poem

Raunak Singh 1 Dec 14, 2021
Rust-blog - Educational blog posts for Rust beginners

pretzelhammer's Rust blog ?? I write educational content for Rust beginners and Rust advanced beginners. My posts are listed below in reverse chronolo

kirill 5.2k Jan 1, 2023
The ray tracer challenge in rust - Repository to follow my development of "The Raytracer Challenge" book by Jamis Buck in the language Rust

The Ray Tracer Challenge This repository contains all the code written, while step by implementing Ray Tracer, based on the book "The Ray Tracer Chall

Jakob Westhoff 54 Dec 25, 2022
Learn-rust-the-hard-way - "Learn C The Hard Way" by Zed Shaw Converted to Rust

Learn Rust The Hard Way This is an implementation of Zed Shaw's Learn X The Hard Way for the Rust Programming Language. Installing Rust TODO: Instruct

Ryan Levick 309 Dec 8, 2022
Learn to write Rust procedural macros [Rust Latam conference, Montevideo Uruguay, March 2019]

Rust Latam: procedural macros workshop This repo contains a selection of projects designed to learn to write Rust procedural macros — Rust code that g

David Tolnay 2.5k Dec 29, 2022
The Rust Compiler Collection is a collection of compilers for various languages, written with The Rust Programming Language.

rcc The Rust Compiler Collection is a collection of compilers for various languages, written with The Rust Programming Language. Compilers Language Co

null 2 Jan 17, 2022