Evan Martin (evan) wrote in evan_tech,
Evan Martin

ocaml + xml

I was bitching to gaal about the usefulness of LogJam's XML output in generating PDFs, when I started Googling for "ocaml xml".

OX uses OCaml's meta-language support to support XML terms in the language directly (see tutorial for some EBNF¹). They also have some regular-expression-like pattern matching over XML.

CDuce isn't really ocaml-related (besides being written in it) but appears to use DTDs to statically verify / optimize XML processing. They say "a CDuce program can run faster (30% to 60%) than an equivalent XSLT style-sheet" but I don't really understand how valid the comparison is.

I've played with PXP before but it hurt my head. But I think they were doing what seemed to me to be the sensible goal: use the DTD to process the XML directly into a data structure. A straight DOM tree is annoying to work with, because every node must have a list of children, even for the common cases where they only have one string child; using a DTD allows you to specialize your tree to the document format.
(LogJam's XML processing is really painful and makes me feel gross because it's so repetitive. But that's in C and I don't expect much out of C.)

1 I hate it when people introduce language features via EBNF. It's much easier for me to see some examples and infer abstraction than it is for me to see abstraction and generate examples.

  • your vcs sucks

    I've been hacking on some Haskell stuff lately that's all managed in darcs and it's reminded me of an observation I made over two years ago now (see…

  • ghc llvm

    I read this thesis on an LLVM backend for GHC, primarily because I was curious to learn more about GHC internals. The thesis serves well as an…

  • found my bug!

    Not too interesting, but this has been bugging me for a week. Been working on a toy program that proxies a TCP connection. It was working fine for…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.