Skip to content
0:00 / 0:00

#go#assembler#robpike

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

Gopher Academy

41K subscribers • 5 videos on Hallway

YouTube
  • Recommended by 5 people: 3 on Hacker News, 1 on Lobsters and 1 curated list.
  • Presented by Rob Pike, co-creator of Go

Advanced. Deep dive for people who know the field.

115K views10 years ago5 recommendations

Programming languagesSystems programmingGoCompilers and interpretersLanguage design and type systems

Rob Pike explains the design of Go's assembler, which uses a semi-portable instruction set to simplify compiler backends across multiple architectures.

The uploader added no description.

Why it's here

5 people recommend this

What people say. Engineers recommend this talk to understand Go's unique approach to assembly and compiler backend portability.

inactive-useron Lobsters • Recommends

Rob Pike - The Design of the Go Assembler

programming-talkscurated list on GitHubRecommends

Under “Go”

The Design of the Go Assembler 00:23:56 by **Rob Pike** (2016)

chuboton Hacker News • Recommends

On “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: link to 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…

bkeroackon Hacker News • Recommends

On “A Foray into Go Assembly Programming”

Here's a good talk about the Go assembler backend: link to 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.

fourseventyon Hacker News • Recommends

On “Go Assembly by Example”

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

u/oscarryzin r/ProgrammingLanguages • Mentions

On “Resources for learning compiler (not general programming language) design”

I think at that point it depends on the architecture(s) you're targeting and similar to how you write your AST to LLVM IR you can write directly to assembler code (which is another language) of your chosen architecture. You might be interested in this video by Rob Pike on how the Go assembler was designed. [video

u/khimera27in r/ProgrammingLanguages • Mentions

On “Are assembly languages between different CPUs similar? Also, are different CPU architectures similar with their assembly language?”

Kind of, Heres a talk about the Go Assembler, it works on the premise that most ASM languages are similar, but i think this is only true in modern architectures.

znpyon Hacker News • Mentions

On “Orbit: An Optimizing Compiler for Scheme (1986) [pdf]”

…ne of the pages you link ( link ) links a paper (grep "1986: Kelsey dissertation on rewrite-based compilation ") that shows the implementation of a compiler with multiple frontends (BASIC, Scheme, Pascal) using only source-to-source) transformation. I find this interesting because in a certain way, this reminds me of how the go assembler works ( link to this video ). For those who haven't seen the talk: basically the go compiler works on the assumption that pretty much all computer, in a way, move memory from one address to another, generate and handle interrupts, have call/return instructions and so on. Thus, the go compiler emits (IIRC) some sort of "intermediate assembler" (somehow similar to llvm…

jhawk28on Hacker News • Mentions

On “Porting Alpine Linux to RISC-V”

Go uses a common assembly with ways to covert into the specific architecture which makes porting the toolchain to new targets somewhat trivial. ( link to this video )

cxron Hacker News • Mentions

On “The Simplicity of Single-File Golang Deployments”

…'s tempting to say "Ah, sounds like super advanced ChatGPT-ops or something approaching real AGI", but what I have in mind is something decidedly less magical. It's more akin to the sort of thing that Rob Pike brought up in his "The Design of the Go Assembler" talk ("you have a machine readable description... why not read it with a machine?"). < link to this video >…

yencabulatoron Hacker News • Mentions

On “Runtime code generation and execution in Go”

Generally the inline assembly is hand-written and must follow the platform rules, see "Architecture-specific details" in link The few tools that generate that asm, such as link , would also have follow the rules. You're not meant to take C source, crank it through GCC, and slurp that in as inline asm in Go. Background: link to this video

saclark11on Hacker News • Mentions

On “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 12. 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: link to this video 2: link

MathMonkeyManon Hacker News • Mentions

On “Show HN: Torque – A lightweight meta-assembler for any processor”

I'm reminded of a 2016 talk1 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: link to this video