Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I get the C VERSION of go-lang source code?

Tags:

go

As I know, go-lang is written by C at the beginning, and now it is written by itself. I want to figure out some fundamental implementations of go-lang, such as multi-return-value-of-function, which probably use structure I guess.

But now the go-lang version of go-lang source code has conceal these details, so where can I get the C version of go-lang source code (history version)? I've checked golang.org, nothing found.

Thanks.

like image 596
fding Avatar asked Feb 20 '16 02:02

fding


People also ask

Does Go compile to C?

Yes. it's compiling exactly in the same sense any C program is compiled. Everything is statically linked. Why does golang have runtime which does garbage collection etc.

Is the Go compiler open source?

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

What language is the Go compiler written in?

Go (Golang) ProgrammingThe compiler for the language was originally written in C but is now written in Go as well, which keeps the language self-hosted. Go, as well as many of its IDEs and libraries, is also distributed under the appealing open-source license.

Is Go compiled to machine code?

Because Go is compiled to machine code, it will naturally outperform languages that are interpreted or have virtual runtimes. Go programs also compile extremely fast, and the resulting binary is very small.


1 Answers

Go 1.5 Release Notes

The compiler and runtime are now written entirely in Go (with a little assembler). C is no longer involved in the implementation, and so the C compiler that was once necessary for building the distribution is gone.

Therefore, check out the source code for previous release: release-branch.go1.4.

For example,

git clone https://go.googlesource.com/go --branch release-branch.go1.4 --single-branch go1.4
like image 199
peterSO Avatar answered Sep 20 '22 02:09

peterSO