面對原始程式碼超越 3 千萬行規模的 Linux 核心 (2023 年),最令人感到挫折的,絕非缺乏程式註解,而是就算見到滿滿的註解,自己卻有如文盲,全然無從理解起。為什麼呢?往往是因為對作業系統的認知太侷限。
Linux 核心设计: 操作系统术语及概念
Crust of Rust: Iterators
In this third Crust of Rust video, we cover iterators and trait bounds, by re-implementing the “flatten” Iterator method from the standard library. As part of that, we cover some of the weirder trait bounds that are required, including what’s needed to extend the implementation to support backwards iteration.
你所不知道的 C 语言: linked list 和非连续记忆体
无论是操作系统核心、C 语言函数库内部、程序开发框架,到应用程序,都不难见到 linked list 的身影,包含多种针对性能和安全议题所做的 linked list 变形,又还要考虑应用程序的泛用性 (generic programming),是很好的进阶题材。
Crust of Rust: Declarative Macros
In this second Crust of Rust video, we cover declarative macros, macro_rules!, by re-implementing the vec! macro from the standard library. As part of that, we cover not only how to write these, but some of the gotchas and tricks you’ll run into, and some common use-cases.
Crust of Rust: Lifetime Annotations
We’re going to investigate a case where you need multiple explicit lifetime annotations. We explore why they are needed, and why we need more than one in this particular case. We also talk about some of the differences between the string types and introduce generics over a self-defined trait in the process.