Live data from Hacker News

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

github.com

101–110 of 137 posts

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

#101

Earlier quoted context omitted.

What's your counter-proposal? If you're building a new language, you need a new AST. You can't represent Go source code in a C++ AST. There are alternate compilers for Go, in the form of gccgo and llgo. But those are both very slow to build (compared to the Go tree that takes ~30s to build the compiler, linker, assembler and standard library). And the "gc" Go compiler runs a lot faster than gccgo (though it doesn't p…

> There are alternate compilers for Go, in the form of gccgo and llgo. But those are both very slow to build (compared to the Go tree that takes ~30s to build the compiler, linker, assembler and standard library). For any non-Gophers reading this: I write Go as my primary language, and have for the past two and a half years. I just timed the respective compilation speeds on a handful of my larger projects using both…

Thanks. That's good data. I haven't seen any measurements for a few years. It's good to see that gccgo has caught up. Which version of gc did you test?

Yes, the release schedule is another important reason for building our own toolchain. Being in control of one's destiny is often underrated.

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

#102
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?

> Where is this fact documented?

http://tip.golang.org/doc/install/source#go14

> Are patches tested against 1.4 tool chain binaries?

The builders build the tool chain with Go 1.4, so the build dashboard will show failures if a patch incompatible with 1.4 is submitted. (We have pre-commit trybots that do the same.)

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

#103

Earlier quoted context omitted.

> There are alternate compilers for Go, in the form of gccgo and llgo. But those are both very slow to build (compared to the Go tree that takes ~30s to build the compiler, linker, assembler and standard library). For any non-Gophers reading this: I write Go as my primary language, and have for the past two and a half years. I just timed the respective compilation speeds on a handful of my larger projects using both…

Thanks. That's good data. I haven't seen any measurements for a few years. It's good to see that gccgo has caught up. Which version of gc did you test? Yes, the release schedule is another important reason for building our own toolchain. Being in control of one's destiny is often underrated.

On this machine, gc 1.4.1 vs. gcc 4.9.2 (with no extra flags). My other machine has gc's tip, but runs Wheezy so it's probably an older version of gcc... it wasn't much different either way. I would barely have noticed it if I hadn't been timing it.

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

#104

I still just don't understand why they insist on building their own toolchain. It just doesn't make sense to me. When you set out to build a programming language, what is your objective? To create a sweet new optimizer? To create a sweet new assembler? A sweet new intermediate representation? AST? Of course not. You set out to change the way programmers tell computers what to do. So why do this insist on duplicating:…

I read somewhere (but I can't think of the keywords to find it now) that they found the greater flexibility in owning their toolchain was worth the cost. For example they changed their data layout for GC purposes and changed the segmented stack approach over the course of their development and had they been tied to LLVM or gcc they'd have spent much of their time fighting against those implementations, or politicing to convince the maintainers to add additional complexity to their systems for an unproven langauge. (My example is weak because I am trying to retell their reasons and my recollection is vague.) I think they still haven't succeeded in bringing gcc up to par with their current approach.

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

#105
post #104

I still just don't understand why they insist on building their own toolchain. It just doesn't make sense to me. When you set out to build a programming language, what is your objective? To create a sweet new optimizer? To create a sweet new assembler? A sweet new intermediate representation? AST? Of course not. You set out to change the way programmers tell computers what to do. So why do this insist on duplicating:…

I read somewhere (but I can't think of the keywords to find it now) that they found the greater flexibility in owning their toolchain was worth the cost. For example they changed their data layout for GC purposes and changed the segmented stack approach over the course of their development and had they been tied to LLVM or gcc they'd have spent much of their time fighting against those implementations, or politicing…

Are you thinking of this comment?

https://news.ycombinator.com/item?id=8817990

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

#106
post #104

I still just don't understand why they insist on building their own toolchain. It just doesn't make sense to me. When you set out to build a programming language, what is your objective? To create a sweet new optimizer? To create a sweet new assembler? A sweet new intermediate representation? AST? Of course not. You set out to change the way programmers tell computers what to do. So why do this insist on duplicating:…

I read somewhere (but I can't think of the keywords to find it now) that they found the greater flexibility in owning their toolchain was worth the cost. For example they changed their data layout for GC purposes and changed the segmented stack approach over the course of their development and had they been tied to LLVM or gcc they'd have spent much of their time fighting against those implementations, or politicing…

LLVM supports precise GC now via the late safepoint placement infrastructure [1]. This infrastructure should be sufficient to support both the copying stacks and a precise GC.

This is a recent addition and did not exist at the time Go was created, however.

[1]: http://llvm.org/docs/Statepoints.html

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

#107

I still just don't understand why they insist on building their own toolchain. It just doesn't make sense to me. When you set out to build a programming language, what is your objective? To create a sweet new optimizer? To create a sweet new assembler? A sweet new intermediate representation? AST? Of course not. You set out to change the way programmers tell computers what to do. So why do this insist on duplicating:…

> I still just don't understand why they insist on building their own toolchain. It just doesn't make sense to me.

To quote rsc from https://news.ycombinator.com/item?id=8817990:

"It's a small toolchain that we can keep in our heads and make arbitrary changes to, quickly and easily. Honestly, if we'd built on GCC or LLVM, we'd be moving so slowly I'd probably have left the project years ago."

"For example, no standard ABIs and toolchains supported segmented stacks; we had to build that, so it was going to be incompatible from day one. If step one had been "learn the GCC or LLVM toolchains well enough to add segmented stacks", I'm not sure we'd have gotten to step two."

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

#108

I still just don't understand why they insist on building their own toolchain. It just doesn't make sense to me. When you set out to build a programming language, what is your objective? To create a sweet new optimizer? To create a sweet new assembler? A sweet new intermediate representation? AST? Of course not. You set out to change the way programmers tell computers what to do. So why do this insist on duplicating:…

I was impressed by the toolchain when I first peaked at Go because it was dead simple to get up and running on any platform, especially Windows.

For gcc you have to deal with MinGW. Isn't LLVM just now getting to the point where it can build native Windows applications?

This is one area where I hope Rust makes progress. MinGW/Msys2 is just kind of gross stuff to deal with.

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

#109

Here we go again. Another compiler that can't be bootstrapped from source code. It's a packaging nightmare. Another magic binary to trust not to have a Thompson virus.

> Another compiler that can't be bootstrapped from source code. It can be bootstrapped from source - it just needs to be bootstrapped either using gccgo[0], or using the 1.4 compiler (which is guaranteed to work for all 1.x compilers, not just 1.5) > Another magic binary to trust not to have a Thompson virus. "Reflections on Trusting Trust" gets posted on HN regularly, and it's an interesting exercise, but you are fa…

http://www.dwheeler.com/trusting-trust/ Though the diversity available for a go compiler written in go isn't very tremendous.

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

#110
post #80

So what is the bootstrap process going to be? Other than already have a Go compiler I mean. Or is it have a Go cross compiler? Maybe it matters less, you used to always assume bootstrap from C but that more or less died with C++ based compilers, although you can do a multistage bootstrap from the last gcc before C++ still.

> So what is the bootstrap process going to be? Other than already have a Go compiler I mean. Or is it have a Go cross compiler? What's the bootstrap process for the C compiler part of the compiler?

The is no C code in the compilers anymore.
Post reply on HN