
CDuce: XML-oriented functional language - mucholove
http://www.cduce.org/examples.html
======
rwmj
I've actually used CDuce in production. It was certainly interesting, a kind
of "XSLT/XPath done right". However it had major drawbacks such as being very
difficult to deploy and not having any easy way to integrate with existing
OCaml code (ocamlcduce was a camlp4 extension which tried to integrate the two
but was tricky to get going). For example you can really easily and powerfully
parse XML documents, but you can't save the result in a database or even to a
flat file (even printing the result is hard).

I should say that it's no longer developed and no longer works with any
currently available versions of OCaml.

Nowadays I use libxml2 from OCaml instead and just insert untyped XPath
expression strings into my code, so that's a step backwards from the point of
view of safety, but at least it works.

[https://web.archive.org/web/20101125015934/http://merjis.com...](https://web.archive.org/web/20101125015934/http://merjis.com/developers/adwords)
[http://ocsoap.forge.ocamlcore.org/](http://ocsoap.forge.ocamlcore.org/)

~~~
minxomat
I actually spent the last week looking for something like XPath done right,
because I'm doing a lot of xml based tree processing. I resigned to
implementing something on top of the generative xpath VM, but CDuce looks
amazing!

How difficult would you say would it be to bring it up to date with the
current ocaml? How did you solve the output problem in production?

~~~
vbezhenar
I did not try it myself, but here's few ideas: Scala has good support for
pattern matching and Scala has dedicated syntax for XML literals. It might
allow for very concise code for XML processing.

~~~
minxomat
I'm also exploring that avenue, but with Haxe, which also support xml
literals, macros and pattern matching, but can target any language.

------
bjoli
Oleg Kiselyov's ssax for scheme is very neat. I have been using it for some
time as a more easily programmable XSLT. I heard a rumour that there is a
Haskell port as well.

Anyway, here is the web page:
[http://ssax.sourceforge.net/](http://ssax.sourceforge.net/)

------
bsaul
A bit off-topic :

Recently started wondering what would be the preferred language to code some
general "web service plumbing" tool : quickly generate client to access a web
api, as well as easily provide data mapping and data "passing" from endpoints
to endpoints.

I started investigating language that would let you create DSLs, but i'm
wondering if this field hasn't already been explored, and some tools created
for that purpose.

------
sansnomme
This is the JSX before JSX was a thing.

~~~
mcaruso
That moniker should probably go to E4X:

[https://developer.mozilla.org/en-
US/docs/Archive/Web/E4X_tut...](https://developer.mozilla.org/en-
US/docs/Archive/Web/E4X_tutorial/Introduction)

------
microtherion
That name may have somewhat unfortunate connotations in Italy…

~~~
trurl
Not sure about intent, but I assumed it was at least partly named in analogy
to XDuce: [http://xduce.sourceforge.net/](http://xduce.sourceforge.net/)

------
galkk
Out of curiosity clicked on a page (the scars of XSLT and XPath are almost
healed), but complete lack of any kind syntax highlighting in code examples
(even books 20 years ago had bold/italic/etc) immediately made me close it

