github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/talks/2015/keeping-up.slide (about) 1 Keeping up with the Gophers 2 A brief history of gccgo, improvements, and the future 3 4 Chris Manghane 5 Google Gopher | Compilers and Toolchains 6 cmang@golang.org 7 8 * gccgo: "The Other Go Compiler" 9 10 - Written and maintained by Ian Lance Taylor (released November 2009) 11 12 2010-01-26 Ian Lance Taylor <iant@google.com> 13 14 * MAINTAINERS: Add myself as Go frontend maintainer. 15 16 - Compiler frontend for the Go language written in C++ 17 18 .image keeping-up/gccgo_structure.png 320 _ 19 20 * gccgo: The Go Team didn't know 21 22 "Ian just showed up at our door with a fully working compiler" ~ probably Rob 23 24 .html keeping-up/gource_explosion.html 25 26 * Why write a Go compiler in C++? 27 28 * rationale: architecture support 29 30 - cmd/gc (2009) targets 4 major architectures: i386, amd64, ARM, and IBM POWER 31 - gcc (4.3, 2009) targets 45 architectures officially, 28 unofficially 32 - leveraging gcc => minimal work to support Go on existing architectures 33 34 * rationale: code generation 35 36 - gcc has ~30 years of work put into code analysis and optimization 37 - cmd/gc has only recently focused on code generation (khr's SSA work) 38 - leveraging gcc => minimal work to produce optimized binaries 39 40 * rationale: technical honesty 41 42 - "Keeping each other honest" 43 - Distinct implementations => Inconsistencies in specification and implementations 44 - Users have options when an implementation lacks features 45 - Compilers seek feature parity => Compilers learn from each other 46 - Compilers generate better binaries => Virtuous cycle 47 48 * gccgo improvements through a telescope 49 50 * gofrontend: no dependency on gcc 51 52 - gcc implements gofrontend's backend interface 53 54 gofrontend (gcc/go/gofrontend/expressions.cc) 55 56 .code keeping-up/backend_interface.diff 57 58 backend (gcc/go/go-gcc.cc) 59 60 .code keeping-up/cst.gcc 61 62 * gccgo: builds the `go` tool 63 64 - One way to build code across multiple compilers 65 66 .code keeping-up/go_build.log 67 68 * gofrontend: basic escape analysis 69 70 - Implementation of _Escape_analysis_for_Java_ by JD Choi 71 72 escape.go 73 74 .code keeping-up/escape.go 75 76 Connection Graph 77 78 .image keeping-up/escape.png 79 80 * Keeping up 81 82 * gccgo: runtime and garbage collector parity 83 84 - gccgo runtime is a modified version of Go 1.3 runtime 85 - Go 1.4 runtime was rewritten in Go 86 - Go 1.4 changed GC type info 87 88 * beyond gccgo: compiler stack maps 89 90 - Stack map records locations of live values at a certain address 91 - Allows Garbage Collector to be precise about types on stack 92 - Enables contiguous stacks to readjust copied pointers 93 - Little support in C compilers: gcc has no support, LLVM support is WIP 94 95 * llvmgo: another "other Go compiler" 96 97 - gofrontend provides backend interface LLVM can implement 98 - LLVM byte code is trusted in secure environments such as PNaCl 99 - Run native Go in the web 100 101 * OS support: OSX and Windows 102 103 - gccgo support on not unixes 104 - Expert needed