Rain Paharia
👤 PersonAppearances Over Time
Podcast Appearances
Like if you have a particular code base you like, which you feel like might use something like that, then kind of dig around in that code base source code. I think that is kind of, you know, that, that feels like a good way. And I've discovered a whole bunch of crates that way.
Like if you have a particular code base you like, which you feel like might use something like that, then kind of dig around in that code base source code. I think that is kind of, you know, that, that feels like a good way. And I've discovered a whole bunch of crates that way.
I think a place where that's kind of organically arose is... is with CLI parsing crates, because there's a whole bunch of CLI parsing crates. So some things like clap, which many, if you've written a Rust CLI tool, you've almost certainly come across clap. But there's a whole bunch of other points in this design space that people have hit with various trade-offs.
I think a place where that's kind of organically arose is... is with CLI parsing crates, because there's a whole bunch of CLI parsing crates. So some things like clap, which many, if you've written a Rust CLI tool, you've almost certainly come across clap. But there's a whole bunch of other points in this design space that people have hit with various trade-offs.
And I was really appreciative of people really put together benchmarks for like, you're considering things like, how long a build takes and like how many bytes get added to the final binary, right? Versus like error handling and so on. And I think, you know, different projects can reasonably make different trade-offs here.
And I was really appreciative of people really put together benchmarks for like, you're considering things like, how long a build takes and like how many bytes get added to the final binary, right? Versus like error handling and so on. And I think, you know, different projects can reasonably make different trade-offs here.
And one of the things I, this table was like when I saw this table and when I saw like, you know, the amount of work put into it, it was just very, very impressive to me.
And one of the things I, this table was like when I saw this table and when I saw like, you know, the amount of work put into it, it was just very, very impressive to me.
Yeah, and in particular, like, I mean, clap has a couple different ways to use it. You can use it with or without the proc macro, but then there's a bunch of others. So actually another one that I really like that is much lower level than clap is lexopt. So the goal of lexopt is like all it gives you is an iterator over the options, right?
Yeah, and in particular, like, I mean, clap has a couple different ways to use it. You can use it with or without the proc macro, but then there's a bunch of others. So actually another one that I really like that is much lower level than clap is lexopt. So the goal of lexopt is like all it gives you is an iterator over the options, right?
So you're getting an iterator, and in the iterator, you get a little bit of structure. So you get whether it's a single dash or a double dash. So you get very, very basic things like that. And some, if you really want that low level of control, then lexopt is great.
So you're getting an iterator, and in the iterator, you get a little bit of structure. So you get whether it's a single dash or a double dash. So you get very, very basic things like that. And some, if you really want that low level of control, then lexopt is great.
But the trade-off there is that you need to write your help yourself, and you need to remember that each time you add a thing, you also need to add the help for that. And maybe the error messages aren't as good and so on. So these are the kinds of things that... that you have to consider. So, you know, I recommend clap as the thing to go to, right, if you want to start.
But the trade-off there is that you need to write your help yourself, and you need to remember that each time you add a thing, you also need to add the help for that. And maybe the error messages aren't as good and so on. So these are the kinds of things that... that you have to consider. So, you know, I recommend clap as the thing to go to, right, if you want to start.
But these are all things that are, you know, worth considering for things like embedded binaries and so on.
But these are all things that are, you know, worth considering for things like embedded binaries and so on.
Yeah. It's, it's, it's really cool. I have, I've actually used it in combination with clap. So I was like, you know, there were places where I had clap to the first wall and then, um, And then I wanted a second level of parsing for something more detailed. And then I used LexOpt for that. So ultimately, it takes a bunch of strings. It is a thing that takes up strings and produces output.
Yeah. It's, it's, it's really cool. I have, I've actually used it in combination with clap. So I was like, you know, there were places where I had clap to the first wall and then, um, And then I wanted a second level of parsing for something more detailed. And then I used LexOpt for that. So ultimately, it takes a bunch of strings. It is a thing that takes up strings and produces output.
So it's a primitive that is generally useful, I think.
So it's a primitive that is generally useful, I think.