I need to extract partial data from PDF’s and pdf.js library is to high level and bloated for my case.
While creating my PDF parser i stumbled upon a lot wird stuff and debugging took forever.
So I built myself a visual debugger that shows the state, incoming bytes and resulting drawing
It is more or less the same as elm debugger… where msg and model is replaced with bytes and state.
The actual handleByte function is used in parser and debugger, so changes is hot reloaded and the result is “instantly” visible when changing parser logic thanks to the amazing elm-watch.
Making debugging wierd stuff straight forward
So this is a tip for other people having a state-machine-style parser. I can now see the problem instantly instead of starting to add logging and stuff and start figuring out where stuff went wrong.
I just made a video explaining how PDF works under the hood using the debugger: