<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>栈 on Tony Bai</title><link>https://tonybai.com/tags/%E6%A0%88/</link><description>Recent content in 栈 on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Sat, 11 Oct 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/%E6%A0%88/index.xml" rel="self" type="application/rss+xml"/><item><title>Go 作为第一门编程语言：天才之选还是糟糕开端？</title><link>https://tonybai.com/2025/10/11/go-is-a-good-first-programming-language/</link><pubDate>Sat, 11 Oct 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/10/11/go-is-a-good-first-programming-language/</guid><description>Go 作为第一门编程语言：天才之选还是糟糕开端？ - Tony Bai Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * Go语言进阶课FAQ * 关于我 * 我的技术专栏 * 文章列表 Go...</description></item><item><title>一个字符引发的30%性能下降：Go值接收者的隐藏成本与优化</title><link>https://tonybai.com/2025/04/25/hidden-costs-of-go-value-receiver/</link><pubDate>Fri, 25 Apr 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/04/25/hidden-costs-of-go-value-receiver/</guid><description>一个字符引发的30%性能下降：Go值接收者的隐藏成本与优化 - Tony Bai =============== Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * Go语言进阶课FAQ * 关...</description></item><item><title>惊！Go在十亿次循环和百万任务中表现不如Java，究竟为何？</title><link>https://tonybai.com/2024/12/02/why-go-sucks/</link><pubDate>Mon, 02 Dec 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/12/02/why-go-sucks/</guid><description>本文永久链接 – https://tonybai.com/2024/12/02/why-go-sucks 编程语言比较的话题总是能吸引程序员的眼球！ 近期外网的两篇编程语言对比的文章在国内程序员圈里引起热议。一篇是由Ben Dicken (@BenjDicken) 做的语言性能测试，对比了十多种主流语言在执行10亿次循环(一个双层循环：1万 \* 10 万)的速度；另一篇则是一个名为hez2010...</description></item><item><title>手把手教你使用ANTLR和Go实现一门DSL语言（第五部分）：错误处理</title><link>https://tonybai.com/2022/05/30/an-example-of-implement-dsl-using-antlr-and-go-part5/</link><pubDate>Mon, 30 May 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/05/30/an-example-of-implement-dsl-using-antlr-and-go-part5/</guid><description>本文永久链接 – https://tonybai.com/2022/05/30/an-example-of-implement-dsl-using-antlr-and-go-part5 无论是端应用还是云应用，要上生产环境，有一件事必须要做好，那就是**错误处理**。在本系列前面的文章中，我们设计了文法与语法、建立并验证了语义模型，但我们没有特别关注错误处理。在这一篇中，我们就来补上这个环节。 D...</description></item><item><title>手把手教你使用ANTLR和Go实现一门DSL语言（第四部分）：组装语义模型并测试DSL</title><link>https://tonybai.com/2022/05/28/an-example-of-implement-dsl-using-antlr-and-go-part4/</link><pubDate>Sat, 28 May 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/05/28/an-example-of-implement-dsl-using-antlr-and-go-part4/</guid><description>本文永久链接 – https://tonybai.com/2022/05/28/an-example-of-implement-dsl-using-antlr-and-go-part4 在上一篇文章中，我们为DSL建立了完整的语义模型，我们距离DSL的语法示例真正run起来还差最后一步，那就是基于语法树提取信息(逆波兰式)、组装语义模型，在加载语义模型并实例化各个规则处理器(processor)后...</description></item><item><title>手把手教你使用ANTLR和Go实现一门DSL语言（第三部分）：建立和验证语义模型</title><link>https://tonybai.com/2022/05/27/an-example-of-implement-dsl-using-antlr-and-go-part3/</link><pubDate>Fri, 27 May 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/05/27/an-example-of-implement-dsl-using-antlr-and-go-part3/</guid><description>本文永久链接 – https://tonybai.com/2022/05/27/an-example-of-implement-dsl-using-antlr-and-go-part3 在前面的系列文章中，我们为气象学家们设计了一门名为**Tdat**的DSL，使用ANTLR的文法规则编写了Tdat的文法，基于该文法生成了Tdat的语法解析器代码并初步验证了文法的正确性，Tdat可以成功将我们编写...</description></item><item><title>Go 1.17新特性详解：使用基于寄存器的调用惯例</title><link>https://tonybai.com/2021/08/20/using-register-based-calling-convention-in-go-1-17/</link><pubDate>Fri, 20 Aug 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/08/20/using-register-based-calling-convention-in-go-1-17/</guid><description>本文永久链接 – https://tonybai.com/2021/08/20/using-register-based-calling-convention-in-go-1-17 除了Go语言特性与go module有重要变化之外，Go编译器与Go运行时也都有着优化与改进，这两方面的变化对Go程序的构建与运行影响巨大。在这个系列的最后一篇中，我们来看看编译器与运行时中那些值得关注的变化。 1. ...</description></item><item><title>使用functrace辅助进行Go项目源码分析</title><link>https://tonybai.com/2021/06/04/go-source-analysis-with-functrace/</link><pubDate>Fri, 04 Jun 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/06/04/go-source-analysis-with-functrace/</guid><description>本文永久链接 – https://tonybai.com/2021/06/04/go-source-analysis-with-functrace 在《像跟踪分布式服务调用那样跟踪Go函数调用链》一文中，我们介绍了一种跟踪函数调用链的思路，并给出了一种实现functrace：https://github.com/bigwhite/functrace。这个小工具不仅仅是分享给大家的，我自己在工作和学...</description></item><item><title>通过实例理解Go逃逸分析</title><link>https://tonybai.com/2021/05/24/understand-go-escape-analysis-by-example/</link><pubDate>Mon, 24 May 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/05/24/understand-go-escape-analysis-by-example/</guid><description>本文永久链接 – https://tonybai.com/2021/05/24/understand-go-escape-analysis-by-example 翻看了一下自己的Go文章归档，发现自己从未专门写过有关Go逃逸分析（escape analysis）的文章。关于Go变量的逃逸分析，大多数Gopher其实并不用关心，甚至可以无视。但是如果你将Go应用于性能敏感的领域，要完全压榨出Go应用...</description></item><item><title>Go语言的“黑暗角落”：盘点学习Go语言时遇到的那些陷阱[译]（第二部分）</title><link>https://tonybai.com/2021/03/29/darker-corners-of-go-part2/</link><pubDate>Mon, 29 Mar 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/03/29/darker-corners-of-go-part2/</guid><description>本文翻译自Rytis Bieliunas的文章《Darker Corners of Go》。 第一部分参见[《Go语言的“黑暗角落”：盘点学习Go语言时遇到的那些陷阱\[译\]（第一部分）》](https://tonybai.com/2021/03/29/darker-corners-of-go-part1) 7\. 字符串和字节数组 ------------ 1) Go中的字符串 Go字符串的内...</description></item><item><title>Go语言的“黑暗角落”：盘点学习Go语言时遇到的那些陷阱[译]（第一部分）</title><link>https://tonybai.com/2021/03/29/darker-corners-of-go-part1/</link><pubDate>Mon, 29 Mar 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/03/29/darker-corners-of-go-part1/</guid><description>本文翻译自Rytis Bieliunas的文章《Darker Corners of Go》。 &amp;gt; 译注：若干年前，Kyle Quest曾发过一篇名为“50 Shades of Go: Traps, Gotchas, and Common Mistakes for New Golang Devs”的文章，仿效著名的《C Traps and Pitfalls》编写了50条Go语言的陷阱与缺陷，一时在G...</description></item><item><title>可视化Go内存管理</title><link>https://tonybai.com/2020/03/10/visualizing-memory-management-in-golang/</link><pubDate>Tue, 10 Mar 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/03/10/visualizing-memory-management-in-golang/</guid><description>本文翻译自《Visualizing memory management in Golang》。 “内存管理”系列的一部分 在这个由多部分组成的系列文章中，我旨在揭示内存管理背后的概念，并对某些现代编程语言的内存管理机制做更深入的探究。我希望该系列文章可以使您对这些语言在内存管理方面正在发生的事情能有所了解。 在本章中，我们将研究Go编程语言（Golang）的内存管理。和C/C++、Rust等一样，...</description></item><item><title>图解Go内存分配器</title><link>https://tonybai.com/2020/02/20/a-visual-guide-to-golang-memory-allocator-from-ground-up/</link><pubDate>Thu, 20 Feb 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/02/20/a-visual-guide-to-golang-memory-allocator-from-ground-up/</guid><description>本文翻译自《A visual guide to Go Memory Allocator from scratch (Golang)》。 当我刚开始尝试了解Go的内存分配器时，我发现这真是一件可以令人发疯的事情，因为所有事情似乎都像一个神秘的黑盒(让我无从下手)。由于几乎所有技术魔法都隐藏在抽象之下，因此您需要逐一剥离这些抽象层才能理解它们。 在这篇文章中，我们就来这么做(剥离抽象层去了解隐藏在其下...</description></item><item><title>Go语言回顾：从Go 1.0到Go 1.13</title><link>https://tonybai.com/2019/09/07/go-retrospective/</link><pubDate>Sat, 07 Sep 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/09/07/go-retrospective/</guid><description>Go 1.13版本在2019.9.3正式发布！国外的Gopher Vincent Blanchon发表了一篇文章《Go: Retrospective》(科学上网阅读)，对Go从1.0版本到1.13版本做了简要的回顾，这里是那篇文章的译文。 对于每一位Go开发者来说，Go语言的演化历程是必须要知道的事情。了解这些横跨年份发布的大版本的主要变化将有助于Gopher理解Go语言的发展理念以及该语言每个版...</description></item><item><title>记一次go panic问题的解决过程</title><link>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/</link><pubDate>Thu, 04 Apr 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/04/04/notes-about-fixing-a-go-panic-problem/</guid><description>一. Panic问题概述 ------------ 本周收到客户在bugclose上填写的一个issue：添加一个下发通道后，pushd程序panic并退出了！程序panic时输出的stacktrace信息摘录如下： panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: se...</description></item><item><title>Goroutine是如何工作的</title><link>https://tonybai.com/2014/11/15/how-goroutines-work/</link><pubDate>Sat, 15 Nov 2014 00:00:00 +0800</pubDate><guid>https://tonybai.com/2014/11/15/how-goroutines-work/</guid><description>在golangweekly的第36期Go Newsletter中我发现一篇短文&amp;#34;How Goroutines Work&amp;#34; ，其作者在参考了诸多资料后，简短概要地总结了一下 Goroutine的工作原理，感觉十分适合刚入门的Gophers（深入理解Goroutine调度的话，可以参考Daniel Morsing的&amp;#34; The Go scheduler&amp;#34; )。这里粗译如下。 **一、Go语言简介** 如...</description></item><item><title>Go语言是如何处理栈的</title><link>https://tonybai.com/2014/11/05/how-stacks-are-handled-in-go/</link><pubDate>Wed, 05 Nov 2014 00:00:00 +0800</pubDate><guid>https://tonybai.com/2014/11/05/how-stacks-are-handled-in-go/</guid><description>Go 1.4Beta1刚刚发布，在Go 1.4Beta1中，Go语言的stack处理方式由之前的&amp;#34;segmented stacks&amp;#34;改为了&amp;#34;continuous stacks&amp;#34;。关于Go语言对stack的处理机制、发展历史、存在问题等，CloudFlare的一篇官方blog进行了系统的阐述，这里的内容就是 翻译自CloudFlare的那篇blog：《How Stacks are Handled i...</description></item></channel></rss>