text stringlengths 0 2.35k |
|---|
**Michael Matloob:** Yeah... |
**Mat Ryer:** Do you know all the other Michaels on the Go team? Have you got together yet with all the rest of the Michaels? |
**Michael Matloob:** There's a Michael -- |
**Mat Ryer:** Or it may just be a contributor, actually... |
**Michael Matloob:** There's two... Are there more than two? Or they're three, I guess, including myself. |
**Mat Ryer:** Okay. |
**Michael Matloob:** I don't wanna be forgetting anyone, so if I forgot -- |
**Mat Ryer:** No, I think we should spend time on this. Don't forget anyone. |
**Michael Matloob:** We should not spend time on this... |
**Mat Ryer:** Mind you, you're just telling me a number; even if you forgot a Michael, they don't know which one -- they don't know that they've been forgotten. I think it's safe. |
**Michael Matloob:** There you go. So everyone can assume that I included them in the list of Michaels. |
**Mat Ryer:** Yeah. So calm down, Michaels; you were counted. All Michaels have been accounted for. |
**Michael Matloob:** Yeah. |
**Mat Ryer:** Excellent. |
**Daniel Martí:** I was thinking, before we go on to the next topic, if anybody wants to read about this, the issue number is \#44167. And at the end of the issue, which is very short, there's a link to the full proposal design, which is very long... And you can read that carefully, and get the full picture. |
**Mat Ryer:** Yeah. It looks very well written. And we'll post the link to all of these in the show notes, so you'll be able to go and actually look at the original issues. And honestly, notice that some of these issues aren't created by members of the Go team, or even popular contributors like Daniel, who've contribut... |
**Break:** \[26:49\] |
**Mat Ryer:** Does anyone have the M1 chip? Apple's M1. |
**Michael Matloob:** I have it on my personal laptop. |
**Mat Ryer:** Yeah, that accounts. It's fast, isn't it? |
**Michael Matloob:** Oh yeah, it's great. I've been surprised with how fast it is. |
**Mat Ryer:** Me too. I got a new MacBook Pro recently, and it's phenomenal, absolutely. But Go had support for the M1 chip for quite a while, didn't it? What does that look like? How do we support another chip? Could someone just briefly -- and I do mean briefly; we don't need to get into the weeds of it. But what do ... |
**Daniel Martí:** I do seem to recall that when the M1 first came out, Go did already support ARM64, so the 64 version of the ARM architecture... But binaries build for Go targeting the architecture didn't work out of the box, for one reason because there wasn't a darwin/ARM64 port yet. So Go did support Mac, and it su... |
**Mat Ryer:** Yeah, yeah. Oh, that's very cool. Well, I just noticed it started working. |
**Michael Matloob:** There's also a lot of work that needs to be done when we're making releases; when Apple makes changes to their operating system, we often have to change the infrastructure we use to produce the Go distributions that people get... And that takes a lot of work. I kind of just wanna mention all the wo... |
**Daniel Martí:** So I imagine every time Apple says a new major version of macOS is coming, I imagine some people start sweating, thinking "Oh no, what is coming..." \[laughter\] |
**Michael Matloob:** I mean, sometimes there's nothing, but sometimes they're destructive. Was it Catalina that they introduced major sign in requirements that caused big problems. |
**Mat Ryer:** Well, yeah, again, we do appreciate all that work. Newer x86-64 machines are also getting improvements, aren't they, Daniel? |
**Daniel Martí:** Yeah, so that's a good segue, because going from, for example, ARM-based machines, there's a lot of versions; if you have an old phone, I believe that's gonna be like ARM version 6. But later phones are gonna be ARM version 8 or 9, which is 64 bits. And if compile a binary that's targeting the lowest-... |
\[32:13\] And sort of marrying the same environment variable for ARM64, now we have Go AMD64, and it targets one of four versions. These are sort of standard versions between Intel and AMD, where roughly speaking I believe version 1 is like the common denominator; it's basically every single machine that's a valid AMD6... |
So if for example you knew you were targeting a cloud machine and you know the cloud machine has all these new instructions, you can swap from the older version 1 to version 3 or 4, and maybe you're gonna save 5% or 10% CPU cost, depending on what kind of code you're running. |
**Mat Ryer:** And presumably, if you choose a higher number and then the architecture is lower, then that's a problem. |
**Daniel Martí:** I believe it's just gonna refuse to run. It's gonna say not supported. |
**Mat Ryer:** Okay, cool. Yeah, it makes sense. There you go, that's good to know. Often I'm so abstracted from the physical hardware in certain environments, to where I would be able to make use of that... But there's certainly some cases where I could probably use that today. I appreciate you telling me about that on... |
**Daniel Martí:** And even if you think "Well, my workload is not that special", I believe in the Go AMD64 version 3 there's an instruction that the runtime garbage collector can use to quickly scan memory for pointers or something like that, in a way that essentially batches the work and makes it a lot faster... So yo... |
**Mat Ryer:** Oh, so even if you're not gonna make use of it, maybe the Go tooling and runtime and bits and pieces do. Very interesting. I do wanna speak about one more subject before we get onto workspaces, if we can... And this is something I use a lot, and these are the templates in Go. So we've got text template an... |
**Daniel Martí:** Yeah. So I added a couple here, which are pretty simple to understand, I think. They both revolve around control flow, or logic, if you wanna think of it that way. So one is about adding break and continuing. So it's the same feature that you have in regular Go loops, but for ranges within a template. |
And the other one is that the and and or operators in boolean expressions now short-circuit in a template, like in Go. Which means that if you do a or b and a is true then b is not evaluated. Whereas right now it evaluates all the expressions and then works out the boolean expression. |
**Mat Ryer:** Yeah. And the result on the expression itself is the same, isn't it? But if you're calling functions within that, then you can save those functions; they won't need to get called. So that short-circuiting sometimes is very important. That's very nice to know... |
So the break and continue - I guess they are quite simple then. So continue is gonna loop back and -- actually, I'm not sure it is that simple... Because the template is kind of declarative, isn't it? What does a continue do then? What happens if there was, within the block, content after the continue? Is that skipped? |
**Daniel Martí:** So you can think of templates as sort of scripts. I don't believe they let you run code forever... At least not that I can remember. But they do have a range statement, where you can say range over for example a slice. And then within that body you can set variables, or you can template them. |
\[36:09\] Like, if you just type something without using the brackets, that's gonna be output as part of the template. If you have two blocks of code within a range, and then between you say continue, then the second block is gonna be omitted, and then you're gonna go back to the top of the range. |
**Mat Ryer:** Okay. So that is how it works in Go, so that should feel quite natural. But that is quite unusual for templating. I don't think I've seen that before. |
**Daniel Martí:** It is a bit unusual, yes. |
**Mat Ryer:** Very cool. Well, we have somebody here, of course, Michael Matloob, who has done a fair bit of work recently on workspaces. This is coming in Go 1.18. Michael, could you just tell us briefly what are Go workspaces? What problem do they solve? |
**Michael Matloob:** So just like at a simple level, the Go command in the module mode allows you to have a single main module that you're working on. That's the module that your current directory is in, and all the files in the module, all the packages in the module are the packages that Go builds by default. And if y... |
Now, workspaces - you have more than one main module. Those are modules where you are making edits and go builds from, rather than getting it from a specific version. So workspaces allow you to say "These are the modules on disk that I'm working on", and those are the base that the minimal version selection uses when c... |
We think this is gonna be useful because we've gotten a lot of feedback from people who work across multiple modules. In fact, that was one of the number one complaints we saw in the Go user survey, people working with modules - they had problems when working on multiple modules; they found it cumbersome. So we hope th... |
**Mat Ryer:** Yeah, this is definitely something I've encountered. Do you think people were overusing modules? Do you think that we were doing something wrong? It felt like that, because we were kind of fighting with the tools a little bit... |
**Michael Matloob:** What do you mean overusing modules? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.