Latest / Cup o' Go / 🎉 Surprise! 😯 A new security release is coming!
Transcript
- 0:00Jonathan Hall: This show is supported by you, our listener. Stick around to Life for the News to hear more about that. This is Cup of Go for 05/02/2025. Keep up to date with the important happenings in the Go community in about fifteen minutes per week. I'm Jonathan Hall.
- 0:23And I'm Shay Nehmad. And we have a surprising show for you. Surprising because we haven't really planned the whole thing very well, so it'll be a surprise for us too.
- 0:31Shay Nehmad: Yeah. We'll we'll figure it out at runtime. It's it's JIT podcasting, just in time podcasting. There it is. Jonathan frantically moving the cards around in our trail board as we speak.
- 0:42While you're adjusting all that, I'll tell you, I had a pretty intense week. Oh, yeah? Boy, am I happy to sit with you and just talk about Go. I was in San Francisco for RSA, which is like the big security conference because my company is a cybersecurity company, the startup. Mhmm.
- 0:59I met like the guys from my previous startups there. Like basically, the entire cybersecurity scene of Tel Aviv was in San Francisco last week.
- 1:08Jonathan Hall: Of course. Yeah. Yeah.
- 1:09Shay Nehmad: It was a lot of fun. You're seeing, like, your old companies doing very well in the trade show, having, the booth. Mhmm. I came up to the booth and, you know, it's an American salesman who joined the company after I left, so doesn't know me. Like, what are you guys about?
- 1:26And he's like starting to tell me about the the features that like I built. That was that was a lot of fun. But San Francisco is very intense.
- 1:35Jonathan Hall: Yeah. Yeah.
- 1:37Shay Nehmad: It's very tiring. And I worked on, like, the current product, and I moved to my new apartment. Wow. If anybody has a couch in the San Jose area, I would love to have a couch or a desk. Desk also good.
- 1:50Or a TV, TV also good.
- 1:52Jonathan Hall: I'm curious though, did you happen to run into maybe, I don't know, Yuhoe or anybody else knows about Go Security stuff who could key us in to what's coming up on Tuesday?
- 2:01Shay Nehmad: I don't know. I really all the people there were salespersons. It's not nobody there was like with their laptop doing security research. I can promise you that. I can we probably know the people who pay Yuho, but not you
- 2:16Jonathan Hall: or those people. All right. So what that means is that the first surprise of the show for all of us is that Go one point two four point three and one point twenty three point nine will be coming out on Tuesday with a surprise security fix in them.
- 2:31Shay Nehmad: Mark your calendars.
- 2:32Jonathan Hall: Mark your calendars.
- 2:34Shay Nehmad: We don't know what's going on there yet. I did some digging. I think it's related to some Chinese operating system, but it might just be like a CVE mix up. Here's another surprising thing, Jonathan. You ready?
- 2:45Jonathan Hall: I'm ready.
- 3:06Shay Nehmad: There's a conference.
- 3:08Jonathan Hall: Yes. And the speakers who will be there are the surprise because we don't know yet.
- 3:13Shay Nehmad: You could, hand in your call for papers. Right? They're they're looking for papers.
- 3:18Jonathan Hall: They're looking for papers. You have until June 3. So about a month.
- 3:25Shay Nehmad: When and when? Like, is it online? Is it somewhere?
- 3:28Jonathan Hall: So it will be in Lehi, Utah on twenty four October twenty twenty five. Last year, it was twenty five October twenty twenty four. So we just put those digits around and we got the new date. Aside from that, we have, we mentioned this last week, but the details were finalized May 7. So that's this week in Atlanta.
- 3:46I will be presenting at the Go Atlanta user group meetup on how to write idiomatic tests in Go. So if you wanna come there and you're in the area.
- 3:55Shay Nehmad: You give us like a How do you write idiomatic tests in Go?
- 3:59Jonathan Hall: Well, I'm gonna spend the next weekend cramming on learning how to do that because I don't really know.
- 4:05Shay Nehmad: So far all your tests have been like super shitty.
- 4:09Jonathan Hall: Oh, they definitely are. Yeah, some of the highlights will be why the Go advice is to not use assertion libraries, how to write table driven tests. I'll talk about test containers. We had Manuel de la Pena on the show a while back to talk about test containers. He's the maintainer of that.
- 4:27So I'll probably do a plug for that. And probably Adelina's book, TTD in Go. So yeah, those are some of the things I'll be talking about.
- 4:35Shay Nehmad: No, like how to write tests with AI, AI, AI? A talk that's not about AI, is that allowed in 2025?
- 4:41Jonathan Hall: I don't know. I guess I'll just see if I get the rotten fruit thrown at me at the at the presentation.
- 4:47Shay Nehmad: I would ask Claude if it's if it's fine or not. I'll just say quickly that I'm super happy with, test containers and I've been surprised at how fast you can spin up multiple of them on my new, like, m four machine. I've just split up my tests into six, and I'm spinning up, like, six Postgres containers. It takes, like, three seconds. Yeah.
- 5:08Yeah. Super and because it's all in code, it's really easy. I just, like, split my test files into multiple files and then it runs like multiple containers.
- 5:16Jonathan Hall: Very
- 5:16Shay Nehmad: cool. There is something that is not very surprising. Go one twenty five. As time marches on, you know, every February around Valentine's Day and every, August around the the end of summer, we release a new version of Go. Go one twenty five is set for August 2025, expected.
- 5:38Hopefully, everything, works out that way. And you can start taking a look at the release notes. Just go to tip.golink.org/docs/go1.20five, and you can look at like all the changes. Obviously, it's still draft and not everything's here yet, and it's gonna change a lot. This is one of those like live documents.
- 5:59But if you really wanna track, you know, the development or you're involved in a specific part, you can take a look, at at this document and see what's like going on. There's like changes to the runtime, changes to the compiler. Some things we've discussed in the show, obviously, some things that, not yet. And, it's always fun to like look at this document slowly, very slowly, like gets written and then a week just like you and your talk, a week before it needs to be released, everybody's, like, cramming on it. Human nature, I guess.
- 6:31But, yeah, the link is in the show notes if that sort of thing interests you. But other than things being added to the language, there are some things that were removed from the language, this version, and we sorta missed on them. Can you fill us in?
- 6:44Jonathan Hall: Yeah, the GOAT team was pretty busy writing blogs over the last couple of months and we haven't been keeping on top of them. But one of them they wrote from Robert Gressymir, I hope I said that right. Goodbye core types, hello, Go as we know and love it. Do you know what a core type is, Shy? I'm ashamed to admit
- 7:02Shay Nehmad: I sort of don't. Thought I understood it from the name. Was like, oh, core type, like int. Mhmm. And it's the blog post is, like, all about typing and type theory is always a bit confusing to me.
- 7:16But I think it's like something that it's like a class almost sorta thing maybe.
- 7:24Jonathan Hall: I don't So you're not alone in being confused by what core types are. So I actually not long ago finished what was essentially a two year series of writing every day about the Ghost spec, right? So I started at the beginning and I would point by point wrote to my daily email list about the Ghost spec. And after doing that, I still did not have a solid understanding of core types. So I don't think you need to feel embarrassed for not understanding core types.
- 7:52Shay Nehmad: Well, if I understand this blog post correctly, if you go through this exercise again, you won't even know about core types, That's
- 7:58Jonathan Hall: right, that's right. So in a nutshell, I'm not even gonna explain what they are technically, but I'm gonna explain how they came to be more like that. When generics were added in Go 1.18, they had a bunch of special cases that like, I don't even know what the examples are right now. Not gonna worry about that. But like under this circumstance, we need to do this weird thing with this type, but for other types we need to do this other weird thing.
- 8:19And so they introduced the concept of a core type, which kind of served as an abstraction to make some of these special cases go away.
- 8:27Shay Nehmad: Yeah. I thought in slices, like slices in generics had a lot of problems.
- 8:33Jonathan Hall: Well, they've decided that actually the core type concept is probably more confusing than it is helpful. So they're removing that from the spec. And in fact, many places where there weren't special cases, they just like would replace the term underlying type with core type. But they're slightly different in certain weird corner cases. What they decided to do is remove the concept of core type and then just enumerate those special cases every time they matter.
- 8:59So it's a little bit less of an abstraction, thinking in like coding terms, more copying and pasting, if you will, of these special cases. But it makes it easier to understand the spec.
- 9:11Shay Nehmad: It makes it easier to understand the spec, especially if you don't do generics, which Yeah. Most of the code, you're you're you will write is not generic. Right. I've used generics.
- 9:22Jonathan Hall: Even with generics.
- 9:23Shay Nehmad: I like them.
- 9:24Jonathan Hall: But most
- 9:25Shay Nehmad: of the code I write is just like, you know, straight up code. I wanna do some things. They don't wanna write generic handlers or things like that.
- 9:32Jonathan Hall: Right, right. But even with the generic code, like I still think it's easier to see a list of here's the four special cases in this circumstance rather than refer back to the concept of core types. We have to jump over there and read up on core types and try to figure out, okay, so given that this is a core type, that means what in this circumstance? That's confusing. Even if like in some sort of abstract sense, it's general.
- 9:55I think this is a good improvement. It doesn't actually change the language. That's the more important thing to notice here. This isn't actually changing the language. No functionality is changing, no capabilities or generics are changing.
- 10:05It's just how they describe the language. The spec is changing to be easier to understand. It's refactoring I think that's important.
- 10:11Shay Nehmad: An easy spec to understand and, know, simple language is one of the, things that differentiate Go from a lot of languages that are very complicated or have a ton of keywords.
- 10:22Jonathan Hall: That's right.
- 10:23Shay Nehmad: Yeah. I'm working, one of the languages we're using, at the current place and almost every place I've worked at had some Python code. You know, there are so many weird cases that, you know, you know, they're they're in Python, you could do four else. Yeah. You could do it, but you don't have to do it.
- 10:40You can chain operators. You have advanced f string formatting and now they introduce t formatting and like, there's just so many options to do so many things. And it's just nice to have one language say, hey, we introduced this thing. It was too complicated. Let's simplify.
- 10:55Jonathan Hall: Yeah. Yeah.
- 10:56Shay Nehmad: It's pretty good.
- 10:57Jonathan Hall: I should also mention since I did mention my daily list, I'm still doing that. I'm not talking about the spec right now. But if you're interested in some daily go tips, hold to go.tech/daily and you can subscribe.
- 11:07Shay Nehmad: Of course. You know, when you say you like go through the entire spec and sort of reminds me, like of this, some people in, some Jewish people, they do that with a Bible. They would like start would try to finish the bible in a year. Mhmm.
- 11:24Jonathan Hall: Oh, I I know, Christian people do that too. Yeah. And it's harder because they have a longer bible. Yeah.
- 11:29Shay Nehmad: Yeah. It's like a go to everything that didn't go into the the Jewish, you know, the Jewish Bible. All right, let's do the new one. File it under go to issue.
- 11:39Jonathan Hall: I guess some people have tried to simplify the Bible and, with mixed results, right? One final blog post I wanna mention, also
- 11:45Shay Nehmad: pretty simple, also pretty useful. We talked a lot about the tool directive, the new Go tool. Which is related to
- 11:53Jonathan Hall: the perfect circle directive, right?
- 11:55Shay Nehmad: I don't know. Just a very simple command. And the problem is if you worked with Go for a while, you know this pain of having a tools.go file, which is, oh, I need Golang cilint installed, but I don't wanna force like all my developers to install it externally. And then I in CI, I have to have a command that's like install dev tools or whatever. So linters like Golang CI lint, code generators like mockery, open API code gen, protobuf, all these things, you have to install manually.
- 12:28And then the solution most people found, which is not great, is to do tools. Go. Just you just add a file that imports all these things, doesn't use them, but then, you know, they they end up in Go mod. So to fix that, there's a go get minus tool, which is very, very similar if you're coming from Python or TypeScript to the or Rust to like a dev dependency sort of thing. It's exactly the same concept.
- 12:56And this blog post is, by Alex Pliotow, I hope I'm saying that correctly, is just the best documentation I found for it. It's very simple. Add a new tool to Go Mod, you run this command. Once installed, you run it by running Go to whatever, then it'll end up in your Go Mod. What's great about it, you can pair it with Go generate and you can put it in a separate Go.
- 13:19Mod file. And the obvious question, wait, what if I have a non Go tool that I want to install? For example, the protobuf stuff that's not necessarily Go, right? OpenAPI generators, which tend to be mostly Java, although there is openAPI dash cogen. So it's not supported yet, and you'll have to do something external like you used to do.
- 13:38That's it. Very simple blog post because it's a very simple feature. I just wanted to shout out Alex for writing like shortest and most simple blog post about this feature.
- 13:47Jonathan Hall: Way to circumlocute.
- 13:49Shay Nehmad: Yeah. Sometimes the official docs can be a bit like wordy and not actually tell you what you need to do. Like this is pretty, pretty simple.
- 13:58Jonathan Hall: So we've made it through most of news. We're gonna do a lightning round. We're gonna do a quick break, and then we're gonna be back with two more less newsy news items to discuss. So don't go away.
- 14:14Shay Nehmad: Lightning round.
- 14:16Jonathan Hall: First up on this week's lightning round, you may remember, I think it was two weeks ago, I brought up a blog post about writing Go for the PlayStation two. If that was just totally your bag and you want more of it, there's a part two out now. So go along on the
- 14:30Shay Nehmad: PlayStation Is it about writing for PlayStation three?
- 14:32Jonathan Hall: You would think. No, I think this is 2.5. I don't know how that works. But Ricardo goes into more details and more things he's learned about ready to go for the PS two. I'm not gonna go to the details because I know it's kind of a niche thing.
- 14:47That's why it's in the lightning round. Just wanted you to know it's there so you can go find it in the show notes if you wanna go read it.
- 14:52Shay Nehmad: My thing for the lightning round, if you remember, we had, Bill Kennedy on the show.
- 14:57Jonathan Hall: Oh, yeah. I'm a partner.
- 14:59Bill Kennedy: I own a company called Arden Labs. We're primarily a consulting shop. We do a lot of projects, and I focus a lot on training, building a lot of training material. I've written well over a hundred blogs. I've written the books.
- 15:13I'm really focused a lot today on trying to teach software design as opposed to
- 15:18Shay Nehmad: So I was pretty excited to see two days ago, Ardan Labs, which is, Bill's, like, you know, technical training provider, has official, certification exams for Go and Rust. They're like a serious training organization. I would trust their certificate as a as a hiring manager. I can say that for sure. There's a whole interesting, like, side discussion, which we won't go into right now because this is the lightning round about whether certificates actually mean anything or not or are they useful.
- 15:46But in my opinion, it's a pretty good value. And it's cool that the Aldan Labs not only provides the training, but also, like, certs. So if you're looking for a job right now and it's a pretty brutal market, maybe it can give you an advantage.
- 15:58Jonathan Hall: I haven't done the certifications.
- 16:00Shay Nehmad: I'm pretty sure I can do the Go one. I'm pretty sure I can do the Rust one, at least without not going through their training. But if you wanna register for it, just go to aldanlabs.training. Really cool stuff. Happy to see it.
- 16:13Jonathan Hall: One last Lightning Round thing. It actually fits the theme perfectly of Lightning Round because their, their logo is a lightning bolt. A former boss of mine has started a new startup that does logging and they have an app called sparklogs.app. It's kind of like Papertrail or Logs.io or whatever. But I just learned recently it's written in Go.
- 16:33So I'm actually going to try to get him on the show for an interview. Until then, there's a lightning round mention. If you're looking for a logs provider that has a great free plan, 25 gigabytes of ingestion per month, fourteen day retention for free, sparkblogs.app, check it out. And that's that.
- 16:48Shay Nehmad: Cool stuff.
- 16:49Jonathan Hall: Not sponsored by the way.
- 16:50Shay Nehmad: Yeah, just like friends, friends
- 16:52Jonathan Hall: of the Exactly.
- 16:54Shay Nehmad: All right, let's move to an ad break. There are some interesting updates there as well actually.
- 17:05Jonathan Hall: Jonathan, you mentioned at the start of the show that the show is supported by the listener.
- 17:12Shay Nehmad: Yes. What does that mean?
- 17:14Jonathan Hall: It means that our listeners are responsible for the success of the show by word-of-mouth advertising for us, by joining us in the Slack channel where we talk about things on the show, by sharing news items with us, and of course, if they want to, by supporting us financially, because this is not a free hobby.
- 17:32Shay Nehmad: Yeah. It's a pretty expensive hobby. We do it for fun, but it's, pretty expensive. I wanna shout out, Moshe Viner, who joined as a paying member. Thanks so much.
- 17:42Thanks for joining our, crowd of Patreons Patrons. If you wanna reach us, you can find us at cupogo.dev, where you can find any, like, anything and any everything about the show, like our swag, which if I'm taking a quick tangent here, I'm at the WeWork right now, and right before the show started, I went to get like a cup of coffee, and I have the Cup O Go hoodie on because it's super nice and like white with the logo on it, which is really good. I was like, hey, good morning to the, you know, WeWork staff people, because they're really nice. And the guy was like, oh my god, I like I love your sweater. And I was just like, store.cupago.com.
- 18:24I was just like so excited. And I was so excited, I forgot we didn't buy the Com, the .dev, you know, work for him. So I I lost all the bravado of like, oh my god, it's my brand. It's my I was like, oops, I meant dot dev. So it's cupago.dev, where you can find hoodies and shirts and cups that I can say from firsthand experience, get you random compliments from people at the office, even if they don't know anything about Go.
- 18:53You can talk to us at the Go for Slack, hashtag cup of go with kebab case, or email us, news@cupofgo.dev, news at cup of go dot dev. Well, I say email us, it's just email you. Right?
- 19:05Jonathan Hall: Yeah. But I share it with you when it's not obviously spam. I actually have a question for you about SwagShai. We don't sell magnets, do we? No.
- 19:14I want a magnet now. I want a little Brewster magnet because I have a new coffee cup, but it's stainless steel and I wanna put a a go a gopher magnet on it.
- 19:22Shay Nehmad: I will take a look into it.
- 19:24Jonathan Hall: Because I don't think we're gonna sell these because these are a hundred and $50 a pop.
- 19:28Shay Nehmad: I don't think I'm gonna buy them. Why do you need
- 19:29Jonathan Hall: a hundred and 50? It's it's a self heating battery powered mug.
- 19:33Shay Nehmad: Just drink your Some things were fine a hundred years ago, like like mugs. My cold coffee. Lead paint? Sounds good. You know what's the last mug I bought?
- 19:46I went to Goodwill because I just moved, and I bought, like, six different mugs,
- 19:50Jonathan Hall: $10. Pretty good.
- 19:52Shay Nehmad: Awesome. One of them is, like, best grandma ever. I don't know who but it was, like, 50¢, and it's really good. Anyway, we might do magnets. But all the rest of the swag and our Patreon links, past episode transcribes, all on cupugo.dev.
- 20:08If you wanna support the show, not financially, you can leave a review or share it with, you know, people, you think would find the show interesting. Wherever you listen to your podcast, Spotify, Apple Podcast, Overcast, whatever, these ratings help us just get to new people organically. We don't pay to advertise or push this show at all. So it's just y'all sharing it with other people. Other than, you know, the normal ad boilerplate and Jonathan advocating for adding Magnus to the swipe store.
- 20:40The San Francisco meetup is happening and it's sponsored, which is freaking
- 20:45Jonathan Hall: That's awesome. Yes. Yes.
- 20:48Shay Nehmad: It was approved just like this morning, so I'm super excited about it. Yes. It's gonna be in San Francisco. It's gonna be, by Elastic, sponsored by Elastic, which is very, exciting. I really wanna say a lot of thanks to Shauna Kashyap, I hope I'm saying that correctly, for reaching out and like making this happen.
- 21:09You rock. And yeah, there's gonna be a real capital, M meetup for the Go community in San Francisco in May 27. Note that it's moved to twenty seventh. It's not on the twenty eighth. I'm gonna put the link in the show notes.
- 21:25I'm arranging it, so please come. So, you know, it won't be awkward. And there are some people who are interested in giving talks already, but I'm sure we can shift the schedule to fit all of you. So if you have talk ideas, please hand them in. And we're gonna do a live episode recording, so Jonathan, make sure you clear your schedule as well.
- 21:42Jonathan Hall: Oh, yeah.
- 21:43Shay Nehmad: It's gonna be super great. I'm very excited about it. Very cool. Yes. Alright.
- 21:48Let's dive into these, non news news, sort of thing. What do you say?
- 21:53Jonathan Hall: Let's do it. Yes. All right, Shy, I want to share some non news news with you.
- 22:02Shay Nehmad: My grandma always used to say, no news, good news.
- 22:05Jonathan Hall: Oh, there we go. So this must be some good news then. Because it's no news. Is kind of news. So Gorm has a new release, version 1.26.0.
- 22:14What is Gorm? I'm curious how that makes you feel.
- 22:17Shay Nehmad: It makes me feel indifferent because I don't use ORMs, but it also makes me feel suspicious that this release is like a hundred bullet point release. Because why are so many people still working with ORMs in 2025?
- 22:35Jonathan Hall: I see.
- 22:35Shay Nehmad: That's that's where I'm at right now.
- 22:37Jonathan Hall: Oh, alright.
- 22:37Shay Nehmad: Yeah. But I just before before we dive into the actual details of the release, I looked I just, like, randomly saw update copyright as one of the bullet points. I was like, oh, that's funny. Someone forgot, like, there's a chore update from, 2024 to 2025. I opened the change itself.
- 22:55The change itself is changing like the year from like 2013 until now to 2013 until present.
- 23:03Jonathan Hall: What? What?
- 23:06Shay Nehmad: So so I don't know.
- 23:08Jonathan Hall: Don't That's ridiculous. I don't
- 23:09Shay Nehmad: know who's gaining from that, but that's just funny.
- 23:13Jonathan Hall: Yeah. I don't
- 23:13Shay Nehmad: I got Maybe some legalese that you wrote now at this time of the commit versus like, I don't know, whatever. So what is Gorm?
- 23:21Jonathan Hall: So Gorm, it is it's the name of an alien species from Star Trek, isn't it? It sounds like what it should be. It claims to be a full featured ORM. ORM being an object relationship manager library, I guess. Have to be All cards on the table, I don't like ORMs either.
- 23:42So if you're an ORM fanatic and you don't like hearing people complain about them, stop listening now. So I'm skeptical of the claim that it's a full featured ORM for the very simple reason that no ORM ever has all the features. That's kind of the nature of an ORM is they're always trying to add new features and new ways to do different joins and different things and so on and so forth. So much so that way back in 02/2006, Ted Neuer wrote a popular, I would call it a blog post, but it's more like a thesis, it's pretty long, called The Vietnam of Computer Science. And he likens ORMs to the Vietnam War, which is basically the analogy being that The US at least in the Vietnam War didn't really have a specific goal in mind.
- 24:21So they just kept like had this huge scope creep throughout the entire campaign. And that's how ORMs tend to work, is they're always there's there's no bounds to what they're trying to accomplish.
- 24:31Shay Nehmad: Generally, when you talk about these, one thing that pops up is like the impotence mismatch, right? Just the difficulties between working in a relational data store and the data in a domain driven object model. There is it's funny that we're talking about it here because there's recently been a Twitter you're not on Twitter anymore, right? X? No.
- 24:51So there's recently been an X Carfuffle where uncle Bob, the clean code guy was like, SQL was a mistake. SQL sucks.
- 24:59Jonathan Hall: I suck.
- 24:59Shay Nehmad: You shouldn't use SQL. You should use an API instead, which is definitely a very hot take. But my I share your, like, disdain of ORMs. I'm I'm coming from a, like, pretty diverse background of I used, the most full featured ORM kind of thing I think that exists, which is Django in Python. Mhmm.
- 25:22Which is like everything is around the what you're not a, like a code you're not a Python developer. You're a Django developer. You're doing everything with the ORM and the web server and the plugins and whatever.
- 25:35Jonathan Hall: Mhmm.
- 25:36Shay Nehmad: And I've done pretty lightweight ORM work with a bun in Go. Have you used the bun for I
- 25:42Jonathan Hall: have not used it, but I've I've heard people, say they like it. I I didn't
- 25:46Shay Nehmad: use lightweight ORM. So it's not trying to do actual, like, a lot of ORM stuff. It's SQL first, but it is in Go. So you do like dot with dot column expression dot where dot select, like these sorts of things. And it generates pretty much the same SQL you would imagine it does.
- 26:06It doesn't do anything like very special. It does have migrations built in and things like that, which is pretty fun. And I've used what I'm using right right like right now. And I've used MongoDB like in Python, which was a whole nightmare. I've come to the realization after all this time, like in my startup right now, we're doing SQL.
- 26:26We're writing SQL code and we're generating the types in the language from it. We're not writing anything in the database in code. We're writing everything in SQL, in dot SQL files. You know what I mean? Like, purists about it.
- 26:45And Are are you writing a short procedure,
- 26:48Jonathan Hall: you you Or or you're like doing like a It's now It's
- 26:51Shay Nehmad: a cool C type of thing, If a if you need a complex query with a join and a whatever, you write a view. And then in the code, you just like use that, you select from that view.
- 27:01Jonathan Hall: Okay.
- 27:02Shay Nehmad: You wanna add a column? Change the view. Touch, like, when you do a select, you can pass, where x, y, zed. You don't write some ORM, whatever, you pass an object into it. You just pass this column.
- 27:16These are the values into your select query. But like most of the work with the database we do is just using raw SQL. All this tangent, just to say that I am very happy not using an ORM. Yeah. After, you know, all these sorts of different experiences, I'm trying to understand what's the use case, like what am I missing that people are still working on GRM so much and this new release has so much work into it, so many different contributors, just a ton of work.
- 27:51It's like a huge chunk of work. People are working on it a lot. Now I know I made like, I made fun of the stupid change the year pull request, but there are some real pull requests here, like refactoring the callbacks for creating and deleting and preloading, and like there's real Go work here, it's a ton of Go It's like a huge library. What am I missing? Like, why what am I missing?
- 28:17That's what I'm trying to understand.
- 28:18Jonathan Hall: You'll probably get a better answer from somebody who actually uses
- 28:22Shay Nehmad: I'm trying to get you to play like a devil's advocate.
- 28:25Jonathan Hall: But if I'm gonna play devil's advocate, yeah, my I guess, I would say I can only think of one legitimate case that at least matters to me for ORMs. And it's only mattered to one company that I'll never work for again. And that is if you are in a company where you need to partition databases, an ORM can do that transparently, in a way that's invisible to your application layer. Because you can tell it that this table's on this database and this table hooks database and do the in memory join or whatever like that, right? If you haven't a sophisticated enough ORM.
- 29:00Of course, that's such a niche use case. It doesn't really apply. I guess I'll go back to what most people say. I think they're wrong when they say this, but most people say that they pose a dichotomy between, and you almost did this kind of, it's the opposite dichotomy between writing raw SQL and using an ORM. A lot of people say There are lot of
- 29:20Shay Nehmad: layers in between where you
- 29:21Jonathan Hall: can have a lightweight ORM,
- 29:23Shay Nehmad: you can have something like connects, like writing queries, a query writer that's in code, defining your tables in SQL, like you could have a lot of different options.
- 29:34Jonathan Hall: Right. So if you're looking at it just at that level, most of the time it's not difficult to write SQL unless you don't know SQL at all. But I would argue that if you don't know SQL at all, if you can't write a select in SQL, you need to learn that. It's not hard. And you're going to have a really hard time using your ORM correctly if you don't understand the foundational knowledge anyway.
- 29:56So at that level, my hot take version is that ORMs make easy code easy and they make difficult things impossible.
- 30:03Shay Nehmad: That's a really good way to put that.
- 30:06Jonathan Hall: Select star is already super easy. It's a tiny bit easier maybe with an ORM. It's not enough easier to be worth the overhead. But if you have something complicated like a six way join or you're using window functions or whatever, you kind of have to fall back to raw SQL anyway. So an ORM isn't a benefit there either.
- 30:24But the reason I think people are wrong with that is because that doesn't really address the problem of ORMs, which isn't about writing SQL or not. Because as you just mentioned, there's other ways you can avoid writing SQL. You can have query builders. I have no problem using query builders to simplify writing monotonous dynamic inserts or updates or whatever. I'm happy to use a query builder.
- 30:48So I think it's more about that impugnance mismatch you mentioned that a lot of people use ORMs to fetch relational data into objects and then turn it into a table to display on a web page. That is silly because you're taking relational data converting to objects and converting it back to relational data. Why don't you just do relational to relational? Or using an ORM to select to do a statistical analysis. If you're trying to get averages or sums, you don't need an object there either.
- 31:18So I like to look at the core words, ORM. And there certainly are cases where I need to take my relational data and turn it into objects. But I prefer to do that with custom code rather than with a general purpose library that's never the right shape for what I need.
- 31:34Shay Nehmad: And I'll just add one thing. Looking at the issues fixed in this release, this is a big library, like a a huge chunk of code. And, picking one at random. Fix race issue and prepare method. This is by xi u seven.
- 31:54They fixed, like although this is not really fair because it seems like this is from 2021. This release is kind of weird. Like the release notes include every single commit that's ever been. Maybe, you know, they something's wrong in their like release notes process or something.
- 32:08Jonathan Hall: Yeah. Let me address that. I think what's been happening is for the last four years, they've been creating tags without creating GitHub releases. So the last GitHub release was about four years ago. I think this includes all of the changes that have happened since then, even though many of these were included in more recent tags.
- 32:26Shay Nehmad: The I'll just say, like, they're the the fix race conditions in the library where if you just wrote it yourself, you probably wouldn't have. I had the chance you would love this document. I I wish I could share it with you, but that's internal. We did, like, a bake off internally when we just started the the code base, like just a few months ago, right? I had to do a bake off between all the different ORM options and and levels and layers, not for Go, unfortunately, for TypeScript.
- 32:54But it's actually exactly the same. Like, doesn't matter. The only problem is that with TypeScript, people are even less like into simplicity. Like in Go, at least you know the people you're talking to usually are into simplicity. With TypeScript, this is not the case.
- 33:11They like their frameworks and their new whatevers. And, you know, there are there are other factors to consider as well. Like you might find a very simple lightweight ORM, but it doesn't have a lot of support and a lot of community behind it. That's a problem. And the Go, like Gorm clearly has a huge community of people you can talk to.
- 33:30So if that's a thing you care about, that's a benefit. Because there aren't really SQL communities in that sense, you know what I mean? But I, you know, I did this entire bake off between, Prisma, PGType CLI, TypeORM, MicroORM, SQLize, Kinex, Kisly, Mammoth, KISS ORM, Slonic, Objection JS, like all the options, literally all of them. And the leading option was writing everything in SQL, and then using a SQL to TypeScript generator, which we ended up landing on Zapatos, which is a tiny passion project by this like one guy that does this one simple thing for us. And, yeah, it's been working super well.
- 34:12So that's the ORM, discussion. Overall, we we and, what's the guy's name who did, who invented Clojure? Rich. Rich Hickey. Rich Hickey also says, don't, do that.
- 34:25And by the way, just to, clear up the Twitter thing, I think I think, uncle Bob also says don't use ORMs because they use SQL under the hood. He's like, talk to a DB that has a proper API, like Datomic or whatever, but that's like super niche, whatever.
- 34:42Jonathan Hall: Don't know.
- 34:42Shay Nehmad: Most of us just wanna store stuff
- 34:43Jonathan Hall: in You have something you might have a point there, but I'd have to mull on that for a while. I'd have to try that API for a while and see if I agree.
- 34:51Shay Nehmad: Of Datomic?
- 34:52Jonathan Hall: Of whatever database we're talking about. And until the Postgres API gives me the flexibility to do what I need, I probably don't care.
- 35:01Shay Nehmad: I think because so many people use Postgres via SQL, at this point, you know, it's like I think it's called Hiram's Law. Yeah. It's that that's the observable behavior of the system. There are so many people behind it. That's the contract
- 35:17Jonathan Hall: right now. You know what I mean? At least that's how I feeling about it. Yeah. But but maybe in principle, he he's onto something.
- 35:23I don't know. And maybe not. I I don't always agree with Bob. Sometimes I do, sometimes I don't. So I don't just take his word for everything.
- 35:30Shay Nehmad: Similar in the sense that you like to argue with very, very hot takes that, like, break things that everybody assumes are correct. But, yeah, it's generally, there's a new release of Go, GORM. If that excites you, see see us after class because we we need to figure out why. And this is not really news news.
- 35:51Jonathan Hall: It's because if somebody if somebody really is excited about that, I wouldn't mind having them on the show to talk about and try to understand their
- 35:57Shay Nehmad: view. Yeah. Yeah. I legitimately,
- 35:59Jonathan Hall: if you wanna talk about that. Gore or if you're one
- 36:01Shay Nehmad: of the real maintainers, I don't know if it's like a a specific big maintainer behind this project or something. That'd be cool. Alright.
- 36:08Jonathan Hall: We have one of the one of the topic, to discuss before we call it a show, and I'm gonna let you introduce It's
- 36:15Shay Nehmad: not news news, but I really wanted to shout out the cheating the reaper in Go blog post, by MC Young, Miguel. He published, this blog post just like a couple of weeks ago, so it might be actual news news. But you know how a blog post at the top has, like, number of words and how long it takes to read and,
- 36:36Jonathan Hall: like Mhmm. Tags?
- 36:38Shay Nehmad: This one is, thirty five minutes. Hashtag dark arts, hashtag pointers, hashtag go. It's a very, very, low level blog post.
- 36:48Jonathan Hall: And I've never seen this in a blog before, but you don't what do they call that feature where in your IDE on the right hand side or left hand side, you can see like your entire file and where you're where you are scrolling in it. You know what I mean?
- 36:58Shay Nehmad: Yeah. Yeah. I don't know what it's called from a UX perspective, but yeah, he has that on his blog, which is very cool.
- 37:05Jonathan Hall: It's cool. And I have to say it looks cool. Like visually it's cool, also silly, but whatever. Continue. I'm distracting.
- 37:14Shay Nehmad: No. The the first of all, the blog is nice. Like the the titles are nice and the underline like, it's definitely someone cared about this blog quite a lot. The blog post itself, I want to bring it up because the blog post is really about writing super high performance Go code to build an untyped garbage collected arena abstraction in Go. So it relies on how the garbage collector works and you build a Go arena.
- 37:48And because Miguel has experience in C plus plus and Rust, there's a lot of like, oh, in Rust and C plus plus I wouldn't be able to do it. And the compiler will like break me. But in Go, I like I can do it because we, use unsafe. Also that blog post is, named really well, like cheating the reaper in Go, I love that. I try to sit down and like slowly read through it line by line and I think at the end I understood it.
- 38:16That was like a week ago, I'm opening it up back again. It's fuzzy because it's like super lower level stuff I don't tend to work with. What I'm wondering and what I wanted to bring up with you is, in my sense, this demonstrates like really high level really like high level not in the sense of high level language, high level in the sense of high expertise, understanding of the language, and computer science, like, in general. Being able to, like, implement this stuff and look at the performance and do more optimizations and things like that. On the other hand, I really don't remember when was the last time I needed, to look at assembler code and like try to optimize it where I didn't just say, all right, I'll write this specific part in in Rust and, like, you know, call it from whatever language I'm actually using.
- 39:12Have you seen, like, any case where obsessing about the super, super low level performance of Go code has been worth it, like, the last few years since Rust became more serious and would put it in production?
- 39:24Jonathan Hall: I would never needed that. The last time I did that sort of thing was when I was using Perl and working with C bindings to improve performance, which ultimately led me to learning Go so I wouldn't have to do that.
- 39:36Shay Nehmad: Never again, you're saying?
- 39:38Jonathan Hall: So no, I've never had to do that. Mean, I can certainly imagine cases. I'm not trying to say that it's not legitimate. Just haven't needed that.
- 39:45Shay Nehmad: There's a whole movement right now of people, you know, mostly like on YouTube and things like that. But I I I feel it as well that say software is getting super slow and annoying and that we need more people like that to obsess about performance. How would you, you know, other than letting people on the that are listening right now, like, let them know about this blog post and go read it and you wanna be as good or whatever.
- 40:14Jonathan Hall: There isn't a lot of like, it seems like a lot of
- 40:17Shay Nehmad: the times in Go, you're like, oh, don't worry about the pointers too much. It's pretty much Python, but just fast. Right? That's like how people try to market it at least. How can we get more performance obsessive generally?
- 40:31Jonathan Hall: You know what I mean?
- 40:32Shay Nehmad: Like the previous topic we discussed about was GORM, which is exactly the opposite. Right? Like, oh, I'll just use an ORM. I don't care about the what the underlying SQL is generated. And here in this blog post, the guy's literally well, the person literally going into, all right, let's see the assembly that Go has generated for this function to like understand how we can optimize it even more.
- 40:55Oh, move q ax to zero at r 11.
- 40:59Jonathan Hall: You know what I mean?
- 41:00Shay Nehmad: How can you get more of that?
- 41:02Jonathan Hall: So I don't know how. I actually would question the premise of the question and do we do any more of that? I think too many people are obsessed with premature optimization.
- 41:12Shay Nehmad: Don't you think overall software has, become much slower? Like, you open things and they just, like, chug along, everything's slow,
- 41:20Jonathan Hall: everything's I use Linux, everything's fast, man.
- 41:22Shay Nehmad: Yeah. I I I installed my audio drivers every day and it's super fast. No. Just kidding.
- 41:29Jonathan Hall: I mean, so I'm I'm sure there's a there's truth to that to an extent, largely because hardware is much faster now, it's no longer necessary to squeeze performance out of everything. So we kind of get lazy in that regard. So yeah, I mean, a sense, sure, there's a lot of room for improvement and it matters in certain apps more than others. On the other hand, I mean, could point to a hundred times when people have been trying to optimize performance for things that literally don't matter at all. And I can think of very few times where the opposite was true, or they should have focused on performance and they didn't.
- 42:04So I suppose if I'm going to offer some sort of blanket advice, it would be benchmark first and then optimize where the benchmark shows you have a problem instead of just guessing. That would kind of solve both, or at least contribute to solving both problems. The people would stop trying to optimize things that don't matter and then focus on the their efforts on things that do. But I don't think I'm really answering your question because I I maybe I don't quite see the same problem. I I understand what you're saying.
- 42:30Shay Nehmad: The it's not about I think it's it's like you can tell people people, hey, benchmark first and don't focus on the wrong thing. What I'm saying is people are not excited to do that stuff generally. They they would like wait until the software is so slow, it's unusable instead of like obsessing about its performance. And I like pieces of software where people obsessed about the performance. I recently switched to using well, never mind.
- 42:58Some software, I don't wanna sound sponsored, where it's really fast compared to the previous, like, competitor that I worked with, which was really slow. For something I do every day, I've just been more happy as a user to to feel that. Anyway, going back to the to the blog post, not the philosophical stuff. Altogether, what, Miguel implemented here is a package called Arena, where you can allocate, memory very fast, and reallocate. And it's a it's a whole lot of like take the minimum allocation size versus the cap, move the chunk, increment the pointer, you know, initialize the pools, like it's very, very low level stuff, very cool, where you can allocate chunks of words, and you have in it and you have finalized to to make that all happen.
- 43:52At the end, you have a very efficient like memory arena that you can do. And it doesn't have a lot of unsafe code. Like overall, it does look kind of funky with a lot of
- 44:06Jonathan Hall: That feels a little bit like saying, well, airplane has most of its wings. Yeah. That doesn't just doesn't have
- 44:12Shay Nehmad: the left phalange, it's fine. I would definitely recommend. I enjoyed reading it last week, top to bottom. I do know assembly, I do know c plus plus so maybe that's why I was able to follow through the entire thing, but I would highly recommend reading it. It's really well written, a lot of code, and yeah, really, really good stuff, Miguel.
- 44:31I I liked it a lot. Cool, cool stuff. And like I always do, there are more, blog posts in, Miguel's, like, backlog about protobuf, which is also cool. So, you know, go ahead and read more of his things.
- 44:48Jonathan Hall: Yeah. Great blog. Thanks, Miguel, for sharing with the community. Alright.
- 44:53Shay Nehmad: I think that that's a show.
- 44:55Jonathan Hall: I think that's it. We'll, see you all next week.
- 44:58Shay Nehmad: Program exited. Program exited. Goodbye.