๐ŸŽ‰ Surprise! ๐Ÿ˜ฏ A new security release is coming!

Jonathan 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.

Jonathan Hall:

And 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.

Shay 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.

Shay Nehmad:

While 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.

Shay Nehmad:

I met like the guys from my previous startups there. Like basically, the entire cybersecurity scene of Tel Aviv was in San Francisco last week.

Jonathan Hall:

Of course. Yeah. Yeah.

Shay 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?

Shay Nehmad:

And 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.

Jonathan Hall:

Yeah. Yeah.

Shay 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.

Shay Nehmad:

Or a TV, TV also good.

Jonathan 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?

Shay 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

Jonathan 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.

Shay Nehmad:

Mark your calendars.

Jonathan Hall:

Mark your calendars.

Shay 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?

Jonathan Hall:

I'm ready.

Shay Nehmad:

There's a conference.

Jonathan Hall:

Yes. And the speakers who will be there are the surprise because we don't know yet.

Shay Nehmad:

You could, hand in your call for papers. Right? They're they're looking for papers.

Jonathan Hall:

They're looking for papers. You have until June 3. So about a month.

Shay Nehmad:

When and when? Like, is it online? Is it somewhere?

Jonathan 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.

Jonathan Hall:

I 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.

Shay Nehmad:

You give us like a How do you write idiomatic tests in Go?

Jonathan Hall:

Well, I'm gonna spend the next weekend cramming on learning how to do that because I don't really know.

Shay Nehmad:

So far all your tests have been like super shitty.

Jonathan 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.

Jonathan Hall:

So 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.

Shay Nehmad:

No, like how to write tests with AI, AI, AI? A talk that's not about AI, is that allowed in 2025?

Jonathan 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.

Shay 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.

Shay Nehmad:

Yeah. 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.

Jonathan Hall:

Very

Shay 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.

Shay Nehmad:

Hopefully, 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.

Shay Nehmad:

But 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.

Shay Nehmad:

But, 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?

Jonathan 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

Shay 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.

Shay Nehmad:

But I think it's like something that it's like a class almost sorta thing maybe.

Jonathan 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.

Shay 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

Jonathan 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.

Jonathan Hall:

And 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.

Shay Nehmad:

Yeah. I thought in slices, like slices in generics had a lot of problems.

Jonathan 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.

Jonathan Hall:

So 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.

Shay 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.

Jonathan Hall:

Even with generics.

Shay Nehmad:

I like them.

Jonathan Hall:

But most

Shay 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.

Jonathan 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.

Jonathan Hall:

I 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.

Jonathan Hall:

It's just how they describe the language. The spec is changing to be easier to understand. It's refactoring I think that's important.

Shay 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.

Jonathan Hall:

That's right.

Shay 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.

Shay Nehmad:

You 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.

Jonathan Hall:

Yeah. Yeah.

Shay Nehmad:

It's pretty good.

Jonathan 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.

Shay 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.

Jonathan Hall:

Oh, I I know, Christian people do that too. Yeah. And it's harder because they have a longer bible. Yeah.

Shay 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.

Jonathan Hall:

I guess some people have tried to simplify the Bible and, with mixed results, right? One final blog post I wanna mention, also

Shay Nehmad:

pretty simple, also pretty useful. We talked a lot about the tool directive, the new Go tool. Which is related to

Jonathan Hall:

the perfect circle directive, right?

Shay 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.

Shay Nehmad:

And 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.

Shay Nehmad:

And 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.

Shay Nehmad:

Mod 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.

Shay Nehmad:

That'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.

Jonathan Hall:

Way to circumlocute.

Shay 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.

Jonathan 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.

Shay Nehmad:

Lightning round.

Jonathan 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

Shay Nehmad:

PlayStation Is it about writing for PlayStation three?

Jonathan 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.

Jonathan Hall:

That'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.

Shay Nehmad:

My thing for the lightning round, if you remember, we had, Bill Kennedy on the show.

Jonathan Hall:

Oh, yeah. I'm a partner.

Bill 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.

Bill Kennedy:

I'm really focused a lot today on trying to teach software design as opposed to

Shay 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.

Shay Nehmad:

But 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.

Jonathan Hall:

I haven't done the certifications.

Shay 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.

Jonathan 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.

Jonathan Hall:

So 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.

Shay Nehmad:

Cool stuff.

Jonathan Hall:

Not sponsored by the way.

Shay Nehmad:

Yeah, just like friends, friends

Jonathan Hall:

of the Exactly.

Shay Nehmad:

All right, let's move to an ad break. There are some interesting updates there as well actually.

Jonathan Hall:

Jonathan, you mentioned at the start of the show that the show is supported by the listener.

Shay Nehmad:

Yes. What does that mean?

Jonathan 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.

Shay 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.

Shay Nehmad:

Thanks 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.

Shay Nehmad:

I 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.

Shay Nehmad:

You 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?

Jonathan 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.

Jonathan Hall:

I 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.

Shay Nehmad:

I will take a look into it.

Jonathan Hall:

Because I don't think we're gonna sell these because these are a hundred and $50 a pop.

Shay Nehmad:

I don't think I'm gonna buy them. Why do you need

Jonathan Hall:

a hundred and 50? It's it's a self heating battery powered mug.

Shay 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?

Shay Nehmad:

I went to Goodwill because I just moved, and I bought, like, six different mugs,

Jonathan Hall:

$10. Pretty good.

Shay 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.

Shay Nehmad:

If 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.

Shay Nehmad:

The San Francisco meetup is happening and it's sponsored, which is freaking

Jonathan Hall:

That's awesome. Yes. Yes.

Shay 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.

Shay Nehmad:

You 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.

Shay Nehmad:

I'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.

Jonathan Hall:

Oh, yeah.

Shay Nehmad:

It's gonna be super great. I'm very excited about it. Very cool. Yes. Alright.

Shay Nehmad:

Let's dive into these, non news news, sort of thing. What do you say?

Jonathan Hall:

Let's do it. Yes. All right, Shy, I want to share some non news news with you.

Shay Nehmad:

My grandma always used to say, no news, good news.

Jonathan 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.

Jonathan Hall:

What is Gorm? I'm curious how that makes you feel.

Shay 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?

Jonathan Hall:

I see.

Shay Nehmad:

That's that's where I'm at right now.

Jonathan Hall:

Oh, alright.

Shay 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.

Shay Nehmad:

The change itself is changing like the year from like 2013 until now to 2013 until present.

Jonathan Hall:

What? What?

Shay Nehmad:

So so I don't know.

Jonathan Hall:

Don't That's ridiculous. I don't

Shay Nehmad:

know who's gaining from that, but that's just funny.

Jonathan Hall:

Yeah. I don't

Shay 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?

Jonathan 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.

Jonathan Hall:

So 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.

Jonathan Hall:

So 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.

Shay 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.

Shay Nehmad:

So there's recently been an X Carfuffle where uncle Bob, the clean code guy was like, SQL was a mistake. SQL sucks.

Jonathan Hall:

I suck.

Shay 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.

Shay Nehmad:

Which 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.

Jonathan Hall:

Mhmm.

Shay Nehmad:

And I've done pretty lightweight ORM work with a bun in Go. Have you used the bun for I

Jonathan Hall:

have not used it, but I've I've heard people, say they like it. I I didn't

Shay 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.

Shay Nehmad:

It 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.

Shay Nehmad:

We'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.

Shay Nehmad:

And Are are you writing a short procedure,

Jonathan Hall:

you you Or or you're like doing like a It's now It's

Shay 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.

Jonathan Hall:

Okay.

Shay 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.

Shay Nehmad:

These 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.

Shay Nehmad:

It'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?

Shay Nehmad:

That's what I'm trying to understand.

Jonathan Hall:

You'll probably get a better answer from somebody who actually uses

Shay Nehmad:

I'm trying to get you to play like a devil's advocate.

Jonathan 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.

Jonathan Hall:

Of 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

Shay Nehmad:

layers in between where you

Jonathan Hall:

can have a lightweight ORM,

Shay 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.

Jonathan 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.

Jonathan Hall:

So at that level, my hot take version is that ORMs make easy code easy and they make difficult things impossible.

Shay Nehmad:

That's a really good way to put that.

Jonathan 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.

Jonathan Hall:

But 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.

Jonathan Hall:

So 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.

Jonathan Hall:

So 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.

Shay 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.

Shay Nehmad:

They 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.

Jonathan 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.

Shay 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.

Shay Nehmad:

But 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.

Shay Nehmad:

They 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.

Shay Nehmad:

So 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.

Shay Nehmad:

So 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.

Shay Nehmad:

And 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.

Jonathan Hall:

Don't know.

Shay Nehmad:

Most of us just wanna store stuff

Jonathan 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.

Shay Nehmad:

Of Datomic?

Jonathan 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.

Shay 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

Jonathan 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.

Jonathan Hall:

I 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.

Shay 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.

Jonathan 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

Shay Nehmad:

view. Yeah. Yeah. I legitimately,

Jonathan Hall:

if you wanna talk about that. Gore or if you're one

Shay 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.

Jonathan 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

Shay 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,

Jonathan Hall:

like Mhmm. Tags?

Shay Nehmad:

This one is, thirty five minutes. Hashtag dark arts, hashtag pointers, hashtag go. It's a very, very, low level blog post.

Jonathan 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?

Shay 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.

Jonathan 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.

Shay 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.

Shay Nehmad:

And 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.

Shay Nehmad:

That 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.

Shay Nehmad:

Have 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?

Jonathan 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.

Shay Nehmad:

Never again, you're saying?

Jonathan 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.

Shay 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.

Jonathan Hall:

There isn't a lot of like, it seems like a lot of

Shay 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?

Jonathan Hall:

You know what I mean?

Shay 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.

Shay Nehmad:

Oh, move q ax to zero at r 11.

Jonathan Hall:

You know what I mean?

Shay Nehmad:

How can you get more of that?

Jonathan 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.

Shay Nehmad:

Don't you think overall software has, become much slower? Like, you open things and they just, like, chug along, everything's slow,

Jonathan Hall:

everything's I use Linux, everything's fast, man.

Shay Nehmad:

Yeah. I I I installed my audio drivers every day and it's super fast. No. Just kidding.

Jonathan 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.

Jonathan Hall:

So 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.

Shay 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.

Shay Nehmad:

Some 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.

Shay Nehmad:

At 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

Jonathan Hall:

That feels a little bit like saying, well, airplane has most of its wings. Yeah. That doesn't just doesn't have

Shay 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.

Shay Nehmad:

I 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.

Jonathan Hall:

Yeah. Great blog. Thanks, Miguel, for sharing with the community. Alright.

Shay Nehmad:

I think that that's a show.

Jonathan Hall:

I think that's it. We'll, see you all next week.

Shay Nehmad:

Program exited. Program exited. Goodbye.

Creators and Guests

Jonathan Hall
Host
Jonathan Hall
Freelance Gopher, Continuous Delivery consultant, and host of the Boldly Go YouTube channel.
Shay Nehmad
Host
Shay Nehmad
Engineering Enablement Architect @ Orca
๐ŸŽ‰ Surprise! ๐Ÿ˜ฏ A new security release is coming!
Broadcast by