What a Rewrite of Libexpat Needs blog.hartwork.org · 11 points · 0 comments · HN...
HN Best 200 @best
What a Rewrite of Libexpat Needs blog.hartwork.org · 11 points · 0 comments · HN thread
TL;DR Sebastian Pipping, a maintainer of libexpat, lists the requirements he considers important for any future non-C replacement of the streaming XML parser. He names five known rewrite efforts in Rust and Lean and says the replacement is probably a matter of time.
- libexpat is a fast streaming XML parser written in C99, widely used alongside libxml2, cross-platform and MIT-licensed.
- Five rewrite projects are listed: expat-parity, expat-rs, libexpat-rust and rexpat in Rust (rexpat is archived), and lexpat in Lean.
- A replacement should be a drop-in with the same C header and shared library and all public API functions working.
- It should handle out-of-memory gracefully and be protected against billion laughs, parameter laughs and quadratic-runtime attacks without rejecting large benign formats like DocBook and DITA.
- External entities should be supported but disabled by default, and it should implement XML 1.0 5th edition with full DTD and entity support.
- Parsing speed should beat C libexpat compiled with Fil-C, and the rewrite should keep feature and bug parity with libexpat while it exists and be actively maintained.
Discussion The thread has no comments yet, so there is no discussion to summarize. The post was submitted with 11 points and has not drawn any replies.