Depending on your preferences, there’s also Nom if you prefer parser combinators, or lalrpop or grmtools if you prefer LR(1) parsing.
Since reading Which Parsing Approach by Laurence Tratt (author of grmtools), my plan for my own parsing projects has been to use an LR(1) parser generator for the stronger compile-time guarantees.
I’ll try to fit in sampling it at some point in the near future as a candidate for building on.
I just decided to finally double down and do the work to switch away from WordPress to GitHub Pages and:
pulldown-cmark
-based CLI that I wrote a couple of years ago to render single documents and it’d be nice to retrofit it (or at least its features) onto something Rust-based for my blog. (Hell, just a couple of days ago, after implementing support for shortcodes, I got carried away implementing a complete set of shortcodes for rendering depictions of gamepad buttons like :btn-l-snes:
within passages of text. Bit of a shame, though, that I’d have to either patch pulldown-cmark
or maintain the smart punctuation and strikethrough extensions externally, if I want to hook in shortcodes early enough in the pipeline to be able to implement Compose key-inspired ones like :'e:
/:e':
→ é or :~n:
/:n~:
→ ñ without breaking things.)```svgbob
fenced code blocks which produce rendered diagrams, <price></price>
tags which provide currency-conversion estimation tooltips with the exchange rate defined in a central location, etc.) or have plans for (eg. plotters-generated charts with some kind contributed extension equivalent to matplotlib’s xkcd mode because it’s important, Wikipedia-style infobox sidebars, etc.), I want to experiment with a WebAssembly-based plugin API so I’m not throwing the kitchen sink in.I know what they mean. It may not be enormous, functionality-wise, but just the Iterator
trait alone feels enormous when you’re trying to figure out which method does what you want.
I think it’s indicative of a need for more work put into making the UI teach people how to search by function signature.
There was a post on Reddit from 2019 that I loved to link to which was about how the poster rewrote a NodeJS service into Rust.
The original was taken down in response to Reddit enshittifying, but it’s still up on the wayback machine and the graphs were hosted on Imgur, where they’re still up without needing the Wayback machine:
The problem with making a custom web server is that you take responsibility for re-solving all the non-obvious security vulnerabilities. I always try to delegate as much network-facing code as possible to a mature implementation someone else wrote for that reason.
Here’s how I’d implement it, based on stuff I’ve done before:
std::thread
to bring up mpv in a separate thread.tokio::sync::oneshot
in the “job order” object your async code drops into the channel and then have the async taskawait
the receiving side. That way, you can have the async task block on the some kind of completion signal from the sync thread without blocking the thread(s) underlying the task executor.