跳到主内容
@wquguru
精选70Hacker News Best(web_list)技巧与观点

谷歌:Go 是 AI 辅助软件工程的理想语言

原文
发到 X

Why Go is an Ideal Language for AI-Assisted Software Engineering

为什么 Go 是 AI 辅助软件工程的理想语言

AUG. 11, 2026

2026 年 8 月 11 日

Cameron Balahan Group Product Manager Go

Cameron Balahan Go 产品组经理

Richard Seroter Chief Evangelist Google Cloud

Richard Seroter Google Cloud 首席布道师

Share

分享

  • Facebook
  • Twitter
  • LinkedIn
  • Mail
  • Facebook
  • Twitter
  • LinkedIn
  • 邮件

For a while now, software engineering has undergone a profound, fundamental shift: Where we once wrote most lines of code by hand, we now ask AI coding assistants and agents to generate large swaths of code for us. But AI needs supervision, so it is we, the humans, who must read the generated code, clean it up, and verify that it does what we want it to do. And because AI has a limited view of the greater context in which the code it generates must operate, it is we who define the system architecture, design the boundaries between services, and ensure the overall safety and reliability of our production environments.

一段时间以来,软件工程经历了一场深刻而根本的转变:我们曾经手动编写大部分代码,而现在我们要求 AI 编码助手和代理为我们生成大量代码。但 AI 需要监督,因此是我们人类必须阅读生成的代码、清理它,并验证它是否按我们的意愿工作。而且,由于 AI 对其生成的代码必须运行的更大上下文视野有限,因此是我们定义系统架构、设计服务之间的边界,并确保生产环境的整体安全性和可靠性。

In this paradigm, the things that matter most in our developer tools are shifting, too.

在这种模式下,我们的开发者工具中最重要的东西也在发生变化。

From Writing to Reviewing

从编写到审查

Historically, developers measured the productivity of a programming language largely by how easy it is to write. But when a coding agent can generate hundreds of lines of syntactically valid code in seconds, the rate at which a human can write code is no longer very important. What matters now is reviewing, verifying, and maintaining that code once it's already written.

从历史上看,开发者主要通过编写代码的难易程度来衡量编程语言的生产力。但是,当编码代理能在几秒钟内生成数百行语法正确的代码时,人类编写代码的速度就不再那么重要了。现在重要的是审查、验证和维护已经写好的代码。

In other words, AI is increasingly your teammate—a bit of a maverick, but a teammate all the same. What matters most is how we work together as a team.

换句话说,AI 越来越像你的队友——有点特立独行,但仍然是队友。最重要的是我们如何作为一个团队合作。

Go is for Software Engineering

Go 是为软件工程而生的

As it happens, considerations around team-driven development are what led Rob Pike, Robert Griesemer, and Ken Thompson to create the Go programming language at Google more than twenty years ago. As other languages rapidly added features and sought to expand the number of ways to express program logic, Go focused on a larger vision: language design in the service of software engineering.

事实上,正是对团队驱动开发的考虑,促使 Rob Pike、Robert Griesemer 和 Ken Thompson 在二十多年前于 Google 创造了 Go 编程语言。当其他语言迅速增加功能并寻求扩展表达程序逻辑的方式时,Go 专注于一个更大的愿景:为软件工程服务的语言设计。

Software engineering is not the same thing as programming. Where programming is about solving a problem by writing code and then running it, software engineering is the act of collaborating with others to design and implement a durable system that evolves over time. Programming is a part of software engineering, but just a part.

软件工程与编程不是一回事。编程是通过编写代码然后运行来解决问题,而软件工程是与他人协作设计和实现一个随时间演进的持久系统。编程是软件工程的一部分,但只是一部分。

Language design in the service of software engineering requires not just a language, but an end-to-end platform with tooling all around the software development life cycle. It requires opinionated simplicity so whole teams can structure, format, and test their code the same way. It requires strong compatibility guarantees so that the code you write today will not only still work in ten years, it will still be good code in ten years. It requires a strong ecosystem, with a global system for dependency management that can scale with your teams. And it requires that it does all these things with sensible, robust security considerations and tools woven throughout.

为软件工程服务的语言设计不仅需要一种语言,还需要一个端到端的平台,其工具贯穿软件开发生命周期的各个环节。它需要坚定的简洁性,以便整个团队能够以相同的方式构建、格式化和测试代码。它需要强大的兼容性保证,使你今天编写的代码不仅在十年后仍然有效,而且在十年后仍然是好代码。它需要一个强大的生态系统,拥有一个能够随团队扩展的全局依赖管理系统。它还需要在所有这些方面都融入合理、稳健的安全考虑和工具。

Together, these elements are the foundation for scalable, long-term teamwork, enabling us to build systems that remain maintainable many years after the original author has moved on. Now that AI is on the team, this foundation matters more than ever.

这些元素共同构成了可扩展、长期团队协作的基础,使我们能够构建在原始作者离开多年后仍保持可维护性的系统。如今,随着 AI 加入团队,这一基础比以往任何时候都更加重要。

Go is a Platform

Go 是一个平台

One of the things that most distinguishes Go is that it is not just a language, it’s a platform. From the start, Go has shipped with a robust, end-to-end toolchain with touchpoints all across the software development life cycle. Out of the box, the Go platform provides a built-in formatter, test framework, dependency management, and advanced security tools—all accessible directly from the standard toolchain. This platform, combined with a comprehensive standard library that eliminates the need for complex external frameworks, provides an unparalleled baseline of consistency.

Go 最显著的特点之一是它不仅仅是一种语言,更是一个平台。从一开始,Go 就附带了一个强大的端到端工具链,其触点遍布软件开发生命周期的各个阶段。开箱即用,Go 平台提供了内置的格式化工具、测试框架、依赖管理和高级安全工具——所有这些都可以直接从标准工具链中访问。这个平台与全面的标准库相结合,消除了对复杂外部框架的需求,提供了无与伦比的一致性基线。

Go is a platform with developer touchpoints all across the software development life cycle.

Go 是一个平台,其开发者触点遍布软件开发生命周期的各个阶段。

These features and tools were originally built to empower humans, but it turns out that AI and humans have surprisingly similar needs. When an AI agent is asked to refactor code iteratively without external validation, its performance can quickly degrade—much like a human refactoring by hand. A first pass might be 95% correct, but successive passes compound the error rate and pollute the context window, dropping accuracy while increasing token costs. But with Go, AI models can leverage the platform’s end-to-end toolchain to operate on Go code faster, cheaper, and more reliably, producing higher-quality, more secure, and more correct code.

这些特性和工具最初是为了赋能人类而构建的,但事实证明,AI 和人类有着惊人相似的需求。当 AI 代理被要求在没有外部验证的情况下迭代重构代码时,其性能可能会迅速下降——就像人类手工重构一样。第一遍可能正确率为 95%,但后续的遍数会累积错误率并污染上下文窗口,在增加 token 成本的同时降低准确性。但是使用 Go,AI 模型可以利用平台的端到端工具链,以更快、更便宜、更可靠的方式操作 Go 代码,生成更高质量、更安全、更正确的代码。

This integrated tooling has a second, less obvious benefit: ecosystem-wide coherence. Because the vast majority of Go developers utilize the same core tools, the entire community moves together uniformly, adopting major language enhancements seamlessly across runtimes, IDEs, and package ecosystems all at once. This unified approach is strengthened by Go’s standard library, which creates further coherence across projects by reducing variance in program logic and promoting repetitive, predictable idioms that developers and AI both can more quickly understand. This structural uniformity not only helps human teams maintain large codebases but also creates cleaner, more standardized training data for LLMs.

这种集成工具链还有第二个不那么明显的好处:生态系统范围内的一致性。由于绝大多数 Go 开发者使用相同的核心工具,整个社区统一行动,在运行时、IDE 和包生态系统中无缝地同时采用主要语言增强功能。这种统一方法通过 Go 的标准库得到加强,标准库通过减少程序逻辑的差异并推广重复、可预测的惯用法(开发者和 AI 都能更快理解)来进一步促进项目间的一致性。这种结构上的统一不仅帮助人类团队维护大型代码库,还为 LLM 创造了更干净、更标准化的训练数据。

Go is Readable

Go 是可读的

Another of Go’s distinguishing characteristics is that it prioritizes readability over writability. Rob, Robert, and Ken recognized that developers spend far more time reading existing code than they do typing it out. In a human-only world, this design philosophy manifests as a culture that prizes simplicity over cleverness and explicitly rejects the syntactic magic that other languages celebrate. Gophers often speak of how they love that they can never tell who on their team wrote a particular piece of code—it all looks the same.

Go 的另一个显著特点是它优先考虑可读性而非可写性。Rob、Robert 和 Ken 认识到,开发者阅读现有代码的时间远多于编写代码的时间。在纯人类的世界中,这种设计理念体现为一种文化,即重视简单而非聪明,并明确拒绝其他语言所推崇的语法魔法。Gophers 经常谈到他们喜欢永远无法分辨团队中谁写了某段代码——因为看起来都一样。

In the era of AI-driven development, this read-first philosophy transforms into a force multiplier. Where individual developers might have historically favored syntax brevity, implicit typing, and clever shortcuts that accelerate prototyping, agent ergonomics—and the corresponding human verification loop—demand the exact opposite: predictability, explicitness, and rigid structure. With AI, the rate-limiting bottleneck of the software development life cycle shifts entirely from generation to verification. If a language offers a dozen different ways to express the same logic, an AI model will inevitably generate a fragmented, haphazardly stylized hodgepodge of syntax. For the human reviewer, verifying that code becomes an exhausting exercise in deciphering intent.

在 AI 驱动的开发时代,这种先读后写的理念转化为一种力量倍增器。虽然个别开发者可能历来偏爱语法简洁、隐式类型和加速原型设计的巧妙捷径,但代理的人体工程学——以及相应的人类验证循环——却要求恰恰相反:可预测性、明确性和严格的结构。有了 AI,软件开发生命周期的速率限制瓶颈完全从生成转向验证。如果一种语言提供十几种不同的方式来表达相同的逻辑,AI 模型将不可避免地生成碎片化、风格杂乱无章的语法大杂烩。对于人类审查者来说,验证这些代码变成了一项令人精疲力竭的解读意图的练习。

Go solves this through unyielding consistency. By enforcing a single, standardized format via the built-in gofmt tool and offering a language design that intentionally limits complex abstractions, Go ensures that all code—whether written by a senior engineer, a junior contributor, or an LLM—looks the same. When the syntax is entirely predictable, a human developer can spot a hallucinated API call, a logic flaw, or a security vulnerability more quickly. And, because this standardization extends to the open-source Go ecosystem, models are trained on standardized data, making them better at generating correct, idiomatic Go code in fewer shots.

Go通过坚定不移的一致性解决了这个问题。通过内置的gofmt工具强制执行单一、标准化的格式,并提供一种有意限制复杂抽象的语言设计,Go确保所有代码——无论是资深工程师、初级贡献者还是LLM编写的——看起来都一样。当语法完全可预测时,人类开发人员可以更快地发现幻觉API调用、逻辑缺陷或安全漏洞。而且,由于这种标准化扩展到开源Go生态系统,模型在标准化数据上进行训练,使它们能够更好地在更少的尝试中生成正确、惯用的Go代码。

Ultimately, a language that is clear for humans is inherently clear for AI models. As AI continues to accelerate the volume of code we produce, Go’s commitment to readability ensures that we can scale our systems without losing our ability to understand, verify, and safely maintain them.

最终,对人类清晰的语言本质上对AI模型也是清晰的。随着AI继续加速我们产生的代码量,Go对可读性的承诺确保我们能够扩展系统,同时保持理解、验证和安全维护它们的能力。

Go is Reliable

Go是可靠的

But readability and developer productivity are only half the battle. A language can be as readable and productive as we like, but if the resulting application is fragile, insecure, or unpredictable under load, it has no place in production.

但可读性和开发人员生产力只是成功的一半。一种语言可以像我们喜欢的那样可读和高效,但如果由此产生的应用程序在负载下脆弱、不安全或不可预测,它就没有生产环境的立足之地。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

另一事件,读法相近