从零复刻一切技术:build-your-own-x 教程清单全解析与分类学习路线

原创2026-09-29 10:12:393,901 阅读
文章标签:文档教程

从零复刻一切技术:build-your-own-x 教程清单全解析与分类学习路线

本指南围绕开源仓库 README.md 的核心内容展开:这是一份以费曼学习法为内核的"从零构建技术"教程汇编,覆盖数据库、区块链、操作系统、编程语言等 31 个技术分类、数百个由社区精选的动手实战教程。读完本文,你将掌握这份清单的完整分类体系与条目全貌,理解它的收录标准与学习方法论,并能据此规划一条属于自己的"手写一切技术"进阶路线。

这是一份什么样的清单:用"复刻"驱动真正的理解

仓库的定位在 README.md 开头一句话概括:"This repository is a compilation of well-written, step-by-step guides for re-creating our favorite technologies from scratch."(本仓库汇集了一批编写精良、循序渐进的手把手指南,教你从零复刻我们喜爱的各种技术。)

这句话背后是物理学家理查德·费曼的名言,也是整个仓库的灵魂:

What I cannot create, I do not understand — Richard Feynman. (我无法创造的东西,我就没有真正理解。)

正是基于"亲手重建才能触及本质"的信念,这份清单不收录框架使用指南、不收录"把几个库拼起来"的教程,只收录从零开始、不依赖现成框架的编程实战教程。对学习者而言,它是极好的入门路径——每一条目都能让你在动手复刻中理解一项技术的真实工作原理。

从仓库文件结构看,这是一个纯文档型项目,核心资产就是两处:

  • README.md:分类体系与全部教程条目(文章主体);
  • ISSUE_TEMPLATE.md:贡献教程时的提交流程与收录标准表单。

整个清单没有任何第三方依赖,浏览即可使用,无需安装运行。

如何使用这份清单:按分类定位,按语言筛选

清单的组织方式非常清晰:先按技术类别分区,再在每一类别下按编程语言排列教程。条目格式统一为 语言 : 教程标题,部分视频教程会额外标注 [video],PDF 教程标注 [pdf]。

  • 按分类浏览:从 3D 渲染到 Web 服务器,几乎覆盖主流计算机技术领域。想学哪块,直接跳到对应分类;
  • 按语言筛选:清单中 Python、JavaScript、C/C++、Go、Rust、Java 等语言均有覆盖,你可以顺着自己熟悉的语言纵向读完某条技术主线;
  • 以"复刻"为主线学习:每条教程都是一个完整的"从 0 到 1"项目,建议选一条主线分类(如 Database),从最小实现开始,逐步增加复杂度。

三十一个技术分类完整导览

以下按 README.md 中的实际分类逐一列出全部教程条目(标题保留原文,便于检索原文),并对每个分类补充主题解读。

构建你自己的 分布式系统

分类以单条高质量长文开篇:

  • Java:《Building Your Own Kafka-like System From Scratch: A Step-by-Step Guide》(从零构建类 Kafka 系统分步指南)

该分类教你在多节点、消息队列、日志复制的语境下,亲手搭建一个类 Kafka 的分布式系统,是理解"分布式中最难的部分"——共识与分区——的起点。

构建你自己的 3D 渲染器

计算机图形学从入门到进阶的完整路线,覆盖光线追踪、光栅化、软渲染与游戏引擎渲染:

  • C++:《Introduction to Ray Tracing: a Simple Method for Creating 3D Images》
  • C++:《How OpenGL works: software rendering in 500 lines of code》
  • C++:《Raycasting engine of Wolfenstein 3D》
  • C++:《Physically Based Rendering: From Theory To Implementation》
  • C++:《Ray Tracing in One Weekend》
  • C++:《Rasterization: a Practical Implementation》
  • C# / TypeScript / JavaScript:《Learning how to write a 3D soft engine from scratch in C#, TypeScript or JavaScript》
  • Java / JavaScript:《Build your own 3D renderer》
  • Java:《How to create your own simple 3D render engine in pure Java》
  • JavaScript / Pseudocode:《Computer Graphics from scratch》
  • Python:《A 3D Modeller》

从这条主线可以看出:渲染领域的两大流派——光线追踪(Ray Tracing)与光栅化(Rasterization)——都有手写教程,且同一主题常有多语言版本,方便对照学习。

构建你自己的 AI 模型

面向大模型时代的新兴分类,聚焦"从零训练/构建 AI 模型":

  • Python:《A Large Language Model (LLM)》(从零实现大语言模型)
  • Python:《Diffusion Models for Image Generation》(扩散模型图像生成)
  • Python:《RAG for Document Search》(基于 RAG 的文档检索)

三个条目恰好对应当下 AI 三大热门方向:LLM 预训练、扩散式图像生成、检索增强生成(RAG),且全部用 Python 实现。

构建你自己的 增强现实

以移动端 AR 开发为主:

  • C#:《How To: Augmented Reality App Tutorial for Beginners with Vuforia and Unity 3D》 [video]
  • C#:《How To Unity ARCore》 [video]
  • C#:《AR Portal Tutorial with Unity》 [video]
  • C#:《How to create a Dragon in Augmented Reality in Unity ARCore》 [video]
  • C#:《How to Augmented Reality AR Tutorial: ARKit Portal to the Upside Down》 [video]
  • Python:《Augmented Reality with Python and OpenCV》

可以看出该分类以 C#/Unity 视频教程为主,同时提供 Python + OpenCV 的纯代码路线。

构建你自己的 BitTorrent 客户端

P2P 协议与网络编程的经典练手项目:

  • C#:《Building a BitTorrent client from scratch in C#》
  • Go:《Building a BitTorrent client from the ground up in Go》
  • Nim:《Writing a Bencode Parser》
  • Node.js:《Write your own bittorrent client》
  • Python:《A BitTorrent client in Python 3.5》

其中 Bencode 解析器(Bencode Parser)是 BT 协议中元数据编码格式的最小切入点,适合作为第一步。

构建你自己的 区块链 / 加密货币

条目最丰富的分类之一,从纯函数区块链到 PoS 共识均有覆盖:

  • ATS:《Functional Blockchain》
  • Crystal:《Write your own blockchain and PoW algorithm using Crystal》
  • Go:《Building Blockchain in Go》
  • Go:《Code your own blockchain in less than 200 lines of Go》
  • Java:《Creating Your First Blockchain with Java》
  • JavaScript:《A cryptocurrency implementation in less than 1500 lines of code》
  • JavaScript:《Build your own Blockchain in JavaScript》
  • JavaScript:《Learn & Build a JavaScript Blockchain》
  • JavaScript:《Creating a blockchain with JavaScript》
  • JavaScript:《How To Launch Your Own Production-Ready Cryptocurrency》
  • JavaScript:《Writing a Blockchain in Node.js》
  • Kotlin:《Let's implement a cryptocurrency in Kotlin》
  • Python:《Learn Blockchains by Building One》
  • Python:《Build your own blockchain: a Python tutorial》
  • Python:《A Practical Introduction to Blockchain with Python》
  • Python:《Let's Build the Tiniest Blockchain》
  • Ruby:《Programming Blockchains Step-by-Step (Manuscripts Book Edition)》
  • Scala:《How to build a simple actor-based blockchain》
  • TypeScript:《Naivecoin: a tutorial for building a cryptocurrency》
  • TypeScript:《NaivecoinStake: a tutorial for building a cryptocurrency with the Proof of Stake consensus》
  • Rust:《Building A Blockchain in Rust & Substrate》

从这些条目可以梳理出一条完整主线:先实现一个最小区块链(区块结构 + 哈希链),再引入 PoW 工作量证明,最后升级到 PoS 权益证明(Naivecoin → NaivecoinStake 即是最典型的两步走)。

构建你自己的 机器人 (Bot)

覆盖聊天机器人、社交平台机器人到游戏 AI 机器人:

  • Haskell:《Roll your own IRC bot》
  • Node.js:《Creating a Simple Facebook Messenger AI Bot with API.ai in Node.js》
  • Node.js:《How to make a responsive telegram bot》
  • Node.js:《Create a Discord bot》
  • Node.js:《gifbot - Building a GitHub App》
  • Node.js:《Building A Simple AI Chatbot With Web Speech API And Node.js》
  • Python:《How to Build Your First Slack Bot with Python》
  • Python:《How to build a Slack Bot with Python using Slack Events API & Django under 20 minute》
  • Python:《Build a Reddit Bot》
  • Python:《How To Make A Reddit Bot》 [video]
  • Python:《How To Create a Telegram Bot Using Python》
  • Python:《Create a Twitter Bot in Python Using Tweepy》
  • Python:《Creating Reddit Bot with Python & PRAW》 [video]
  • R:《Build A Cryptocurrency Trading Bot with R》
  • Rust:《A bot for Starcraft in Rust, C or any other language》

构建你自己的 命令行工具

小而美的 CLI 项目,适合作为"复刻"入门:

  • Go:《Visualize your local git contributions with Go》
  • Go:《Build a command line app with Go: lolcat》
  • Go:《Building a cli command with Go: cowsay》
  • Go:《Go CLI tutorial: fortune clone》
  • Nim:《Writing a stow alternative to manage dotfiles》
  • Node.js:《Create a CLI tool in Javascript》
  • Rust:《Command line apps in Rust》
  • Rust:《Writing a Command Line Tool in Rust》
  • Zig:《Build Your Own CLI App in Zig from Scratch》

有趣的是,这一分类大量采用"复刻现有命令"的方式(lolcat、cowsay、fortune、stow),用几百行代码重现日常使用的工具,非常适合初学阶段建立成就感。

构建你自己的 数据库

从 KV 存储到 SQL 再到 Redis 系,覆盖存储引擎核心:

  • C:《Let's Build a Simple Database》
  • C++:《Build Your Own Redis from Scratch》
  • C#:《Build Your Own Database》
  • Clojure:《An Archaeology-Inspired Database》
  • Crystal:《Why you should build your own NoSQL Database》
  • Go:《Build Your Own Database from Scratch: From B+Tree To SQL in 3000 Lines》
  • Go:《Code a database in 45 steps: a series of test-driven small coding puzzles》
  • Go:《Build Your Own Redis from Scratch》
  • JavaScript:《Dagoba: an in-memory graph database》
  • Python:《DBDB: Dog Bed Database》
  • Python:《Write your own miniature Redis with Python》
  • Ruby:《Build your own fast, persistent KV store in Ruby》
  • Rust:《Build your own Redis client and server》

这一分类的关键词是 B+Tree、SQL、KV 持久化、Redis 协议(RESP)。推荐路径是:先做一个持久化 KV 存储(Ruby/Python),再进阶到 B+Tree + SQL(Go 的 3000 行实现),最后理解内存数据库与客户端/服务端协议。

构建你自己的 Docker

容器技术的"500 行实现"路线:

  • C:《Linux containers in 500 lines of code》
  • Go:《Build Your Own Container Using Less than 100 Lines of Go》
  • Go:《Building a container from scratch in Go》 [video]
  • Python:《A workshop on Linux containers: Rebuild Docker from Scratch》
  • Python:《A proof-of-concept imitation of Docker, written in 100% Python》
  • Shell:《Docker implemented in around 100 lines of bash》

容器本质上是 Linux 内核的命名空间(namespace)与 cgroup 的组合,这些教程普遍用 100~500 行代码揭示这一本质,是最能"祛魅"的一个分类。

构建你自己的 模拟器 / 虚拟机

从字节码解释器到 Game Boy 模拟器:

  • C:《Home-grown bytecode interpreters》
  • C:《Virtual machine in C》
  • C:《Write your Own Virtual Machine》
  • C:《Writing a Game Boy emulator, Cinoop》
  • C++:《How to write an emulator (CHIP-8 interpreter)》
  • C++:《Emulation tutorial (CHIP-8 interpreter)》
  • C++:《Emulation tutorial (GameBoy emulator)》
  • C++:《Emulation tutorial (Master System emulator)》
  • C++:《NES Emulator From Scratch》 [video]
  • Common Lisp:《CHIP-8 in Common Lisp》
  • JavaScript:《GameBoy Emulation in JavaScript》
  • Python:《Emulation Basics: Write your own Chip 8 Emulator/Interpreter》
  • Rust:《0dmg: Learning Rust by building a partial Game Boy emulator》

CHIP-8 是该分类公认的"入门第一站"——指令集极小、硬件简单,几乎每种语言都有对应教程;之后可升级到 Game Boy、NES 这类更复杂的平台。

构建你自己的 前端框架 / 库

手写 React、Redux、AngularJS 的经典路线:

  • JavaScript:《WTF is JSX (Let's Build a JSX Renderer)》
  • JavaScript:《A DIY guide to build your own React》
  • JavaScript:《Building React From Scratch》 [video]
  • JavaScript:《Gooact: React in 160 lines of JavaScript》
  • JavaScript:《Learn how React Reconciler package works by building your own lightweight React DOM》
  • JavaScript:《Build Yourself a Redux》
  • JavaScript:《Let's Write Redux!》
  • JavaScript:《Redux: Implementing Store from Scratch》 [video]
  • JavaScript:《Build Your own Simplified AngularJS in 200 Lines of JavaScript》
  • JavaScript:《Make Your Own AngularJS》
  • JavaScript:《How to write your own Virtual DOM》
  • JavaScript:《Building a frontend framework, from scratch, with components (templating, state, VDOM)》
  • JavaScript:《Build your own React》
  • JavaScript:《Building a Custom React Renderer》 [video]

核心知识模块非常明确:JSX 渲染 → Virtual DOM → React Reconciler → Redux 状态管理。从 160 行的 Gooact 到完整的"Build your own React",梯度合理。

构建你自己的 游戏

覆盖游戏引擎、具体游戏复刻与算法游戏:

  • C:《Handmade Hero》
  • C:《How to Program an NES game in C》
  • C:《Chess Engine In C》 [video]
  • C:《Let's Make: Dangerous Dave》 [video]
  • C:《Learn Video Game Programming in C》 [video]
  • C:《Coding A Sudoku Solver in C》 [video]
  • C:《Coding a Rogue/Nethack RPG in C》 [video]
  • C:《On Tetris and Reimplementation》
  • C++:《Breakout》
  • C++:《Beginning Game Programming v2.0》
  • C++:《Tetris tutorial in C++ platform independent focused in game logic for beginners》
  • C++:《Remaking Cavestory in C++》 [video]
  • C++:《Reconstructing Cave Story》 [video]
  • C++:《Space Invaders from Scratch》
  • C#:《Learn C# by Building a Simple RPG》
  • C#:《Creating a Roguelike Game in C#》
  • C#:《Build a C#/WPF RPG》
  • Go:《Games With Go》 [video]
  • Java:《Code a 2D Game Engine using Java - Full Course for Beginners》 [video]
  • Java:《3D Game Development with LWJGL 3》
  • JavaScript:《2D breakout game using Phaser》
  • JavaScript:《How to Make Flappy Bird in HTML5 With Phaser》
  • JavaScript:《Developing Games with React, Redux, and SVG》
  • JavaScript:《Build your own 8-Ball Pool game from scratch》 [video]
  • JavaScript:《How to Make Your First Roguelike》
  • JavaScript:《Think like a programmer: How to build Snake using only JavaScript, HTML & CSS》
  • Lua:《BYTEPATH》
  • Python:《Developing Games With PyGame》
  • Python:《Making Games with Python & Pygame》 [pdf]
  • Python:《Roguelike Tutorial Revised》
  • Ruby:《Developing Games With Ruby》
  • Ruby:《Ruby Snake》
  • Rust:《Adventures in Rust: A Basic 2D Game》
  • Rust:《Roguelike Tutorial in Rust + tcod》

一个值得注意的细节:清单刻意收录了 Tetris、Snake、Breakout、Space Invaders 这类"单文件可讲清"的经典游戏,也收录了 Handmade Hero、Cave Story 重构这类长线工程,难度跨度覆盖从新手到进阶。

构建你自己的 Git

深入版本控制内部实现:

  • Haskell:《Reimplementing "git clone" in Haskell from the bottom up》
  • JavaScript:《Gitlet》
  • JavaScript:《Build GIT - Learn GIT》
  • Python:《Just enough of a Git client to create a repo, commit, and push itself to GitHub》
  • Python:《Write yourself a Git!》
  • Python:《ugit: Learn Git Internals by Building Git Yourself》
  • Ruby:《Rebuilding Git in Ruby》

Git 内部由对象库(blob/tree/commit)、索引与引用机制构成,Python 路线的 Write yourself a Git!(wyag)和 ugit 是公认的两条成熟教程。

构建你自己的 内存分配器

小而深的一个分类:

  • C:《Malloc is not magic -- Implementing your own memory allocator》

亲手实现 malloc 是理解虚拟内存、堆管理与碎片整理的最直接方式。

构建你自己的 网络协议栈

从零写 TCP/IP:

  • C:《Beej's Guide to Network Programming》
  • C:《Let's code a TCP/IP stack》
  • C / Python:《Build your own VPN/Virtual Switch》
  • Ruby:《How to build a network stack in Ruby》

Let's code a TCP/IP stack 从以太网、ARP 一路写到 IP、TCP,是网络协议栈领域的标杆教程。

构建你自己的 神经网络

机器学习从神经元到深度学习框架:

  • C#:《Neural Network OCR》
  • F#:《Building Neural Networks in F#: Part 1》
  • F#:《Building Neural Networks in F#: Part 2》
  • Go:《Build a multilayer perceptron with Golang》
  • Go:《How to build a simple artificial neural network with Go》
  • Go:《Building a Neural Net from Scratch in Go》
  • JavaScript / Java:《Neural Networks - The Nature of Code》 [video]
  • JavaScript:《Neural networks from scratch for JavaScript linguists (Part1 — The Perceptron)》
  • Python:《A Neural Network in 11 lines of Python》
  • Python:《Build Deep Learning From Scratch (reimplement PyTorch internals across 34 stages)》
  • Python:《Implement a Neural Network from Scratch》
  • Python:《Optical Character Recognition (OCR)》
  • Python:《Traffic signs classification with a convolutional network》
  • Python:《Generate Music using LSTM Neural Network in Keras》
  • Python:《An Introduction to Convolutional Neural Networks》
  • Python:《Neural Networks: Zero to Hero》 [video]
  • Python:《SlowTorch: Implementation of PyTorch from the ground up in 100% pure Python》

从"11 行神经网络"到"34 个阶段重实现 PyTorch 内部机制"(Build Deep Learning From Scratch),该分类提供了一条从感知机到自动微分框架的完整爬坡路线。

构建你自己的 操作系统

可能是清单中最硬核的分类:

  • Assembly:《Writing a Tiny x86 Bootloader》
  • Assembly:《Baking Pi – Operating Systems Development》
  • C:《Building a software and hardware stack for a simple computer from scratch》 [video]
  • C:《Operating Systems: From 0 to 1》
  • C:《The little book about OS development》
  • C:《Roll your own toy UNIX-clone OS》
  • C:《Kernel 101 – Let's write a Kernel》
  • C:《Kernel 201 – Let's write a Kernel with keyboard and screen support》
  • C:《Build a minimal multi-tasking kernel for ARM from scratch》
  • C:《How to create an OS from scratch》
  • C:《Malloc tutorial》
  • C:《Hack the virtual memory》
  • C:《Learning operating system development using Linux kernel and Raspberry Pi》
  • C:《Operating systems development for Dummies》
  • C++:《Write your own Operating System》 [video]
  • C++:《Writing a Bootloader》
  • Rust:《Writing an OS in Rust》
  • Rust:《Add RISC-V Rust Operating System Tutorial》
  • (any):《Linux from scratch》

从 x86 引导扇区、内核 101/201,到 Writing an OS in Rust(用 Rust 从零写 OS 的经典连载)和 Linux from scratch(LFS,从源码构建完整 Linux),这条线完整覆盖引导、内核、虚拟内存、多任务与交叉编译。

构建你自己的 物理引擎

游戏物理与碰撞检测:

  • C:《Video Game Physics Tutorial》
  • C++:《Game physics series by Allen Chou》
  • C++:《How to Create a Custom Physics Engine》
  • C++:《3D Physics Engine Tutorial》 [video]
  • JavaScript:《How Physics Engines Work》
  • JavaScript:《Broad Phase Collision Detection Using Spatial Partitioning》
  • JavaScript:《Build a simple 2D physics engine for JavaScript games》

刚体动力学、宽相位碰撞检测(空间划分)是核心主题,JavaScript 教程适合快速跑通,C++ 系列则深入实现细节。

构建你自己的 处理器

  • Verilog:《From Blinker to RISC-V》

用硬件描述语言 Verilog,从点灯(Blinker)逐步实现一个可用的 RISC-V 处理器,是 CPU 领域最直接的"从零构建"路径。

构建你自己的 编程语言

条目最多的分类,覆盖解释器、编译器与 GC:

  • (any):《mal - Make a Lisp》
  • Assembly:《Jonesforth》
  • C:《Baby's First Garbage Collector》
  • C:《Build Your Own Lisp: Learn C and build your own programming language in 1000 lines of code》
  • C:《Writing a Simple Garbage Collector in C》
  • C:《C interpreter that interprets itself.》
  • C:《A C & x86 version of the "Let's Build a Compiler" by Jack Crenshaw》
  • C:《A journey explaining how to build a compiler from scratch》
  • C++:《Writing Your Own Toy Compiler Using Flex》
  • C++:《How to Create a Compiler》 [video]
  • C++:《Kaleidoscope: Implementing a Language with LLVM》
  • F#:《Understanding Parser Combinators》
  • Elixir:《Demystifying compilers by writing your own》 [video]
  • Go:《The Super Tiny Compiler》
  • Go:《Lexical Scanning in Go》 [video]
  • Haskell:《Let's Build a Compiler》
  • Haskell:《Write You a Haskell》
  • Haskell:《Write Yourself a Scheme in 48 Hours》
  • Haskell:《Write You A Scheme》
  • Java:《Crafting interpreters: A handbook for making programming languages》
  • Java:《Creating JVM Language》
  • JavaScript:《The Super Tiny Compiler》
  • JavaScript:《The Super Tiny Interpreter》
  • JavaScript:《Little Lisp interpreter》
  • JavaScript:《How to implement a programming language in JavaScript》
  • JavaScript:《Let's go write a Lisp》
  • OCaml:《Writing a C Compiler》
  • OCaml:《Writing a Lisp, the series》
  • Pascal:《Let's Build a Compiler》
  • Python:《A Python Interpreter Written in Python》
  • Python:《lisp.py: Make your own Lisp interpreter》
  • Python:《How to Write a Lisp Interpreter in Python》
  • Python:《Let's Build A Simple Interpreter》
  • Python:《Make Your Own Simple Interpreted Programming Language》 [video]
  • Python:《From Source Code To Machine Code: Build Your Own Compiler From Scratch》
  • Racket:《Beautiful Racket: How to make your own programming languages with Racket》
  • Ruby:《A Compiler From Scratch》
  • Ruby:《Markdown compiler from scratch in Ruby》
  • Rust:《Learning Parser Combinators With Rust》
  • Swift:《Building a LISP from scratch with Swift》
  • TypeScript:《Build your own WebAssembly Compiler》

入门顺序清晰:先用 Lisp 系(mal、Lispy、Little Lisp)理解 REPL 与求值器,再用 The Super Tiny Compiler 理解编译流水线(tokenize → parse → transform → generate),最后通过 Crafting Interpreters、Kaleidoscope(LLVM) 等系统化教程深入字节码与代码生成。

构建你自己的 正则表达式引擎

  • C:《A Regular Expression Matcher》
  • C:《Regular Expression Matching Can Be Simple And Fast》
  • Go:《How to build a regex engine from scratch》
  • JavaScript:《Build a Regex Engine in Less than 40 Lines of Code》
  • JavaScript:《How to implement regular expressions in functional javascript using derivatives》
  • JavaScript:《Implementing a Regular Expression Engine》
  • Perl:《How Regexes Work》
  • Python:《Build Your Own Regular Expression Engines: Backtracking, NFA, DFA》
  • Scala:《No Magic: Regular Expressions》

从递归回溯匹配器,到 NFA/DFA 自动机理论(Regular Expression Matching Can Be Simple And Fast 是 Russ Cox 的经典文),覆盖了正则引擎的两大技术路线。

构建你自己的 搜索引擎

  • CSS:《A search engine in CSS》
  • Python:《Building a search engine using Redis and redis-py》
  • Python:《Building a Vector Space Indexing Engine in Python》
  • Python:《Building A Python-Based Search Engine》 [video]
  • Python:《Making text search learn from feedback》
  • Python:《Finding Important Words in Text Using TF-IDF》

从 TF-IDF 权重、向量空间索引(Vector Space Indexing)到基于 Redis 的检索实现,覆盖经典信息检索的核心算法。

构建你自己的 Shell

  • C:《Tutorial - Write a Shell in C》
  • C:《Let's build a shell!》
  • C:《Writing a UNIX Shell》
  • C:《Build Your Own Shell》
  • C:《Write a shell in C》
  • Go:《Writing a simple shell in Go》
  • Rust:《Build Your Own Shell using Rust》

写一个能解析命令、管理子进程、处理管道与重定向的 shell,是操作系统课程之外最经典的动手项目。

构建你自己的 模板引擎

  • JavaScript:《JavaScript template engine in just 20 lines》
  • JavaScript:《Understanding JavaScript Micro-Templating》
  • Python:《Approach: Building a toy template engine in Python》
  • Python:《A Template Engine》
  • Ruby:《How to write a template engine in less than 30 lines of code》

模板引擎的核心是"把模板文本编译成可执行代码"(字符串拼接 → 函数生成),20 行级教程足以揭示本质。

构建你自己的 文本编辑器

  • C:《Build Your Own Text Editor》
  • C++:《Designing a Simple Text Editor》
  • Python:《Python Tutorial: Make Your Own Text Editor》 [video]
  • Python:《Create a Simple Python Text Editor!》
  • Ruby:《Build a Collaborative Text Editor Using Rails》
  • Rust:《Hecto: Build your own text editor in Rust》

kilo(《Build Your Own Text Editor》)是终端编辑器领域教科书级的教程,Rust 版 Hecto 则是它的现代语言翻版。

构建你自己的 视觉识别系统

  • Python:《Developing a License Plate Recognition System with Machine Learning in Python》
  • Python:《Building a Facial Recognition Pipeline with Deep Learning in Tensorflow》

车牌识别与 TensorFlow 人脸识别两条管线,属于"复刻一个完整视觉应用"的代表。

构建你自己的 体素引擎

  • C++:《Let's Make a Voxel Engine》

体素(Voxel)渲染是 Minecraft 类游戏的核心技术,该分类目前收录单条但足够经典的 C++ 教程。

构建你自己的 Web 浏览器

  • Rust:《Let's build a browser engine》
  • Python:《Browser Engineering》

从 HTML 解析、CSS 布局到绘制管线,浏览器引擎是前端工程师理解"浏览器如何工作"的最佳入口。

构建你自己的 Web 服务器

  • C#:《Writing a Web Server from Scratch》
  • Node.js:《Build Your Own Web Server From Scratch In JavaScript》
  • Node.js:《Let's code a web server from scratch with NodeJS Streams》
  • Node.js:《lets-build-express》
  • PHP:《Writing a webserver in pure PHP》
  • Python:《A Simple Web Server》
  • Python:《Let's Build A Web Server.》
  • Python:《Web application from scratch》
  • Python:《Building a basic HTTP Server from scratch in Python》
  • Python:《Implementing a RESTful Web API with Python & Flask》
  • Ruby:《Building a simple websockets server from scratch in Ruby》

从裸 HTTP 服务器(处理 TCP socket、解析请求行与头部)到 WebSocket 服务端,是网络编程的入门必修课。

未分类 (Uncategorized)

  • (any):《From NAND to Tetris: Building a Modern Computer From First Principles》
  • (any):《build-your-own-x-vibe-coding: BYOX-style tutorials adapted for vibe coding》
  • Alloy:《The Same-Origin Policy》
  • C:《How to Write a Video Player in Less Than 1000 Lines》
  • C:《Learn how to write a hash table in C》
  • C:《The very basics of a terminal emulator》
  • C:《Write a System Call》
  • C:《Sol - An MQTT broker from scratch》
  • C++:《Build your own VR headset for $200》
  • C++:《How X Window Managers work and how to write one》
  • C++:《Writing a Linux Debugger》
  • C++:《How a 64k intro is made》
  • C++:《Make your own Game Engine》 [video]
  • C#:《C# Networking: Create a TCP chater server, TCP games, UDP Pong and more》
  • C#:《Loading and rendering 3D skeletal animations from scratch in C# and GLSL》
  • Clojure:《Building a spell-checker》
  • Go:《Build A Simple Terminal Emulator In 100 Lines of Golang》
  • Go:《Let's Create a Simple Load Balancer》
  • Go:《Video Encoding from Scratch》
  • Java:《How to Build an Android Reddit App》 [video]
  • JavaScript:《Build Your Own Module Bundler - Minipack》
  • JavaScript:《Learn JavaScript Promises by Building a Promise from Scratch》
  • JavaScript:《Implementing promises from scratch (TDD way)》
  • JavaScript:《Implement your own — call(), apply() and bind() method in JavaScript》
  • JavaScript:《JavaScript Algorithms and Data Structures》
  • JavaScript:《Build a ride hailing app with React Native》
  • JavaScript:《Build Your Own AdBlocker in (Literally) 10 Minutes》
  • Kotlin:《Build Your Own Cache》
  • Lua:《Building a CDN from Scratch to Learn about CDN》
  • Nim:《Writing a Redis Protocol Parser》
  • Nim:《Writing a Build system》
  • Nim:《Writing a MiniTest Framework》
  • Nim:《Writing a DMIDecode Parser》
  • Nim:《Writing a INI Parser》
  • Nim:《Writing a Link Checker》
  • Nim:《Writing a URL Shortening Service》
  • Node.js:《Build a static site generator in 40 lines with Node.js》
  • Node.js:《Building A Simple Single Sign On(SSO) Server And Solution From Scratch In Node.js.》
  • Node.js:《How to create a real-world Node CLI app with Node》
  • Node.js:《Build a DNS Server in Node.js》
  • Node.js:《Build a Synchronization Engine with Node.js and Y.js》
  • PHP:《Write your own MVC from scratch in PHP》
  • PHP:《Make your own blog》
  • PHP:《Modern PHP Without a Framework》
  • PHP:《Code a Web Search Engine in PHP》
  • Python:《Build a Deep Learning Library》 [video]
  • Python:《How to Build a Kick-Ass Mobile Document Scanner in Just 5 Minutes》
  • Python:《Continuous Integration System》
  • Python:《Recommender Systems in Python: Beginner Tutorial》
  • Python:《Write SMS-spam detector with Scikit-learn》
  • Python:《A Simple Content-Based Recommendation Engine in Python》
  • Python:《Stock Market Predictions with LSTM in Python》
  • Python:《Building a simple Generative Adversarial Network (GAN) using Tensorflow》
  • Python:《Learn ML Algorithms by coding: Decision Trees》
  • Python:《JSON Decoding Algorithm》
  • Python:《Build your own Git plugin with python》
  • Ruby:《A Pedometer in the Real World》
  • Ruby:《Creating a Linux Desktop application with Ruby》
  • Rust:《Building a DNS server in Rust》
  • Rust:《Writing Scalable Chat Service from Scratch》
  • Rust:《WebGL + Rust: Basic Water Tutorial》
  • TypeScript:《Tiny Package Manager: Learns how npm or Yarn works》

"未分类"并非低质量,反而藏着不少宝藏:From NAND to Tetris(从与非门到通用计算机的完整路线)、The Same-Origin Policy(浏览器同源策略)、DNS 服务器、MQTT broker、模块打包器(Minipack)、Promise 手写实现等,覆盖极广。

按语言规划学习路线的建议

从清单的条目分布可以提炼出几条"语言主线"(以下均基于清单中实际收录的条目):

  • Python 学习者:神经网络(A Neural Network in 11 lines of Python → SlowTorch)、Web 服务器(Let's Build A Web Server)、Git(Write yourself a Git!)、区块链(Learn Blockchains by Building One)、模板引擎(A Template Engine)都是成熟的 Python 教程;
  • JavaScript/Node 学习者:前端框架(Build your own React、Build Yourself a Redux)、正则引擎(Build a Regex Engine in Less than 40 Lines)、模块打包器(Minipack)、BitTorrent 客户端均有覆盖;
  • Go 学习者:数据库(Build Your Own Database from Scratch: From B+Tree To SQL)、Docker(Build Your Own Container Using Less than 100 Lines of Go)、区块链(Building Blockchain in Go)、CLI 工具(lolcat/cowsay 系列);
  • Rust 学习者:操作系统(Writing an OS in Rust)、文本编辑器(Hecto)、游戏(Roguelike Tutorial in Rust + tcod)、DNS 服务器(Building a DNS server in Rust);
  • C/C++ 学习者:操作系统、内存分配器、模拟器(CHIP-8)、数据库(Let's Build a Simple Database)是 C 系的传统强项。

收录标准与贡献方式:什么样的教程能进入这份清单

这份清单的质量口碑来自严格的收录标准。从 ISSUE_TEMPLATE.md 可以完整还原提交一份教程的要求:

  1. 必须是"从零构建"的编程教程——要么提供分步文章,要么把代码拆解成易于跟学的部分,必须为学习者提供可循的引导路径;
  2. 只收真正从零造轮子的内容——不收框架/库的使用指南,不收"把现有库拼起来"的教程;
  3. 提交信息需要包含:主编程语言(最多 1 种)、教程标题(使用文章/仓库的原始标题)、教程 URL,以及所属分类(在 3D Renderer、Database、Operating System、Programming Language 等三十余个分类中勾选其一)。

贡献方式在 README.md 的 Contribute 部分给出:直接提交 Pull Request,或创建 Issue 提出建议;同时欢迎在待定提交(pending submissions)的讨论中留言、点赞以帮助维护者筛选。换言之,这份清单是社区共同评审、持续演进的开放资源。

起源与许可

据 README.md 的 Origins & License 部分说明:本仓库由 Daniel Stefanovic 发起,现由 CodeCrafters, Inc. 维护,是众多贡献者共同劳动的成果。仓库整体以 CC0(公有领域) 许可发布——在法律允许的范围内,版权及相关邻接权均已放弃,任何人都可以自由使用、复制与再分发。

结语

build-your-own-x 是一份"少即是多"的精选索引:31 个技术分类、按语言排列的数百条教程,每一条都以"从零复刻"为唯一标准。它不提供源码,但提供了一条经过社区筛选的完整动手路线——选一个分类,挑一条教程,像费曼说的那样,亲手创造它,然后真正理解它。

登录后查看全文
build-your-own-x