你可以在Go语言的官方网站上获取Go语言的C版本源代码。

huangapple go评论74阅读模式
英文:

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

问题

据我所知,Go语言最初是用C语言编写的,现在已经完全用Go语言自身重新实现了。我想了解一些Go语言的基本实现,比如函数的多返回值,我猜可能使用了结构体。

但是现在Go语言的源代码版本已经隐藏了这些细节,那么我在哪里可以找到Go语言的C语言版本的源代码(历史版本)呢?我查看了golang.org,没有找到。

谢谢。

英文:

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.

答案1

得分: 9

> Go 1.5 发布说明
>
> 编译器和运行时现在完全使用 Go 语言编写(有一点汇编语言)。C 语言不再参与实现,因此以前用于构建发行版的 C 编译器已经消失。

因此,请查看以前版本的源代码release-branch.go1.4

例如,

git clone https://go.googlesource.com/go --branch release-branch.go1.4 --single-branch go1.4
英文:

> 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

答案2

得分: 0

r56版本是第一个稳定版本,对应于weekly.2011-03-07.1。

代码在github上,包括C、bash和go。

英文:

> The r56 release was the first stable release and corresponds to weekly.2011-03-07.1.

The code is on github. It includes C, bash, go.

答案3

得分: 0

我使用Go 1.4.2来引导更新的Go版本。我刚刚在本周进行了Go 1.6的构建。

看起来这里有一个可用的Go 1.4.3版本:https://storage.googleapis.com/golang/go1.4.3.src.tar.gz

英文:

I use Go 1.4.2 to bootstrap newer Go versions. I did a Go 1.6 build just this week.

It looks like there is a Go 1.4.3 available here: https://storage.googleapis.com/golang/go1.4.3.src.tar.gz

huangapple
  • 本文由 发表于 2016年2月20日 10:00:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/35518251.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定