Anyway, sorry if I sound a bit brash, but I think the conversation got derailed from recommendations for XML libraries that fit my use case, to discussing FFI, foreign libraries and suggesting I do not know my use case and I should not avoid the FFI and the foreign libraries.
inline-python - python has built in XML parser. Latest python support multi threading
For parsing xml in a lightweight (if not rigorous) way, tagsoup is great. Namespace support might not be sufficient. I can’t speak to generating xml – a pure library like the classic xml
library might suffice as long as you don’t care about performance a great deal.
I’ll also plug hw-xml
as a great library that enables efficient parsing and scanning of gigantic xml structures – it is neither lightweight in its footprint nor especially elegantly documented (though the api itself is slick). However, its underappreciated, and worth a plug.
Finally, for the library you probably want – HaXml has been the “standard, not slick but does everything you need” library for a very long time.
Seems like hw-xml supports streaming but xeno is better on its own benchmarks?
hw-xml has a very specific place it is designed for, which is succinct indexing and lookup within large files, not whole-document parsing (i.e. its designed for a very specific out-of-band sort of usage). it also has a lot of sharp edges and needs care to be used correctly – i suspect the benchmarking doesn’t exercise its strong point, but does indicate that xeno would be preferable for other cases, and the low-dep-footprint is a huge plus. xml is certainly a place where there’s little in the way of “one size fits all” answers.