What does HackerNews think of hammer?
Parser combinators for binary formats, in C. Yes, in C. What? Don't look at me like that.
(and maybe you can do a decent job of blind "hinting" with smarter dsp algorithms, gradient descent, and orders of magnitude more cpu, and just ignore the tt hints virtual machine)
well-defined subsets of svg are a pretty interesting thing; i feel like a smol computing system might benefit from using something like that as its base graphical layer for things like fonts and windows; then a font engine can delegate the rasterizing down to the svg layer
'how far can we golf an svg subset' might be a good rough description of vpri's nile and gezira https://news.ycombinator.com/item?id=10535364
parsing annoying formats is what https://github.com/abiggerhammer/hammer is for; we were able to get it to parse pdf. unfortunately it's not pure ruby. the smallest i've been able to get a peg parser library is http://canonical.org/~kragen/sw/dev3/tack.py which is 27 lines of python, but i'm not sure it can be reasonably extended to do the kind of binary parsing that hammer does without balooning in size
This puts all of the recognizing/parsing code in the same location. It also verifies the entire input at the same time, before the results are passed back to the main program. You get clean valid/invalid check of the entire input.
For a very good discussion of why formal recognizers are important (and why, if possible, it's important to design transport formats and protocols that are deterministic context-free or simpler[2]), see Meredith and Sergey's talk[3] at 28c3.
[1] https://github.com/abiggerhammer/hammer/
[2] http://www.langsec.org/occupy/
[3] https://media.ccc.de/v/28c3-4763-en-the_science_of_insecurit...
Something like this? https://github.com/abiggerhammer/hammer
Another high level effort in security is meredith paterson's "language theoretic security"[1] can help you code secure protocols, to fight against this problem.
There's also a tool to help implement it called hammer[2].Not sure if fully developed yet.
[1]http://boingboing.net/2011/12/28/linguistics-turing-complete...
https://www.youtube.com/watch?v=XVZrmp5MAas
And also talks about a general parser she's building for this issue on github[1]. Using this parser , she have built a DNS and base64 recognizer , and i think they are working on building recognizers for more protocols.