rain 🌦️ on Nostr: The winnow library for #RustLang is the most fun I've had writing parsers in my ...
The winnow library for #RustLang is the most fun I've had writing parsers in my entire life. It's taken a thing that I've always dreaded and turned it into a joy.
I love two things about it:
1. It uses &mut &[u8], &mut &str, &mut <token stream ref>, etc. That is simply so much nicer to use than consuming a &[u8] and returning a &[u8].
2. It isn't all-encompassing! it encourages you to interleave imperative and functional code, just like idiomatic Rust in general.
https://docs.rs/winnowPublished at
2024-02-24 22:47:19Event JSON
{
"id": "3667c5ee444110e770b190915c1c52773178c44d5bad6eac0fb50da9efa263ac",
"pubkey": "3e2a3a4f5ffcb7b24d3799fc00c60cc06d764a1fcf58162c79ec5b17a891ef3f",
"created_at": 1708814839,
"kind": 1,
"tags": [
[
"proxy",
"https://hachyderm.io/@rain/111988889340428350",
"web"
],
[
"t",
"rustlang"
],
[
"proxy",
"https://hachyderm.io/users/rain/statuses/111988889340428350",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://hachyderm.io/users/rain/statuses/111988889340428350",
"pink.momostr"
]
],
"content": "The winnow library for #RustLang is the most fun I've had writing parsers in my entire life. It's taken a thing that I've always dreaded and turned it into a joy.\n\nI love two things about it:\n\n1. It uses \u0026mut \u0026[u8], \u0026mut \u0026str, \u0026mut \u003ctoken stream ref\u003e, etc. That is simply so much nicer to use than consuming a \u0026[u8] and returning a \u0026[u8].\n\n2. It isn't all-encompassing! it encourages you to interleave imperative and functional code, just like idiomatic Rust in general.\n\nhttps://docs.rs/winnow",
"sig": "c609a8a8e3bd3d0aa6bbfa92086fb21f051d743f3fb6c9e8e97217a3348c3aa785cbb78b0406af8ce6cf8824f68132bff8cf42e569cea35d1fcd314c320e727e"
}