Recently I read Go lang . I began to understand its structure.
How to build
You can build the go compiler and tools as documented in the official documentation .
After building, I got the following executables in bin directory.
- 6a: assembler
- 6c: C compiler
- 6g: Go compiler
- 6l: linker
- 6nm: same as nm(1)?
- quietgcc: gcc wrapper which is little slienter than native gcc
There are only three architectures which is implemented in the source:
2c(1) in Plan 9 describes one more architecture:
- 1: Motorola 68000
where executables will be generated into.
C header files.
where some libraries will be generated into.
where Go standard packages (libraries) will be compiled into.
Let's dive into src :
source codes for the Go tool chain
Plan 9 C library?
buffered IO library
library which contains architecture dependent codes
source codes of Go standard packages
Let's dive into cmd directory.
[acgl] directories contain architecture dependent part of the sources. Architecture independent parts of the Go compiler are in gc directory.
I will read the detail of gc in the next post.