HackerTube

GopherCon 2016: The Design of the Go Assembler - Rob Pike

Gopher Academy3 HN recommenders · recommended in 3 months, 2017–2025
YouTube
talk · advanced · evergreen · 2017–2025 on HN

Rob Pike's GopherCon 2016 talk on the design of the Go assembler, explaining why Go uses a common assembly language translated to each architecture.

HN points to it for background on how the Go toolchain targets many architectures and why its assembler is designed that way.

9 comments from Hacker News

@fourseventy2017-09 · in “Go Assembly by Example”

This is relevant ▶ this video Its Rob Pike talking about the go assembler and he answers a few of your questions.

Recommends View on HN
@bkeroack2017-04 · in “A Foray into Go Assembly Programming”

Here's a good talk about the Go assembler backend: ▶ this video Spoiler: they're nearly to the point (maybe now they've achieved it fully) of autogenerating a new language backend from ISA documentation PDFs! Bring that up next time someone complains about Go not using LLVM.

Recommends View on HN
@chubot2017-02 · in “Show HN: How to write a tiny compiler”

Have you looked at the Go toolchain at all? I don't know much about it, but they implemented their back ends in a manner that is much smaller than LLVM and GCC. And it sounds like the architecture of the compiler is significantly different. I watched this talk and it was pretty interesting: ▶ this video link If I am understanding right, the claim is that they have a single assembly language for ALL GO architectures, based on something Ken Thompson wrote in the 90's for some National Instruments (?) chip. He actually says that all assembly language looks the same now. I was sort of surprised by that claim. I would like to hear a critique of this from other compiler writers. Does the fact that Go uses a single assembly language make the code slower? I imagine taking advantage of target-specific knowledge is useful, but I don't know how much. LLVM has this pretty elaborate TableGen system to express target-specific knowledge. He also makes the claim that they will be able auto-generate a new backend from the PDF description of the architecture. And he says somewhere that they reduce a lot of the work to simple "text processing" (symbol manipulation) and didn't require opening up any processor manuals. I can see how arithmetic and bitshifting is the same among all architectures. But I would think that even loads and stores have differences, at least if you want to use the processor efficiently. But he says everything kinda looks the same. Also, another thought is that compiling to W

Recommends View on HN
@MathMonkeyMan2025-04 · in “Show HN: Torque – A lightweight meta-assembler for any processor”

I'm reminded of a 2016 [talk][1] where Rob Pike describes the common-denominator assembly language that the Go compiler generates. Then that assembly is translated into machine-specific code via table lookups. See the 11 minute mark. [1]: ▶ this video

@saclark112024-10 · in “Show HN: Go Plan9 Memo”

> Overall, pretty weird stuff. I am not sure why the Go team went down this route. Maybe it simplifies the compiler by having this bespoke assembly format? Rob Pike spoke on the design of Go's assembler at a talk in 2016 [1][2]. I think it basically came down to the observation that most assembly language is roughly the same, so why not build a common assembly language that "lets you talk to the machine at the lowest level and yet not have to learn a new syntax." It also enables them to automatically generate a working assembler given an instruction manual PDF for a new architecture as input. [1]: ▶ this video [2]: link