编程与软件工程blog.jse.li编辑精选
用 Go 从零构建 BitTorrent 客户端
Building a BitTorrent client from the ground up in Go
2020 — 2025,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
作者在假期里挑战自己:不借助现成库,从零用 Go 写一个 BitTorrent 客户端,目标是下载 Debian ISO。文章详细梳理了这一周学到的一切,涵盖 BitTorrent 协议解析、peer 连接、分片下载等实现细节。
为什么经久不衰:它把一个经典网络协议的完整实现过程讲得清晰透彻,既是 BitTorrent 入门材料,也是学习 Go 工程实践的范本,多年来反复被推荐。
HN 评论精选
作者自述写作动机:以实战项目学 Go 并记录所学。
假期里我给自己定了个挑战:通过从零写一个下载 Debian ISO 的种子客户端来学 Go。这篇文章是我这一周所学内容的一次集中输出。
eat_veggies查看英文原文
Over the holidays, I challenged myself to learn Go by torrenting the Debian ISO -- from scratch. This post is a bit of a brain dump about everything I've learned over the past week.
认为 Go/Rust 非常适合写 BitTorrent 库,惋惜这方面生态不足。
很棒的写作,也是深入理解 BitTorrent 内部机制的好方式。看了维基百科的 BitTorrent 客户端对比页面,我有点惊讶用 Go 或 Rust 做跨平台库和客户端的努力竟不多——这看起来是很合适的应用场景?
devadvance查看英文原文
Awesome write-up and a great way to dig into the inner-workings of BitTorrent. Nice work! Glancing at the wiki page for BitTorrent[0], I'm a bit surprised that there isn't more of an effort to create cross-platform libraries and clients using Go or Rust for this. Seems like a perfect use case? For example, synapse [1]. [0] https://en.wikipedia.org/wiki/Comparison_of_BitTorrent_clients#Libraries [1] https://github.com/Luminarys/synapse
提醒:只下载不上传的客户端在真实 swarm 中可能被封禁。
严格来说这个客户端只做吸血(不支持上传分片)。小心使用——下载 Linux ISO 的群体可能比较宽容,但换到其他 tracker 或客户端,你很快就会被封禁,因为他们肯定会注意到这一点。
userbinator查看英文原文
Strictly leeches (does not support uploading pieces) Be careful with using this client --- the swarm for a Linux ISO is probably a bit more forgiving, but you may get banned very quickly by the tracker or other clients, because they will definitely notice that.
资深 Go 开发者认可代码质量。
作为一个每天写 Go 的人,这代码写得很地道!
unboxingelf查看英文原文
As someone who writes Go code daily, nice Go code!
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选