Dependency Cultures - Richard Feldman (Software Should Work Conf 2026)
Comments
Transcript
Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.
Let's get it going with uh dependency cultures. I'm Richard Feldman. So, I used to live in St. Louis, Missouri, uh which is just like a 2-hour drive from here. It's it's no Colombia, but it does have a lot of cool things going for it, such as the arch here. Now, I lived there a long time ago. Uh the arch was not quite done. There was no color photography. This was this was 20 years ago, and and we had web startups back then, but they were, of course, very primitive by modern standards. This was our tech stack. Uh we ran Debian Linux on physical servers that we put together with our hands and walked over to a collocation facility downtown. Uh we used Apache HTTP server running Pearl.
Anyone ever done any Pearl? Cool. Nice. All right. Yeah. Yeah. You know what's up. So uh and then we had a big dependency that we forked called MW forum because it had authentication and stuff like that and forking was like kind of a normal thing back then. Postgress memcachd. Uh we sent mail from our own servers using send mail and then JavaScript which actually did have that logo back in the day. Uh we we ran jQuery. Anyone ever used jQuery? This is like ubiquitous. Yeah. All right. This is a great crowd. Okay. So um and then jQuery UI uh for stuff like this really cool calendar picker that we had. Um if you go back a decade before that, like 1996, this is a famous web startup.
We're going to see if anyone knows the name of it. They were running bare metal servers of course and uh free BSD. Then on top of that, this might give away what which web startup it was. They used common lisp and uh and then C for the high performance stuff. The author of this book, Antsy Common Lisp is another clue. Anyone know what startup I'm talking about? >> VIA web. Yeah. Uh so this is basically like they called it via webb because they had this novel idea of delivering software via the web. This is like arguably the first web app. Um as far as like CSS and JavaScript and database, none of that. Uh like CSS was like I think came out in '96 was like very new.
JS95 uh database. Apparently their investors were like, "You're going to need a database." They're like, "Nah, flat files are fine." Um, but they sold this company to Yahoo for millions of dollars and then went on to fund Y Combinator using all the money they made off it. So, I don't know. It's scoreboard. Um, [clears throat] now by modern standards, this is like fully black and white era. Um, modern standards, slightly more dependencies. So, these days, you're not going to be putting your bare metal servers together. They're going to be in a data center somewhere where they have a whole bunch of them that other people run.
They're probably not going to be running like a vanilla Linux or BSC. They're going to be running like firecracker for her AWS Lambda. On top of that, you're going to want Versel to abstract over your abstraction over your abstraction. Then you're going to have TypeScript on top of your Node.js. Then you need Next.js because if there's one things we learned from Delaney's talk yesterday is that you should always mix client and server state. Then you're going to want Prisma [clears throat] for your OM better off because who doesn't want better off? You're going to use Neon because that's an abstraction over distributed Postgress. Upstach is abstraction on top of distributed menachd. I think it's Reddus. Reend for doing mail because you don't do send mail anymore. S3 and CloudFront. That's old school. You want Versell stuff on top of that for abstractions on top of your abstractions on top of your abstraction. Then you're going Tailwind, CSS, React, Next.js because you need it on the client and the server. Tan stack so your stack is nice and tan and base [clears throat] UI for accessible components, but they're not very stylish. You're going to want shad CN/UI on top of that.
[cough and clears throat] So things have changed. Um,
now if you look at this evolution, one way you could look at this and you could say like this is all still just like websites. you get like HTTP traffic in and then you like maybe talk to some other stuff and then you send the response back. Um, you could if you wanted to still use this 1996 via webstack today and I think that's pretty much what Hacker News does. They might have like two servers that are bare metal. Um, but most don't. Most do this
sort of more normal thing, you know, that we see here. Um, I've been out of the game long enough that I don't recognize half of these technologies. I had to learn about them for this talk. But a reasonable question you could ask here is like how much of this is technical? Like how much of this is people making really deterministic like careful consideration and saying on a technical level this is the absolute best set of dependencies for me. I've figured out we shouldn't have any more than this. We shouldn't have any fewer than this. And how much of it is cultural? How much of this is saying I'm going to do these things because they did or because that seems to be what you kind of do these days or like I don't know. That's just like I don't want to think too hard about this.
>> [clears throat] >> So, I want to do a quick comparison of uh some websites in the year 2026. These are uh the current websites as of this month. Each of these is a website for a programming language. They're all basically doing the same job. I want to compare some anonymous dependency graphs of different levels of dependencies that you can use to do basically the same job. So, the websites are TypeScript, Node.js, Python, Ruby, Rust, Zigg, Go,
and Rock. All right. So, here's the graphs. These [clears throat] are the number of direct and indirect dependencies for each of these static websites that are each about a programming language. Again, doing basically the same job. There are eight bars on this graph, but one of them is zero pixels, so you kind of can't see it. Um, one of them has almost 1,800 dependencies, almost all of which are indirect. So, an indirect dependency being uh I depend on this thing, but then this thing brings in several other indirect dependencies. So a question here, which of these two websites, again, I haven't labeled them. So which of these two bars would you guess are the ones that compile programs on the website? So what I mean by that, and I I'll tell you that the two are TypeScript and Rock without telling you which bars they are. So if you go on either the TypeScript website or the Rock website and you you can type in some code in their respective programming language, you can press run and you can run it and see what the output looks like. So, if you had to guess, which two bars would you guess represent the websites that actually have on their website a compiler that's not going to a server? It's being done on the website. [laughter] Any guesses?
>> All right, I'm going assume somebody said the two big ones [clears throat] because that works well for the talk. So, thank you. [laughter]
So, one of them, yes, is TypeScript and the other is Rock all the way at the end. So, this makes you think, hm, do you need a lot of dependencies to run a compiler on your website? Turns out, no, you just kind of need the compiler. That's like one dependency that doesn't necessarily require a whole bunch of indirect dependencies. You're going to have to look closely, and people in the back might want to scoot all the way up to the front. I'm going to add to the stacked bar chart. Here's the TypeScript dependencies. I'm going to go back and forth so you can see this. It's kind of blinking. That's how much of TypeScript websites dependency graph is the compiler. So, it's not that. Um, so what is all that stuff? Uh, well, I looked into this. I didn't spend a ton of time looking into this, but basically all of this comes from basically one dependency or cluster dependencies, which is Gatsby. I never used this. I don't know what it is. Uh website I I saw on the internet somewhere it said the best React framework. I don't know. Um I I've also heard people say it's obsolete or something like that. It used to be cool.
Whatever it is, it's bringing in a ton of indirect dependencies. So you could use Gatsby for this and have I guess about 1500 indirect dependencies from it. or you could not have any dependencies because it's a static website just like in 1996 and you just you don't have to do that. Um [clears throat] [laughter] they're all doing the same thing. So again, how much of this is technical, how much is cultural? I think it's really hard to make the case that every single one of these eight websites that are all doing fundamentally the same thing. Documentation, syntax highlighting, examples. Yeah. They're like, "No, no, this this TypeScript website needs to have this many dependencies. There's no other way. It has to be cultural." And I can make an even stronger case for that after I fill in the rest of these by just looking at how they're grouped. So which of these are use uh using package managers created by the same people. So for example, TypeScript and Node.js both using the npm package ecosystem. Same package manager, I would argue, same culture kind of makes sense. Ruby and Rust have about the same shape. They have about the same number of direct and indirect dependencies. Like small number of direct, large number of indirect, but nowhere near the npm level. Now, you might say, "Rust and Ruby are totally different programming languages." They are, but fun fact, when Rust needed a package manager, they were like, "hm, who does a good job of making package managers?" Oh, Ruby gems. So, they went to the bundler folks and the Rails core team people are like, "Hey, can you help us make a package manager for Rust?" And they did. And I would argue when I like when I saw this, I was not surprised. I was like, "Oh, yeah." Culturally, it's like it's the same people. So, wouldn't you expect that when they're making their website, that culture would carry over into like about how many direct and indirect dependencies you're going to have? This is not like perfect science here, but I look at this and I'm like, "Oh, yeah, I get it." Python and Go don't really have anything in common.
Python looks like it has about a 1 to1 ratio of direct to indirect dependencies, which you don't see anywhere else on the graph. But also, Python doesn't really have any cultural relationship when it comes to dependencies to any of these others. Same thing with Go. They have their own kind of philosophy that's really distinct from all these others, which we're going to talk about later. and then Zigg and Rock, but back here in the like almost no direct dependencies and like maybe a little tiny sliver of indirect, um, Zigg uses Zig's package manager and Rock's compiler is written in Zig, so it also uses Zig's package manager. So again, not really surprised that there would be some cultural overlap there. So I'm going to claim, yeah, like I think this is mostly cultural. Um, because again, these are all static websites about programming languages. You clearly don't need to have this many or this few dependencies to do that job. It's just that I think people are, you know, choosing what is sort of normally done in their respective ecosystems. These are cultural norms, not technical necessity, I claim. And we can see this in gamedev as well. Um, in some cases in even more extreme examples. So, I picked some nine games here. We're going to do like an abbreviated version of that same exercise. Uh, I picked these not because they're the most popular games, but because they are both popular or or some degree of popular within their respective ecosystems and also either open source or source available. So, I can actually look at like what are their dependencies because a lot of games are proprietary obviously. So, here we have a kind of similar looking graph. we have like two very big ones and then like two significantly smaller ones and a drop off down to basically zero. So same kind of deal as what you'd see with websites.
Now of course these are a little bit apples and oranges because with the websites they were all websites about programming languages. They're all static mostly documentation stuff like that. These are all very different games with two exceptions. Two of these games are remakes of the same game. Now again I'm gonna ask you the same question. Can you guess which two games without knowing which ones they are just based on the bars? Which two are remakes of the same games? I'll give you a clue. This is also a trick. >> The two left. >> Yes. Great, great answer. Okay. So, so this is one of them. And the other one is like this one down here. Now, this actually does make a little bit more sense than the other case because if you look at the blue part of the graph, they actually have about the same number of direct dependencies. So, like 29 and 30 respectively, but then one of them has a wildly different number of indirect dependencies compared to the other. And again, these are both remakes of the same game. may have a couple of differences, but they they're really just like fundamentally like, "Oh, we like that game and we made like a modern version of it." Um, so the ecosystems in question, these are Rust, C#, and C++.
Now, this is not telling like a super clean like, oh, look at this perfect narrative of like, oh, look, Rust has lots of indirect dependencies. Actually, they kind of all do. So, like here you see like, you know, really high total numbers of dependencies here, you know, because of all these indirect dependencies. Um, but [clears throat] like this game has a lot of indirect dependencies and very few direct. And so is the C# game right next to it. they're they're almost neck andneck. Um and in fact in within the C# ecosystem you see a lot of diversity of like ratios of direct to indirect dependencies, number of total dependencies, etc. C++ is kind of off doing its own thing though like in C++ land I don't see any green at all. There's like no indirect dependencies at all which is wildly different than C and Rust. Um and the number of directory dependencies is also extremely extremely low. So what's going on there? Well, I would argue that if you're going to pick application development and you're not talking about something like a database like Richard's talk yesterday about SQLite, I'm guessing he doesn't have 1,800 indirect dependencies in SQLite. I haven't looked, but I'm pretty sure pretty sure it's a lot lower than that. Probably zero probably zero direct dependencies, too. Zigg has one direct dependency and it's LVM and they're trying to get rid of it, but it's a hard one to get rid of. Um, so among like application developers, I would say that C++ gamedev culture is about the opposite extreme of what you see from like npm culture where you just see tons and tons of dependencies. So in npm culture, it's common to have many direct and also many indirect dependencies and usually the ratio is wildly in favor of indirect.
C++ is like very few direct like we saw in that graph and basically no indirect normally. Um, you could argue that this is because it's so much easier to add dependencies than npm. npm makes it easier to add dependencies. And maybe the C++ game developers would like to have more dependencies, but it's just it's just less ergonomic because they don't have the equivalent of like a package.json. I've heard that the C++ world is getting some package managers along the lines of npm, but they're not really mainstream yet. Um, so in C++ game dev culture, it's like if you want a dependency, you're going to vendor it, maybe fork it, like you're you're going to add it to source control. Now, you might say like, yeah, that nobody wants to do that. like your indirect dependencies are going to have to like how are they even going to talk to each other? Like how are you going to share code between them? This is going to be really painful. But I actually talked to a famous C++ game developer, Jonathan Blow, who's made games like Braid and The Witness and now Order of the Sinking Star. And okay, he was a C++ game dev for the first two games, but now he made his own programming language that's a C++ competitor. But when we were talking, the reason he's making the scare quotes is he's using scare quotes around the word vendored, which he thinks is kind of a funny word because he's like, "What do you mean that's just like how you do things?" like why is there a separate word for that and why is the word vendored? It's just that's how you get dependencies. And he made a pretty strong claim in the in this talk.
This is on the software unscripted podcast. Um if you're going to depend on external things, it should be in a folder that you check in. So this is not like a oh this is inconvenient. I wish it weren't this way. He's like no this is the right way to do it. And he went on to give some examples of things like he's like if I'm on a desert island, I don't want to need an internet connection to build my code. I want to be able to just have everything in my checkout. If I go back in time to an earlier checkout, all my versions of the dependencies are right there in the checkout. I don't need to go back to the internet to go get new ones. I just want everything in source control. Now, granted, if you have 1,800 dependencies and like a gigabyte of downloaded npm node modules, maybe you don't want all that in source control. I get it. But if you have a small number of them and basically no indirect dependencies, that stops sounding like such an unreasonable idea. It actually sounds like, oh yeah, I I could see some upsides to that. Um, npm culture has a lot of micro dependencies where you have like a very very small dependency that uh, you know, maybe doesn't need to be a separate package. We're going to look at one of these later. Um, anyone ever heard of leftpad?
So, this one was famous uh, for being a counterex example to both the desert island and also the the size of your dependencies philosophy. This is a library whose entire job was to give you one function and that one function's job was to pad the left side of a string. So, you could say like for example, I want like 10 characters in my string. if it only had eight, it would add two spaces in front of it or something like that. So, you could align monospace font things, I guess. Um, this was famous because the author of this package removed it from npm back when you were allowed to do that. And it apparently broke a ton of people's builds, which tells you two things. One is, wow, there are some really tiny micro dependencies in the npm world. And two, a lot of people are not caching their builds because like why would you need like why would it matter to your existing project that that was yanked off of npm unless you're going back to npm on every single build. Um, so this is like kind of the opposite of like yeah, he's if you're on a desert island, you would have been totally hosed if you'd, you know, been depending on that. Uh, but his point was like there's just a whole category of problems you don't have to deal with like that if you're just like put it all in source control. So you do see like some the opposite of that like mega dependencies or meths. Um, I don't really hear that, but I like kind of how it rhymes with meth. So that's cool. Um, but we're talking about game engines here really like you do tend to see like you know I'll depend on Unreal Engine which is like multiple millions of lines of code. That's one giant dependency.
And then there might be some like plugins for that as well. Um, but you definitely don't tend to see things along the lines of leftpad. Like in gamedev, it's it's going to be more like you're going to get like a physics library or you're going to get like a networking code library or something like that. Um, in PM culture, it's like pretty common to download on build. Apparently, a lot of people don't even bother to configure a cache for it. Whereas here, it's like, yeah, either you're going to have it in source control or it might be a system library. Uh we're talking at dinner last night about this and Andrew Kelly brought up an annoyance that he has is sometimes you're on Linux and they package LVM for you and make it available in the operating system which on the one hand could be kind of convenient and nice for code sharing but on the other hand they often enable some optional lib XML dependency for some reason. Uh and then end users of ZIG are like hey I can't build ZIG because I don't have lib XML and Andrew's like I don't use XML. LVM normally doesn't use XML. just because somebody on the system side has decided that they wanted to enable that optional dependency that you're being broken right now. So that has its own downsides, but it is something that happens in gamedev culture like DLS just being expected to be ambiently on the system. Um update frequency is a whole thing. So npm culture is like update constantly basically. You should always be maximally up to date. And then again here we have like pretty much the opposite. is like from what I hear gamedev it's like yeah you don't update your dependencies like physics is not going to change that often like unless you have some reason to do it and I did find somebody who has a really unusual culture but I really appreciate it um who has a take on this that's basically something I haven't really heard but I think more people should hear about and so we're going to hear about it now this is Mitchell sorry oh we haven't gotten him yet Russ Cox you should hear about this one too um a key feature of Go's package management system which uh which he developed is that upgrades do not happen until a developer asks for them to happen. So this is like when they were designing Go's system, Go is definitely not like vendor everything, fork everything. Go is like they have a package manager system, but the philosophy is like somewhere in between these two extremes. It's like you should always get sort of like the minimum version that satisfies your dependencies. You should upgrade carefully and intentionally, not as a matter of course and automatically. Um it's it's sort of like uh maybe a middle-of the road approach between these two. And you can also find like you know similar points on the spectrum of like Java is maybe somewhere between Go and and npm and Ruby I would also put in that category things like that. Um the extreme one that I wanted to show you is uh Mitchell Hashimoto. Anyone know Mitchell's work? Ghosty or yeah cool. Um yeah Hashi Corp fork [clears throat] your dependencies. Trim them to only your use case. In other words like your dependencies you're going to get probably a Swiss Army knife off the shelf and it's going to have a bunch of stuff that you're not actually going to use. He's like yeah just delete those parts. Did anyone ever do this?
Wow. Okay, cool. Yeah, this is this is an awesome conference. Like this is this is not a mainstream thing to do. Um, but it makes a lot of sense. Like you're you have this code that you've downloaded. There's a bunch of code in there that like is not just unnecessary to you, but it is probably actually harmful to your users in the sense that like there's going to be a bunch of conditionals to support all that flexibility that you're not using. It's going to slow your stuff down. Um it's if you're delivering it over the web, it's going to be, you know, increasing the size of your binaries or your uh your, you know, compile JavaScript or whatever the case may be. Um never update unless it breaks for your users. In other words, if there's a problem and you need to fix the problem, then sure, update if the update will be the solution to the problem. But don't just do it as a matter of course. I've been vocal about this for 10 plus years. I've always said that updating is way riskier than latent bugs. Now, we're going to talk about why he's saying that's risky and also the latent bugs he's talking about uh in a second. The bug latent bugs can be tracked in CVE's monitored. If you're [clears throat] updating a dependency, it's on you to analyze every single commit in the full transitive set of dependencies. So direct and indirect dependencies. Does anyone do that? Go commit by commit on every single Yeah.
[laughter] One. Okay. And it's Andrew Kelly. [clears throat] Um yeah, most people don't do this. Most people do the opposite of this where they just like press the update button and are just like, "Yeah, I now I'm up on the latest version of Windows. I mean, npm whatever dependencies. I think maybe part of this comes from like operating system autoupdate culture where it's just like, oh yeah, there's like a new version of the thing. Yes, please. Um, the thing is your operating system has a completely different level of vetting than your 1,800 npm dependencies. Like there's just like people whose job it is to look for security probability, you know, problems and stuff like that. Um, that's just not happening in like these are not the same things when you're pressing that button.
If you don't see anything compelling, don't update. I remember at Hashi Cororp once in a while an engineer would try the updated dep or replace a do-it-yourself library with an external one and I'd always ask show me the commit we need don't update for the sake of it now this is again not normal um but you know if you're thinking like actually this does sound kind of nice I can see an argument for why you would want to do this yes it's going to take more time but there are a lot of benefits to doing this um and we'll talk about those in a sec if you ever find yourself getting push back on this I might point out you know if somebody's saying like I I work in a business like we have to we have to go fast. We have to like ship things. We we cannot take the time to vet every single one of our dependencies in this way. We can't go commit by commit. We can't trim them down, etc. You know, how are we going to be a successful business if we do that?
Well, Hashi Corp, started by Hashimoto, it's named after him, you know, um he co-founded it and then went on to using this exact dependency culture go public
and became a billionaire. So, you could point out like, well, if we do this, we will all become billionaires. Now, I'm not saying that logic is is guaranteed to hold, but the point is like clearly you can have a very very very wildly successful business while doing this. It's not inconceivable. It's not common, but it's not going to prevent you from being a successful business. Far from it. Feeling pretty swell about this mentality with all the supply chain attacks happening. So, let's talk about that. [clears throat] Let's play a game. It's called dependency or no. So, here's a GitHub issue. Uh this is from 2014 where someone says I need a new function added to this dependency. This dependency I have I use this library. I would really like for it to have a flat map. This is like a streaming li library does stream stuff. Um I need this right now. Unsure how to continue but fortunately the person was able to unblock themselves by writing the function themselves. This is four lines or five if you're going to count the closing braces. That's a you know 20% of it is the closing braces there. Um GitHub has provided a very convenient way for you to obtain this dependency.
They put a button right there. you can copy the code and paste it into your code. Now, there might be licensing concerns, granted because this person did not say, "I'm making these four lines of code available." Sorry, five uh you know, on a on a particular license. So, you might look at this and understand the details of what they've done, maybe think I could reimplement this myself. It might be hard, but I bet you could do it if you were concerned about the licensing. But what actually happened was um Oh, yeah. So, my verdict here is like not worth a dependency. Don't don't add a direct or indirect dependency for this.
If you want this functionality, just copy paste it in. Or if you're like Mitchell Hashimoto, you would probably just say, I don't want that function. I don't care. I'll just ignore it because I'm not using this person needs it. So, they've added it to their code. That's fine. I'm not going to add it to mine. Everybody's great. Everybody's fine. So, what actually happened is that the author said, "Hey, if you publish a flatmap module," which ended up being a package, a separate dependency. So, they added a line to their package.json to like add this instead of the four lines that would have taken to have the entire dependency. Um, I'll go ahead and merge it. So, they did go ahead and merge it.
Um, fast forward a little bit. Uh, this is an issue that was open on the repo called backdoor dependency. Um, yeah. So, what happened was they added an indirect dependency on this new flatmap stream thing. And it turned out that person was malicious. And what they did was they published a little patch uh release which um made it so that instead of doing this little four-line thing, uh it also ran some code that tries to steal all your crypto currency. So, um that was not ideal. uh that was not an ideal thing to upgrade to uh if you wanted to get that indirect dependency. Um but some people did and then there was a follow-up thing like I don't know what to say a whole postmodon whole thing and now the repository has been archived because nobody wants to depend on it anymore. Um this [clears throat] was shall we say avoidable.
I want to tell you about dependabot. Has anyone ever used dependabot? Okay, a lot of people. Dependabot's website says keeping your dependencies updated is one of the easiest ways to keep the software you build secure. I'm going to go back to the previous slide for a second and talk about so now now to be fair updates are a
double-edged sword. On the one hand they can get you malware. On the other hand they can also fix latent bugs. That's what Mitchell was talking about with latent bugs and we're going to talk about an example of that as well. There is an important question though like which is which is more likely in this day and age. While it's critically important to keep your dependencies updated in a recent survey 52% of developers said they find it painful. So that's the problem is that pressing the button to update your dependencies and not vet them at all. That's the thing that needs to be solved. Don't worry, dependabot alleviates that by updating your dependencies automatically. So you can spend less time updating dependencies and more time building and obtaining malware. Um I'm not a big fan of this approach. I think Mitchell's approach is better. Um you know, we're at software should work. One of the ways your software can stop working is if you update your dependencies uncritically and end up obtaining not necessarily just malware, but also just like bugs. I mean, in the ideal world, every time you press the update button, you get better performance and fewer bugs, like bug fixes and stuff like that. Maybe more functionality or maybe the dependencies just get smaller. They they they do the trimming out work for you of stuff that turned out to be unnecessary. But in practice, all of those can happen in reverse. You can get more bugs. You can get malware in the worst case. You can get more bloated stuff that's adding more functionality that you're not using, but which you're still paying for at runtime. Updates are a double-edged sword, and we shouldn't pretend that updating is just an unalloed good. And I don't think culturally this is the way to go. I think Mitchell is a lot closer to what's better even if I don't personally go as far as he does. Um so I combined the two graphs from earlier.
This is like all the the websites and all the games and like sorted by dependencies. So here we have the like TypeScript website with the 1,800 dependencies all the way down to the Rock website. Some of the games down there have you know very few dependencies direct or indirect. And again I want to just sort of highlight the point that you don't need a ton of dependencies to do these things. Like these are very successful games. I would say probably the most successful popular game of all of these is this one right here which was Doom 3. Um they just made the engine themselves. They they did everything from scratch pretty much.
Basically no dependencies. Um and they did a good job with it and it worked out. We saw like you know these websites are all doing the same thing. Two of these games are doing the same thing. And now we can kind of see why I'm showing you these graphs. It's not like I'm trying to be a jerk and say like a look at these silly people with their you know ridiculous numbers of dependencies. It's like no, any one of these 1500 dependencies here could have been event stream which was the one that added flatmap stream and that got you malware if you did that. This is a real concrete downside. This is not a joke.
This is not just like a oh, you know, it's bloated but we're not using it. Haha, no big deal. Like this this this is a real vulnerability service here. Now the other example that I mentioned earlier of like a dependency that's not malicious but can cause you problems anyway is log forj. Anyone hear about the shell forj? Yeah. Or log for shell. Yeah. So basically this is like a super common dependency in the Java ecosystem and uh commonly direct dependency commonly also indirect dependency and what ended up happening was basically they released the new feature and the new feature turned out to have a vulnerability that nobody caught unintentional was not malicious. It was just like they didn't realize the implication of what this feature meant if somebody decided that they wanted to abuse it. It had already made it out into the wild the new release a lot of people had updated to it before people realized this and then were sort of scrambling to patch it. And that would be an example where once they had patched it, you would want to update as fast as possible to get the fix so that you're not vulnerable anymore.
Unfortunately, if you have a ton of indirect dependencies, what ended up happening with this in practice was that I am using log forj, you know, whatever I update the latest version, but I depend on something that hasn't updated or it depends on something that hasn't updated. And so the number of indirect dependencies made this a much worse vulnerability because the hard part was getting the patch out to every single one of your indirect dependencies. And that was what sort of caused the problem. So again, if you're updating super fast, you're vulnerable to this category of thing where it's something malicious that they're just trying to sneak out the door and see how many people will update to it before they get discovered. Here, this is the the more passive latent bug that Mitchell was talking about. But his point was, look, there are CVEs for this. Like when these things come out, you get notified. It's not like you're going to be totally in the dark. If you're subscribed to these something big like this, you're going to hear about it and you can then know I need to upgrade, you know, as quickly as possible to to remove the vulnerability.
But at that point it does matter how many indirect dependencies you have that are using the thing that turned out to be vulnerable. So lower number of indirect dependencies means you're less vulnerable to all this stuff. Um you know I asked the question earlier like you know dependabot claim this is like the the way to keep yourself safe is to is to do upgrades all the time. And so there is this question of like you know is the log forj latent bug more common or is it the more you know malicious attackers. It's not even close. Like maybe it was at some point in the past, but these days like 2024, they found half a million malicious packages just in 2024. This is like a 1.5x increase over 2023 and it was like a thousand plus percent increase compared to 2020.
Like the graph of how how much the frequency of this stuff is happening is just going up and up. And you can see why. Because culturally, it's a totally normal thing to just have a million dependencies and not vet them. So if I'm an attacker, I'd be like, great, this is awesome. This this is like what a time to be alive. Um, another way to look at this is that what I've really graphed here is like this is your exposure to compromised dependencies. Like the more total dependencies you have, especially if you're not vetting them when you're updating them, the more vulnerable you are to this stuff. And unfortunately, this is a downside that we are all living with now. I mean, a lot of the software that we use is this way. And a lot of the way that you accumulate indirect dependencies because you find something on the shelf that legitimately does satisfy your use case and you're like, "Yeah, this is actually going to save me a ton of time or maybe it's really hard to implement correctly. So, I do want to pull this thing off the shelf, but it's going to pull like 20 other things with it, and I don't like that, but I don't really see many alternatives. So, one of the takeaways from this talk is if you're building a library like this, think carefully about your the indirect dependencies that you're imposing on people who are going to use your thing if they decide that your thing is the best fit for their situation.
The uh the piffy more eloquent way of uh explaining all this graph, of summarizing it all, I'm going to turn to the immortal words of Biggie Smalls. Mo dependencies, mo problems. [clears throat] All right. Um, so let's go through a real quick concrete example of this. So this is actually something that I ran into when I was working on the rock programming language website. Um, so like I mentioned earlier, we have this like section of the website on the homepage if you scroll down a little bit where you can just type in some rock code and press run and just see what the output is. You can kind of get a feel for the language. Now part of this is like we have a web assembly binary for the compiler. So the compiler is written in zig. So unlike the typescript website, that part's not in JavaScript because we don't have a JavaScript version. That's like one dependency on on the compiler itself. Um, but there's another thing that we need, which is just for the website that's unrelated to the compiler, which is we want syntax highlighting. Like when you're typing in here, if you're editing like the string literal, we want it to be highlighted like a string literal and whatnot. Um, that's not something we can just do ahead of time because we don't know what you're going to type in there yet. So that needs to be in JavaScript. So I was looking at this and I was thinking back to like back when I was in the web development game, if I need syntax highlighting on my programming language website, what's the first thing I do?
I'm like, oh well, this is a problem that has been solved many times over. I'm going to go to npm and just type in syntax highlighting or syntax highlighter and see what's there. And I immediately did this even though I already went a different direction, but I was like, well, let's let's just see what comes up. And you know, one of the first things that happens when you start thinking about with the mentality of like, oh, I'm going to go get a dependency off the shelf. Let's go go see what I can find. One of the first things that happens that you you start thinking about which one is the right one for me. So, in this case, as it turns out, like the first three here, this is like syntax highlighting for terminals. This is like





