News for hackers. Stuff that matters.
Re:CDuce: XML-oriented functional language by masklinn on Sunday November 24, 2019 @01:20PM (#21622232)
Do you mean xslt? Xpath always looked like the right-est xml technology to me, but xslt like an interesting idea hampered by a horrible implementation language.
Re:CDuce: XML-oriented functional language by minxomat on Sunday November 24, 2019 @01:55PM (#21622435)
Well I guess I'm just hooked on jq. Functional pipelines with named blocks you can recall. Here's a recent script I wrote: https://gist.github.com/turbo/36e87947a56cfaacec9d0356b3e521...

I'm mad that I don't have that for XML. I do a lot of tree and graph processing in Postgres and xpath lends itself well for that. However debugging sucks! Also, since you can't store results along the line (like in jq), querying order dependent pairs needs a union. Not so in xpath 2 but PG dropped work on XML right when Json was ramping up. I'm still mad! There was a discussion whether to integrate Zorba into Postgres (which speaks JQ and XPath, using the same type system and query engine) but that never got any traction. So xpath was bastardized into its "modern" variants but something (subjectively) intuitive like jq never developed for it. This is where I see the need for CDuce.

Re:CDuce: XML-oriented functional language by masklinn on Monday November 25, 2019 @02:16PM (#21631661)
> Well I guess I'm just hooked on jq. Functional pipelines with named blocks you can recall. Here's a recent script I wrote: https://gist.github.com/turbo/36e87947a56cfaacec9d0356b3e521...

> I'm mad that I don't have that for XML.

Really not fond of that (past the first 3 lines I'd rather break out a proper scripting language), but it feels closer to xquery.