Rain Paharia
๐ค SpeakerAppearances Over Time
Podcast Appearances
keys and values and maps.
And so I'd kind of on the side around like April or so I kind of started prototyping this, this approach, which lets you store, which basically lets you store keys and values side by side next to each other.
And I spent a few weeks, you know, kind of trying that out, right, like, and, you know, I did a bunch of prototyping, I did, I did a bunch of work,
And then it was like an interesting experience because that was all handwritten, right?
So it was like three weeks of like around 2000 lines of code, like carefully handwritten, like there's a lot of unsafe code and it was like pretty challenging.
But then I realized that one of the things I needed to do was that if you define a map in Rust, there's a lot of things you need to add to that map.
in order to make that like a functional API.
So if you look at Rust, like HashMap or BtreeMap or whatever, there's like, you know, there's a ton of different APIs that are all like, some of them are syntactic sugar, some of them are more primitive.
An example is like, say the Entry API, which if you've used Rust maps, you might be familiar with the Entry API.
So that's an API that lets you kind of say whether an item is occupied or not.
and it lets you insert an item.
I think it's a beautiful design, but it is a very verbose design.
And so the map library I was writing, and I'll just drop a link to it.
It's called IEDQD.
This map library had four different maps, right?
And so one of the things I was dreading was, OK, oh my god,
I need to write all of these map APIs for different types, right?
And that is just terrifying.
So it's like, okay, you have a prototype and maybe you have one of those types, but then you have these three other things and for each thing you need to go in and update the map type.
And it's just like...