4 ms·
The "killer feature" for XML, for me, has been XSL — a language dedicated to transformation of XML. OTOH, there's only one high-quality open-source implementati
by thechao 5y ago
The "killer feature" for XML, for me, has been XSL — a language dedicated to transformation of XML. OTOH, there's only one high-quality open-source implementation of that language.
Having spent a lot of time in XSL, I think its core feature is the matching-and-synchronization story. Essentially, every XSL template can be cut up into a sequence of CPS blocks that perform a mapping operation on the sub-calls to apply-templates.
Porting the matching & template apply syntax to Python is fairly easy — the ergonomics are great! The problem is that mapping operation is functionally impossible for me to implement, efficiently, in Python with parallelism. The result is that even though the big implementations of XSL are 100-1000x slower than Python in terms of serial computation, they handily beat Python in deeply concurrent constructs.
My understanding of `asyncio` is insufficient for me to determine if it's even possible to map `asyncio` onto multiprocess pools and get back the data at the yield point.
And — even if it were possible — the batteries-included version of ElementTree reloads & reparses the entire document in every subprocesses, completely destroying the performance.
- dionidium 5y agoXSL was misunderstood and misused by pretty much everyone who did try it. Of course, writing code in XML is pretty awful, so that didn't help its reputation, either. But the ideas in XSL -- its declarative/functional nature and simple tree-processing-via-pattern-matching processing model -- were really quite good, especially once you understand it well enough to avoid trying to recreate procedural code with it.
- agumonkey 5y agoIIRC there was a board or mailing list service built on top of xsl only. Prince something. I was surprise by the near zero lag between requests (no Ajax I believe)
- dehrmann 5y agoI can't call XSL a good language, but it's capable and standardized...which is more than JSON equivalents can say.
- laurencerowe 5y agoSince it maps directly onto native data types the JSON equivalent to XSL is really just JavaScript or Python or any other dynamic language.
- ncann 5y agoThere is one quote which perfectly encapsulates my experience working with XSLT: "XSLT is a failure wrapped in pain. There’s no job for which XSLT is the right tool. If you think you found a job for which XSLT is a good tool, chances are the job itself is fucked up" – masklinn
- thechao 5y agoMaybe XSL 1 or 2? XSL 3 combined with XQuery (or Xpath 3.1) is pretty tolerable. It's just slow.