编程与软件工程jan.newmarch.name编辑精选
用 Go 进行网络编程
Network Programming with Go
2011 — 2016,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是 Jan Newmarch 撰写的《Network Programming with Go》在线教程,系统讲解如何用 Go 进行网络编程,涵盖 TCP/UDP socket、HTTP、编码、国际化等主题。该书在 2011-2016 年间多次登上 Hacker News 首页,是 Go 早期生态中广受推荐的免费网络编程教材。
为什么经久不衰:它把网络基础知识和 Go 语言实践结合得系统而免费,多年反复被推荐,至今仍是学习 Go 网络编程的经典入门资料。
HN 评论精选
本书重网络原理轻语言入门,定位独特
有趣的是,作者跳过了 Go 语言入门介绍,说这类入门教程已经很多了,却对网络和互联网的原理讲解得非常详细!
asto查看英文原文
I find it funny how he skips an introduction to Go saying there are many such introductions already available but explains networks and the internet in great detail!
读者希望书中补充认证与 HTTPS 等实战内容
我很喜欢这本书,但在实现网站时最困难的是认证部分:密码该如何加密?session id 该如何生成并传给用户?session 信息该存在哪里(cookie、文件、数据库还是内存)?另外我也想了解 https,从理论到实现。
stewie2查看英文原文
I really like this book, but what I found most difficult when implementing a website is the authentication part. How password should be encrypted? How session id should be generated and passed to the user? How session information should be saved? (cookie? file? database? memory?) Also, I'd be interested in https, from theory to implementation.
早期 Go 在高并发下线程管理行为令人担忧
有没有办法控制 Go 的原生线程数量?我写了个用 net/smtp 给自己发邮件的小例子,每个 goroutine 发一封。令人不安的是,启动几千个 goroutine 竟产生了几千个原生线程,导致系统卡死。如果在创建 goroutine 之间加个很小的停顿就不会出现这种情况。我试过 runtime.GOMAXPROCS,但没用。
noselasd查看英文原文
Is there any way you can control the number of native threads in go ? I wrote a small go example that used net/smtp to bombard myself with emails. Just a loop that fired off a goroutine, which each sent an email. It was quite disturbing that firing off several thousand goroutines resulted in several thousand native threads - resulting the system trashing. If I inserted a very small pause between creating the go routines, this did not occur and just 1 or 2 native threads were created. I tried the runtime.GOMAXPROCS, to no awail. Is there any way of controlling this kind of behavior ?
肯定内容全面,但指出 Go API 在易用性和协议覆盖上的不足
文档很有意思,但我觉得这门语言有两个痛点:一是阻塞式解析器,在交互式 GUI 应用中非常麻烦;二是应用开发者通常不关心地址族这些底层细节,连接一个主机应该一行代码搞定,而不是半页天书。另外书里提到了 SCTP,很好,终于不只是 UDP/TCP 两极世界了,但如何从语言 API 使用它?raw socket 只给了 ICMP 的例子,希望能有 SCTP 或 DCCP 的示例。
ay查看英文原文
Very interesting set of docs. However, I think the language misses in two areas that have shown to be pain points: * Blocking resolvers. They are a royal pain in an interactive GUI app. But I guess here the language goes with what the OS provides. * The app developers usually do not care about the dirty underwear of the address families, and addresses, in general, when all they want is to use the reliable stream to a host of their choice. Connecting a socket to a host should be one line, not a half page of alphabet soup. Also: there's a mention of SCTP. Great! Finally the world is not just bipolar UDP-TCP, at least in the book. But how to use it from the language API ? Raw socket only has an example for ICMP. Would have been great to see an example for SCTP. Or DCCP, for that matter.
历次讨论
同类还值得读
开源应用架构
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编辑精选