text
stringlengths
0
1.49k
**Ashley McNamara:** We do like it that way. Scott Mansfield has a question that sort of ties back into what you were talking about before, how the changes that you guys are making are not really going to affect compile time. He was asking "Do you think that the speed of compilation is hamstringing the advancements in ...
**David Chase:** So when he says "advancements", he's talking about like 17 zillion amazing optimizations that we could be doing that we're not... At one level yeah, sure, but I have worked on compilers like that, and if you wanna have -- so there's an aspect of Go that makes it... I wanna say this is a tricky conversa...
**Ashley McNamara:** He says it's a loaded question, but thank you.
**David Chase:** I mean, his question is loaded... Absolutely, there are things, there are optimizations that we are unlikely to do because the implementation costs are too high. Otherwise, it is just kind of a pain, and you sort of live with it. In some cases it means that you -- you know, it's one of these usual "thr...
\[24:03\] You know, returning to the SSA representation, it's really interesting because it lets you express a number of optimizations in a very clean way, and it lets you express these transformations in a very clean way. But if you actually look at how SSA is generated, there is a step in there that for some inputs t...
We have also had bugs once in a while, where someone very cleverly took a recursive depth for search numbering transformation kind of an algorithm and they derecursed it and they turned it into something that maintained its own stack, and they subtly perturbed the depth for search numbering; it wasn't really depth for ...
So again, you have a nice, fast compiler, but some of the algorithm's underpinning SSA are delicate and sneaky... So this is the problem. It was like yeah, if we were willing to just burn time, we could pretty easily implement some hairy optimizations, some more aggressive optimizations, but we can't burn time, so what...
**Ashley McNamara:** Right.
**David Chase:** The other reason to prefer simplicity, I think - and this may just be me - is I think one reason to like Go right now is that you do have a prayer of understanding it end to end, whereas a C compiler is crazy nowadays, and a Java compiler, including HotSpot, is absolutely crazy; just bananas. And what ...
**Carlisia Thompson:** It is so refreshing to hear someone like you say that. I actually wanted to confirm that when you were talking about simplicity, you were talking about readability...
**David Chase:** Well, ultimately it's -- I worry a little bit about it from the point of view of security, but... I mean, don't forget who worked on this compiler - [Ken Thompson, Trusting Trust](https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf)... \[laughter\]
**Brian Ketelsen:** Best paper ever.
**Carlisia Thompson:** I'd like for you to tell us more about what you just mentioned about -- I forgot the words you said...
**Brian Ketelsen:** The verified compiler?
**Carlisia Thompson:** Exactly. What is that?
**Ashley McNamara:** Yeah, somebody just asked that.
**Carlisia Thompson:** And why is that important? I'm sorry, and why don't we have it?
**David Chase:** So I don't have direct experience with them, so I wanna be careful I don't go out on a limb and make stuff up. A verified compiler is one where you have proved formally that it's transformations are formally correct. And part of the reason that you don't have these is because if you're gonna talk about...
\[28:15\] Or in the case of so much of our hardware, you have to have an exact specification of how the subset that you use of the hardware behaves, so in particular -- if you don't know for sure what some of these instructions do, then you don't do those instructions.
So part of the obstacle is getting the specifications (clean specs) for the endpoints, and then the rest of the problem is that you get back to the "Boy, I want my code to run fast and I want my compiler to compile code quickly." This forces you either to have a great -- you either end up with a giant compiler, you end...
**Carlisia Thompson:** It's still hard for me to grasp the why, if we have verified -- like, we have proved it, but we just don't have the test... I don't know what that means, but we don't have to go deep into those woods.
**Brian Ketelsen:** I'm just curious whether we have to verify every backend, every different target... So do you have to verify for x86/64 and also for ARM5 or whatever? You have to verify each different target?
**David Chase:** Well, what do you mean? It's verified where it's verified, and if you don't, then you don't know for sure... And you know, we don't know this now. I mean, we're talking about a different world than the one that we're in. The world that we're in - we compile our code and we feel lucky.
**Brian Ketelsen:** I feel lucky every time my code compiles...
**David Chase:** Okay.
**Ashley McNamara:** Same! \[laughter\]
**David Chase:** Certainly when you work on a compiler, there's -- a lot of times I'm working with a buggy compiler, because I'm usually breaking it. But right now, these are only used in very high-risk applications. I believe they are used... My recollections is that some of the interesting work has happened in Englan...
**Brian Ketelsen:** That makes sense.
**David Chase:** I could be wrong on the details, because I'm pretty sure that the guys doing Airbus would care about this.
**Brian Ketelsen:** So I have a follow-up question on something we talked about a little bit before, the idea of adding more optimizations at the expense of compilation speed... Do you think there's a chance that we'll end up with optimizations that are guarded by build flags, like GCC has, for example?
**David Chase:** I assume it has to happen eventually, but I think it's our intent to put it off as long as we can, because every flag that you add then becomes something that you have to test, and then every flag that you add becomes something that you have to document. It complicates everything - it complicates your ...
\[31:59\] I mean, I assume nonetheless that it will have to happen. There will come a time when there's enough extra performance to be had for something that's sufficiently important, but it hasn't happened yet.
**Brian Ketelsen:** So in terms of performance, I know that the [LLVM](https://en.wikipedia.org/wiki/LLVM0) ecosystem was considered very early on in Go, and it's changed quite a bit in the last ten years since they looked at it. Is there a possibility for back-end for Go and LLVM in the future?
**David Chase:** It's being worked on. Dan Macintosh, I can't see him because I've got my door closed, but he sits like 20 feet away from me. Dan Macintosh is working on that. We're not there yet, and it will be a while before we get the same garbage collector, but this might be an option for people who maybe don't nee...
**Brian Ketelsen:** I'm not terribly familiar with LLVM, but wouldn't it bring a lot of extra tooling to the ecosystem, too?
**David Chase:** I don't know, I'm not that familiar with LLVM either.
**Brian Ketelsen:** Okay. We'll find out someday.
**David Chase:** Okay.
**Ashley McNamara:** Kaleb asked the most important question, in my opinion - what kind of pie does the Go compiler team like best?
**David Chase:** Oh, \[unintelligible 00:33:34.17\] key lime versus pecan.
**Ashley McNamara:** You are not limited to those pies...
**Brian Ketelsen:** No, that's a really bad subset of pies. If you don't include banana cream, then it's not even a pie question.
**Carlisia Thompson:** Wait, why is this question even being asked? Why not, like, what kind of muffin, or donuts...? Why pie? Is that an internal joke?
**Brian Ketelsen:** Because pie.
**Carlisia Thompson:** Okay, is that why? Okay...
**Ashley McNamara:** Right now we're just interested in pies, but we could go into the whole pastry line.
**David Chase:** So I can definitely say that for me pie beats muffins, and pie beats donuts. \[laughter\]
**Ashley McNamara:** I don't know if it beats donuts, that's easy, but...
**David Chase:** And personally, I am very happy with either key lime or pecan pie. I did once make six pecan pies for science, where each one was a different recipe, so I could see which one was the best recipe.
**Brian Ketelsen:** Nice.