text
stringlengths
0
2.46k
**Jerod Santo:** Whereas RBS is this streamlined syntax that you plus the Ruby team kind of collaborated on? Is that correct?
**Jake Zimmerman:** \[47:47\] Yeah, exactly. In defense of the RBI syntax, I think that one of the things that's a lot easier about it is you don't have to kind of switch between two type systems in the docs. So if you see a type annotation anywhere in Sorbet's docs, it's completely valid to put that both in the Ruby f...
**Jerod Santo:** Gotcha. Now, does Sorbet run faster with RBIs than it would just in the source code, or does it not matter?
**Jake Zimmerman:** It's really just a function of like how many bytes Sorbet is reading.
**Jerod Santo:** If your source files are really long, then it might slow down a little bit, just to parse through and get the actual annotations out.
**Jake Zimmerman:** Yeah. The crazy thing though is just how fast Sorbet actually is. I have gone on record many times and claimed that Stripe's Ruby codebase is the largest. Obviously, I haven't seen every Ruby codebase in the world, and no one has contested me on this point... So I'm going to go forward and continue ...
**Jerod Santo:** Bigger than GitHub?
**Jake Zimmerman:** Oh, by a long shot. And the nice thing about this if you are a user of Sorbet is Sorbet will -- the amount of time that it takes to type-check your codebase will never be longer than the slowest codebase type-check. So you kind of like benefit from -- someone will always encounter performance proble...
**Jerod Santo:** That someone will be Jake Zimmerman. \[laughs\]
**Jake Zimmerman:** Yeah. So that's kind of why a large part of the work that we end up doing is just optimizing and optimizing. One of the fun projects that I got to work on last year was making Sorbet more incremental. The entire history of Sorbet, if you needed to run Sorbet in your editor - it would basically just ...
Eventually, the codebase got to the point where that wasn't fast enough, which meant that we had to do some work to make it faster. And the way that we did this was just being smarter about not doing work. Basically, we would figure out the contents of any given edit, and say like "Okay, well, we can actually tell that...
**Jerod Santo:** Stripe is bigger than Shopify?
**Jake Zimmerman:** Yup. Shopify, I think --
**Adam Stacoviak:** He's saying this so unequivocally. \[laughter\] He's like "Yup."
**Jake Zimmerman:** I know -- Shopify's codebase is one of the codebases where I have actually very exact numbers on how large that codebase is.
**Jerod Santo:** Because they're using Sorbet...
**Jake Zimmerman:** Yup. They're also one of our closest partners that we collaborate with on improving Sorbet. They've made a number of contributions themselves, and we meet regularly with them to figure out how we could be making Sorbet better. So that's kind of like one of the things that I'm always worried about, i...
**Adam Stacoviak:** Is Twitter still Ruby, or...? Are they still a Rails shop, or...?
**Jake Zimmerman:** I don't think Twitter is Ruby anymore. I think they use --
**Jerod Santo:** Scala. A lot of Scala.
**Jake Zimmerman:** Scala, and maybe some other languages at this point.
**Adam Stacoviak:** \[unintelligible 00:51:08.14\] too much, I guess...
**Jerod Santo:** Is Stripe bigger than Basecamp? It probably is.
**Jake Zimmerman:** That's one of the ones I don't know of. But again, no one has reached out and told me otherwise, so...
**Jerod Santo:** Alright, listen out, listener out there... If you have a codebase larger than Stripe, or you think it's larger, then you need to let us know, so we can prove Jake wrong. How many lines of code roughly?
**Jake Zimmerman:** Yeah, so I wrote a blog post on the Stripe Engineering Blog in May of 2022, I believe... And the codebase size at that time was 15 million lines.
**Jerod Santo:** And that was a year ago, roughly.
**Jake Zimmerman:** That was a year ago. If you think you can beat 15 million lines, I'd be very, very curious to hear. Now, I also want to express my condolences for having to work in a 15-million-line codebase...
**Jerod Santo:** \[laughs\]
**Adam Stacoviak:** Is lines of code the best way to quantify it though? Wouldn't bytes be better?
**Jake Zimmerman:** Yeah, bytes would be better, for sure.
**Adam Stacoviak:** I mean, you can have a long or a short line, right?
**Jerod Santo:** \[51:59\] Yeah.
**Adam Stacoviak:** If you have like millions of short lines, and I have half a million really long lines, maybe I win.
**Jake Zimmerman:** Yup. No, absolutely. Bytes -- like, if I've sniped you enough, you, dear listener, into "Let's compare our codebase sizes", I will try and ask if you can find the number of bytes. It's usually the tools that report codebase sizes are easier to measure lines of code, for whatever reason. So that's us...
**Jerod Santo:** Right.
**Jake Zimmerman:** "Stripe's codebase has this many bytes" doesn't quite have the ring to it than --
**Adam Stacoviak:** Right. LLCs are better in that case, yeah.
**Jerod Santo:** But if it's gonna come down to it, we'll go byte for byte, that's what you're saying. We'll definitely do that.
**Jake Zimmerman:** Yeah.
**Jerod Santo:** Okay.
**Adam Stacoviak:** If you're comparative on bytes of code let's go byte the byte.
**Jerod Santo:** Yeah, exactly.
**Adam Stacoviak:** Okay.
**Jerod Santo:** Cool, man. So I guess the only thing that I'm left thinking is what is the user experience like? Let's just say I have a 12-million-line Rails app out there... Or maybe even a 16-million-line Rails app out there, and I'm thinking Sorbet might be for me. How do we opt in or incrementally adopt? What doe...
**Jake Zimmerman:** Yup. Yeah, so the steps to adopt it - you can just go to Sorbet.org, and there'll be instructions there. The instructions will basically ask you to install a gem; there's actually two gems. One of them is going to be the static type checker that will report all the type errors in your code, and one ...
So you add these two gems to your codebase... You don't even need to write any annotations out of the box if you don't want to, and you can start type checking. It'll probably report a bunch of errors on your codebase; you can either fix those errors, or you can turn off the type checker in those files, and that's that...
The thing that you're going to want to do is as quickly as possible get it to the point where every file is at least typed false. So if you have any files that don't have valid syntax, or that have constant names that Sorbet doesn't know about, there's various ways to fix those errors... But that's kind of the baseline...
**Jerod Santo:** Yeah. What does the editor support look like?
**Jake Zimmerman:** So there's a VS Code extension that you can install, and it'll automatically figure out where Sorbet is installed in your codebase, and how to run it. And it'll show you the errors, and all of the fancy VS Code features will be wired up. If you don't use VS Code, the editor support is powered by a l...