Live data from Hacker News

“This change deletes the C implementations of the Go compiler and assembler”

github.com

81–90 of 137 posts

Re: “This change deletes the C implementations of the Go compiler and assembler”

#84

Earlier quoted context omitted.

So if you want to avoid trusting trust, you need to audit not only a C compiler and the source code for the Go compiler you plan on using, but also every past Go compiler as well?

You could audit the Go source and then use the diverse double compiling technique[0] to verify that the binary you're using corresponds to that source code. [0] http://www.dwheeler.com/trusting-trust/dissertation/html/whe...

You mean, audit a large number of independently-written Go compilers?

Re: “This change deletes the C implementations of the Go compiler and assembler”

#86
post #82

Nice. That's a step forward. Another bit of legacy code bites the dust. Another step forward to the post-C world we need. (If you want to compile with a different compiler as a check, there's an LLVM-based compiler for Go.)

Go is also supported in GCC, as GccGo.

Re: “This change deletes the C implementations of the Go compiler and assembler”

#87

Earlier quoted context omitted.

You could audit the Go source and then use the diverse double compiling technique[0] to verify that the binary you're using corresponds to that source code. [0] http://www.dwheeler.com/trusting-trust/dissertation/html/whe...

You mean, audit a large number of independently-written Go compilers?

Nicely done. To be fair though, Go is just 6 years old and still evolving.

Re: “This change deletes the C implementations of the Go compiler and assembler”

#88
post #83

So, if I'm understanding this correctly, they are to re-write the Go compiler in Go, and compile it using the currently published compiler (i.e. 1.4)? Could someone, kindly, explain how future versions would be built? Thanks!

My understanding is that they wrote code that translated the C code for the original Go compiler into Go code. This translation wasn't fully general -- it made assumptions about how the C code was written -- but it allowed the port from C to Go to be very precise (i.e. bug for bug). So now that the Go compiler written in Go can compile Go, that's what they'll use going forward, and they will slowly work to make it into more idiomatic Go instead of machine-generated Go.

So to answer your question, this new Go-written-in-Go compiler will initially be compiled by the Go-written-in-C compiler. The output from that will be an executable Go-written-in-Go compiler, and _that_ will be used to compile itself in the future. I.e. Go compiler version 1.4 will be used to compile Go version 1.5 will be used to compile Go version 1.6...

Keep in mind that this is not at all unusual. The C compiler GCC has been compiled using older versions of GCC for a long time. Having a compiler compile itself is a sort of milestone that many languages aspire to as a way of showing that the language is "ready."

Re: “This change deletes the C implementations of the Go compiler and assembler”

#89
post #26

Earlier quoted context omitted.

You should always be able to build a Go 1.x compiler with just the 1.4 tool chain binaries. We have committed to sticking to the Go 1.4 language and libraries for the compiler tool chain.

Where is this fact documented? Are patches tested against 1.4 tool chain binaries?

Here https://docs.google.com/document/d/1OaatvGhEAq7VseQ9kkavxKNA...

In the proposal section.

Re: “This change deletes the C implementations of the Go compiler and assembler”

#90
post #83

So, if I'm understanding this correctly, they are to re-write the Go compiler in Go, and compile it using the currently published compiler (i.e. 1.4)? Could someone, kindly, explain how future versions would be built? Thanks!

Future versions will still be built with any current published compiler. There are binary releases for each major release, and it's not hard to avoid using new language features in the compiler, so building from source only requires the most recent binary release (at worst).
Post reply on HN