So, as a follow-up to the original
silly-formatting
post, I spent some time trying to figure out just how
bad the LALRPOP-based
sillyfmt implementation was. It turns out that there’s
really nice utilities for using the
afl fuzzer with Rust, so I hooked that up
with some pretty basic heuristics and let it run for a few seconds. Then, since
it turned out to be
really bad, I got nerd-sniped into setting up a different
parser called
tree-sitter that uses a more generic parsing algorithm.
Unfortunately, that led to another rabbit-hole:
tree-sitter is
a C library,and while Rust/C interop is generally good, this is much less true
when you involve the WebAssembly toolchain(s).