Archive

Blog on All Things Cloud Foundry

Golang Internals, Part 6: Bootstrapping and Memory Allocator Initialization

Siarhei Matsiukevich

Go Gopher

All parts: Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6

This post is the continuation of our Golang Internals series. It explores the bootstrapping process, which is key to understanding the Go runtime, in more detail. In this part, we will run through the second portion of the starting sequence, learn how arguments are initialized, what functions are called, etc.

(more…)

2 Comments

Golang Internals, Part 5: the Runtime Bootstrap Process

Siarhei Matsiukevich

Golang Internals Go Runtime and BootstrappingAll parts: Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6
 
The bootstrapping process is the key to understanding how the Go runtime works. Learning it is essential, if you want to move forward with Go. So the fifth installment in our Golang Internals series is dedicated to the Go runtime and, specifically, the Go bootstrap process. This time you will learn about:

  • Go bootstrapping
  • resizable stacks implementation
  • internal TLS implementation

Note that this post contains a lot of assembler code and you will need at least some basic knowledge of it to proceed (here is a quick guide to Go’s assembler). So let’s get going!

 
(more…)

3 Comments

Golang Internals, Part 4: Object Files and Function Metadata

Siarhei Matsiukevich

Golang-Part-4-Object-Files-and-Function-MetadataAll parts: Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6

Today, we’ll take a closer look at the Func structure and discuss a few details on how garbage collection works in Go.

This post is a continuation of “Golang Internals, Part 3: The Linker and Go Object Files” and uses the same sample program. So, if you haven’t read it, I strongly advise that you do this before moving forward.
 
(more…)

No Comments

Golang Internals, Part 3: The Linker, Object Files, and Relocations

Siarhei Matsiukevich

All parts: Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6

15-03-11-Golang_Internals_the_Linker_and_Object_filesToday, I will speak about the Go linker, Go object files, and relocations.

Why should we care about these things? Well, if you want to learn the internals of any large project, the first thing you need to do is split it into components or modules. Second, you need to understand what interface these modules provide to each other. In Go, these high-level modules are the compiler, linker, and runtime. The interface that the compiler provides and the linker consumes is an object file and that’s where we will start our investigation today.
 
(more…)

No Comments

Golang Internals, Part 2: Diving Into the Go Compiler

Siarhei Matsiukevich

golang-internals-the-go-compiler

All parts: Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6
 
Do you know what exactly happens in the Go runtime, when you use a variable via interface reference? This is not a trivial question, because in Go a type that implements an interface does not contain any references to this interface whatsoever. Still, we can try answering it, using our knowledge of the Go compiler, which was discussed in the previous blog post.

So, let’s take a deep dive into the Go compiler: create a basic Go program and see the internal workings of the Go typecasting. Using it as an example, I’ll explain how a node tree is generated and utilized. So, you can further apply this knowledge to other Go compiler’s features.
 
(more…)

3 Comments

Golang Internals, Part 1: Main Concepts and Project Structure

Siarhei Matsiukevich

All parts: Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6
 
15-02-26-Golang-InternalsThis series of blog posts is intended for those who are already familiar with the basics of Go and would like to get a deeper insight into its internals. Today’s post is dedicated to the structure of Go source code and some internal details of the Go compiler. After reading this, you should be able to answer the following questions:

1. What is the structure of Go source code?
2. How does the Go compiler work?
3. What is the basic structure of a node tree in Go?

(more…)

4 Comments

Benchmarks and Research

Subscribe to new posts

Get new posts right in your inbox!