text stringlengths 0 1.49k |
|---|
**David Chase:** Oh, I'm seeing the Slack channel; I wasn't paying attention. |
**Ashley McNamara:** It's fine, I'll read them. |
**David Chase:** \[07:52\] So my personal hobby horse this month is that we need better benchmarks, but that's not the same as the technical work on the compiler, even though it's really important... Because our benchmarks are not the things that people run that they actually care about. Not all the architectures recei... |
So I'm thinking about what's the most accessible part of the compiler, and the most accessible part of the compiler is to me at least - I could be wrong - where we lower the code from generic SSA to the various architectures' instruction sets. That's pattern matching, and it's pretty obvious to see what it's doing. The... |
**Ashley McNamara:** \[unintelligible 00:09:22.27\] |
**Brian Ketelsen:** So that brings up a question from me though... Do we no longer have the intermediate Go Assembler that's output? Is there still a step that outputs Go Assembler, the old [Plan 9](https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs) assembler, which then gets translated, or is that step gone now? |
**David Chase:** It's essentially still there. It's building internal assembler data structures. I don't think we're actually writing a file. |
**Brian Ketelsen:** Oh, I see. |
**David Chase:** If they know we're not writing a file. |
**Ashley McNamara:** There's a follow-up question to Matt's original question about how to contribute, and he was asking if there is any recommended reading for compiler internals? |
**David Chase:** Hang on just a second. |
**Brian Ketelsen:** I'm fully expecting David to come back with the title of his book that he wrote. |
**Ashley McNamara:** Right.. |
**David Chase:** No, I have not written a book. \[laughter\] I was gonna grab three books that I know of... I don't actually know if any of these do a good job of covering SSA. Okay, so we have one whole sub-chapter in Cooper & Torczon, so that's one... That's _Engineering a Compiler_... |
**Ashley McNamara:** And what you can also do if you want to research that question a little bit, is you can drop it in the Slack channel later, and I can help remind you. |
**David Chase:** Okay, that might be a good thing to do. Yeah, so I have several compiler books; I know tha Andrew-Appel has written several for various programming languages, which might be interesting to look at. If you are already familiar with a particular programming language, that is another choice. |
**Brian Ketelsen:** So here's a question - is there a compiler that people consider to be like a canonical compiler implementation or a particularly easy to access or easy to grab compiler implementation? Is there one compiler that's so much nicer than all the others? |
**David Chase:** There used to be one... [LCC](https://en.wikipedia.org/wiki/LCC_(compiler)) had a reputation. It's by Fraser and Hanson. Some of this is a little old, but it was a relatively small, relatively easy to comprehend compiler. I don't think that the Go compiler is necessarily that scary. |
**Ashley McNamara:** \[12:04\] I don't know, it seems pretty scary to me. I want you to explain everything like I'm five. |
**David Chase:** Yeah, so the problem is I'm sitting here thinking of the compilers I've worked in, and what happens is that anything that's successful gets ported to a lot of architectures, and then as soon as it gets ported to a lot of architectures, that introduces all the generality that you need to support a bunch... |
**Ashley McNamara:** \[laughs\] It's not bad... |
**Brian Ketelsen:** It's not bad... |
**Ashley McNamara:** What can make it better? |
**David Chase:** So this is a problem, because it means "Better for whom?" We have stuff in the pipeline right now that is gonna be way better for compile time, and a little bit better for performance. We think that if we improve the import/export again - we already improved it once; if we do it again, then we can make... |
**Brian Ketelsen:** Yeah, that makes some sense. I mean, there's always a cost. |
**Carlisia Thompson:** What else is in the pipeline for the compiler? |
**David Chase:** For 1.10? |
**Carlisia Thompson:** Well, yeah... 1.9, 1.10, 2.0... |
**David Chase:** So I don't know everything, I know around me. We tried to get in a CL, a big CL, that would have improved the debugging experience for optimized code, and we didn't make it... So that is definitely in the pipeline. We want to have a better story for that. In particular if you have a crash and you get a... |
**Carlisia Thompson:** And what was the CL for? |
**David Chase:** Well, so when you run SSA, it tends to break up variable lifetimes into smaller chunks; so they'll go in and out of registers... Right now they're still homed to the same stack slot, but over this basic block it might be in a register, and then a little while later it might be in a different register, ... |
We have been getting more and more trouble with loop. So I've mentioned that the cooperative scheduling in Go is enforced by the compiler, and right now it's kind of lightly enforced. It enforces it when you enter a function or method. But if you are running in a tight loop that has no function calls within it, it does... |
\[16:21\] Then there's this one guy running a tight loop, and the GC tries to tap him on the shoulder and he does not respond... And does not respond, and does not respond, and does not respond, so everything hangs up, and it can be an appreciable fraction of your pause time for GC. In some rare cases, it can be long. |
We need to fix that and we need to change the compiler to add a preemption check on every loop package. The problem with that is it slows down your loops a little bit, and some loops it slows down a lot. So there's follow-up work to try to figure out if we can mitigate this cost using a clever implementation. We have a... |
The garbage collector guys are looking into whether they can make generational collection work, and that will add a write barrier that's gonna be on all the time, which will then motivate -- it's still like a lot harder to write barrier optimizations. I don't know who's gonna be doing that. It might be me, it might be ... |
**Carlisia Thompson:** I wonder if you have a feature that is at the top of your wish list that if you had no constraints you could implement that and make Go a ton better... |
**David Chase:** I hate to say "if it had no constraints", because that's not really -- that's not really Go, and... |
**Ashley McNamara:** Pretend it's Magic. |
**David Chase:** Pretend it's Magic...? Oh, man... |
**Brian Ketelsen:** Maybe no time constraints or no budget constraints. |
**David Chase:** Well... So you're talking completely compatible -- are we talking about Go the language or Go its implementation? |
**Carlisia Thompson:** Go the language. I'm just trying to assess where your mind is in terms of what you admire about Go and how do you see it becoming better than it is. It doesn't really matter, I just wanted to get a sense for how you think about Go. |
**David Chase:** So if I were to say "Look at the proposals that went by in the last year or so for Go 2", the one that I almost thought they could have put in - I think it had syntax that would have allowed us to put it in if we wanted to - was the multidimensional slices. That's really kind of my Fortran background s... |
\[20:12\] It's tremendously useful for a certain kind of computing, and the people for whom it's useful - this is the Fortran crowd. They've sort of been stuck at Fortran for ages. C++ has done amazing things for them, but often you have to be willing to sign up for crazy C++ templates. |
Go is just a nice, clean, comprehendable language; this is a little thing, and you could do -- it appeals to me. _Generics_? Oh yeah, _Generics_ would be cool if we could agree on what they meant, and if we could agree on their implementation characteristics of what we want it to do, and there's all sorts of risks wher... |
**Carlisia Thompson:** Yeah, of course. |
**David Chase:** So the one for me that looked like the most likely to win would be the multidimensional slices. I liked that a lot. It didn't make it in, and that made me sad. |
**Carlisia Thompson:** I wanna flip this question around and ask you what is in Go today from a compiler perspective that you would be happy removing? Maybe that's not even a fair question, because as far as functionality, Go is already so minimalistic... But I was wondering if you had one or two things that you could ... |
**David Chase:** It's not a compiler thing... I have opinions about how things go back and forth to Cgo, and we're close and I think that we're converging... We may have already met and I may have just misunderstood, because I don't do enough Cgo programming to get a really good feel for some of the details. Nah, that'... |
**Brian Ketelsen:** We like it that way. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.