Go is an ideal language for AI-assisted software engineering

Go is an ideal language for AI-assisted software engineering

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

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. In this paradigm, the things that matter most in our developer tools are shifting, too.

长期以来,软件工程经历了一场深刻且根本性的转变:过去我们大部分代码都是手写的,而现在我们转而请求 AI 编程助手和智能体为我们生成大段代码。但 AI 需要监督,因此必须由我们人类来阅读生成的代码、进行清理,并验证其是否符合预期。由于 AI 对代码运行的宏观背景缺乏全局视野,我们仍需负责定义系统架构、设计服务边界,并确保生产环境的整体安全与可靠性。在这种范式下,开发者工具中最重要的考量因素也在发生变化。

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.

为软件工程服务的语言设计,不仅需要一种语言,还需要一个围绕软件开发生命周期提供全方位工具的端到端平台。它需要“独断的简洁性”(opinionated simplicity),以便整个团队能以相同的方式构建、格式化和测试代码。它需要强大的兼容性保证,确保你今天写的代码不仅十年后还能运行,而且十年后依然是优秀的代码。它需要一个强大的生态系统,具备能随团队规模扩展的全局依赖管理系统。并且,它要求在所有这些过程中,都融入合理且稳健的安全考量与工具。

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 平台提供了内置的格式化工具、测试框架、依赖管理和高级安全工具——所有这些都可以直接通过标准工具链访问。该平台结合了无需复杂外部框架的全面标准库,提供了一个无与伦比的一致性基准。

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 代码,从而产出质量更高、更安全且更正确的代码。

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 认识到,开发者阅读现有代码的时间远多于编写代码的时间。在纯人类开发的世界里,这种设计哲学体现为一种推崇简洁而非卖弄技巧的文化,并明确拒绝其他语言所推崇的“语法魔法”。Gopher 们经常提到,他们很喜欢这一点:你永远无法分辨团队中是谁写了某段代码——因为它们看起来都一样。