text stringlengths 0 2.35k |
|---|
**Michael Matloob:** Yeah, it's in the binary. I don't know what the API is... |
**Mat Ryer:** Yeah. But there's some - either method, or... |
**Michael Matloob:** Yeah. |
**Daniel Martí:** It's honestly a bit confusing, because before there was an API to get the module information of yourself, like of your own running binary, but the new API they've added - you can give it a binary path, so you can use it with any binary, without having to shell out to go version -m, blah-blah-blah. It'... |
**Michael Matloob:** Oh, so the buildinfo includes that, the hash. There we go, okay. |
**Daniel Martí:** \[16:03\] And I think the vcs stamping is also a bit confusing to end users, because you tell them "Go 1.18 now stamps vcs buildinfo", but they might say "If I go install a Go main package that I run Go version -m with Go 1.17, where do you see the module version, right?" But where that doesn't work i... |
**Mat Ryer:** Oh, right. Okay. Daniel, your turn to pick one from the list. What else is cool coming in Go 1.18? By the way, do you say one eighteen, one dot one eight, one point eighteen...? How do you say it? |
**Daniel Martí:** Now you're making me doubt myself about how I pronounce these things... |
**Mat Ryer:** Yeah... You just have to forget -- just clear your mind and then just say it. See what happens. |
**Daniel Martí:** One eighteen. |
**Michael Matloob:** Yeah, I say one eighteen. |
**Mat Ryer:** Yeah. Okay. That's good. It is kind of one eighteen; it's not a decimal number, is it? It's semver, so that second number is eighteen. I think we're right. |
**Daniel Martí:** So does that mean that when we reach 1.20 we can go back to one point two? |
**Mat Ryer:** I think for just that release. No, you can't, can you? No, because that's what I mean, it's not decimal. That's it, yeah. Yeah, we got there in the end. |
**Daniel Martí:** So another feature... I mean, it's maybe a bit cheeky that I bring this up, because I worked on this... But `go fmt` without a space now formats files in parallel. So up until we had -- well, you have two tools, which is also confusing. You have `go fmt` without a space, and then you have go fmt. |
**Mat Ryer:** Yeah, it's ironic that the `go fmt` tool can be called in different ways just by changing the formatting... Yeah. |
**Daniel Martí:** Oh, God... The difference between the two tools - and I think it also confuses a bunch of users - is that without a space it takes files and directories, but it doesn't know what packages are... And with a space, it takes the package pattern. So you can give it `./...` for example. And the one that wo... |
**Mat Ryer:** That's cool. Does `go fmt` work only within the context of a file at a time then? Like, it doesn't need to know anything else about types, and things, because it's just doing formatting tasks? |
**Daniel Martí:** Yeah, that's correct. |
**Mat Ryer:** So it makes sense. You just do all that at the same time. |
**Daniel Martí:** Yeah. Even though there's a few tricky bits about that, because initially, my naive implementation was just format each file as a separate goroutine as they come in... But some files are really, really tiny. Think like a `dock.go` file that only has like ten lines, with like a package documentation or... |
**Mat Ryer:** Oh, that's really cool. That's a surprise. I would not have expected it to be doing that... But it's nice to know that that's measured and done properly. That's very cool. Have you used this then? Did you really notice this in practice, the speed improvements? |
**Daniel Martí:** \[19:59\] I think it depends on what people do. I think many people use the tool that works on packages, and then they just format their packages... But I like using the one with directories. So I go to the root of my repository and I just tell it "format everything", including test files, including e... |
**Mat Ryer:** Hm... Matloob, do you format your code? |
**Michael Matloob:** Yes. I mean, we all format our code... |
**Mat Ryer:** It's not a trick question. |
**Michael Matloob:** No, is there anyone who doesn't format their code? |
**Mat Ryer:** Yeah, I don't know... |
**Michael Matloob:** Because I wanna hear about it. It's like a problem we need to solve. |
**Mat Ryer:** Oh, yeah... I don't think so, because you only have to do it a few times, and then when pull requests -- although they improved it in GitHub, where white space was understood better... But it certainly used to be that you'd get just pull requests that every line has changed, because some white space thing... |
**Michael Matloob:** I don't think I've ever run either of the tools... Or I certainly haven't run either of the tools by hand in years; my editors are just set up to format files as I save them. |
**Mat Ryer:** Oh, yeah. I thought you were saying that you just write it in perfect `go fmt` way the first time. |
**Michael Matloob:** Oh, no, no, I don't. |
**Mat Ryer:** Nailed it. |
**Michael Matloob:** I write it in the wrong way and just let the formatter take care of it, like any good Go developer. |
**Mat Ryer:** Yeah, exactly. To be honest, I'll deliberately make mistakes so that when I hit Save, I get a visual clue that is has formatted. Because if I write it and I get it right, and then I hit Save and nothing happens, I'm like, "The computer is no working." So I genuinely sometimes like to see the little shift ... |
**Michael Matloob:** Yeah, that's like a nice way to know that "Oh, the syntax is correct."1 |
**Mat Ryer:** Yeah, that's true. |
**Michael Matloob:** You know it can parse. |
**Mat Ryer:** Yeah, because if it errors, it doesn't complete it. So it actually is a feedback loop thing. There you go, a tip there for everyone. |
**Daniel Martí:** I've actually done that with tests. If you write a ton of software and some tests, and you run the tests and everything is green, you often go "I don't believe that. Let me break one of the tests to see if I'm doing something really dumb right now." |
**Mat Ryer:** Yeah, absolutely. In TDD you talk about that red-green testing for that reason; you have to see the test fail, so you know it's saying something useful; and then when you fix it -- that's true. If I write some code, even if I'm just running it, and I'm gonna run it myself and look at the results in the te... |
Okay, we've also got the pacer redesign in the garbage collector. That's interesting... What's going on there then? |
**Daniel Martí:** I brought this up because I think it's a very interesting topic... But I think we should also warn that none of us here are experts in this area. So we can talk about it at a high level, but I'm gonna stop there. If anybody wants to read more about it, we can mention the issue number and then they can... |
**Mat Ryer:** Yeah, fair enough. Good disclaimer. |
**Daniel Martí:** To give a bit of an intro, the way I understood it - because again, I've just read this... The GC pacer - it's the part of the garbage collector that decides when a new collection should happen. It's sort of the thing that times when the GC should be doing its work. Because if it happens too often, th... |
It seems like the GC pacer was designed a while ago. For the purpose that it was designed, it was good, but over time it's accumulated a bunch of debt and a bunch of quirks... And they've sort of sat down and said "Okay, let's redesign it in a way that it does a lot better in these edge cases that we've found in produc... |
**Mat Ryer:** \[24:16\] Oh, it's very exciting. I'm really interested whenever there are these kind of really low-level -- because it's funny, when you dig into these little subsystems, they're just like other types of programs. They are just doing the same things that we're doing in our programs, but it's such an inte... |
**Michael Matloob:** No... I mean, I am not closely acquainted with it, but I think any runtime improvements are well-appreciated. Good work, team. |
**Mat Ryer:** Yup. And there's another Michael who I think was the author of the redesign, is that right? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.