From: Mauricio Fernandez <mfp@acm.org>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Re: Serialisation of PXP DTDs
Date: Sat, 25 Oct 2008 21:19:09 +0200 [thread overview]
Message-ID: <20081025191909.GH32611@NANA.localdomain> (raw)
In-Reply-To: <caee5ad80810241527j253cbbf5taf3c6a2fdc0a3ed4@mail.gmail.com>
On Sat, Oct 25, 2008 at 12:27:08AM +0200, Mikkel Fahnøe Jørgensen wrote:
> > serialization too. My protocol family is both substantially simpler and better
> > adapted for extensibility. For example, the generic pretty-printer (able to
> > decode any message) takes ~40 lines of code.
> >
>
> I see - somehow it reminds me of stackish - kind of S expressions
> backwards I guess - apparently with good performance, but also tag'ed
> I reckon.
>
> http://www.zedshaw.com/essays/stackish_xml_alternative.html
heh, I read about Stackish a while ago (a few years?).
Besides being human-readable, Stackish uses tags in a different way.
Whereas Stackish uses tags for the node names (behaving like Google's Protocol
Buffers or Facebook's Thrift in this regard), in my design tags are like
OCaml's: a way to encode different constructors for a given field.
For instance, if you have a field
...
length : float
...
and latter decide that a mere float is not enough, and it should be actually
type len = Cm of float | Inch of float
...
length : float
...
my system assigns a tag to each constructor, the way OCaml does (the original
type definition carries a default tag which corresponds to the Cm
constructor). AFAICS this can only be encoded in a roundabout way in Stackish,
since it doesn't have sum types.
> More specifically regarding DTD's:
> Since I have been playing around with Ragel: http://www.complang.org/ragel/
> I was also wondering about converting DTD's to state-machines with a
> stack, then feed them to a Ragel input file and have Ragel produce a
> table that can be run by a small interpreter.
> I did something similar for an XML parser as a kind of DTD
> replacement, although I manually wrote the state-machines and compiled
> to C, not a table.
> For OCaml you would link in the C interpreter, or rewrite it in OCaml.
Turning each data schema into a state-machine sounds like a fair amount of
work. What I was looking for and ended up implementing is similar in spirit
to bin-prot's "with bin_io" extension, with the difference that the type is
specified using a language-independent abstract syntax instead of OCaml's type
language, and that the wire format is designed to allow extensions happening
in both producers and consumers non-atomically.
--
Mauricio Fernandez - http://eigenclass.org
next prev parent reply other threads:[~2008-10-25 19:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-22 20:11 Dario Teixeira
2008-10-22 23:05 ` Sylvain Le Gall
2008-10-23 15:34 ` [Caml-list] " Dario Teixeira
2008-10-23 16:37 ` Stefano Zacchiroli
2008-10-23 16:53 ` Markus Mottl
2008-10-23 19:26 ` Dario Teixeira
2008-10-23 21:05 ` Mauricio Fernandez
2008-10-23 22:18 ` Gerd Stolpmann
2008-10-23 22:50 ` Mauricio Fernandez
2008-10-23 22:21 ` Dario Teixeira
2008-10-23 23:36 ` Mauricio Fernandez
2008-10-24 9:11 ` Mikkel Fahnøe Jørgensen
2008-10-24 14:03 ` Markus Mottl
2008-10-25 18:58 ` Mauricio Fernandez
2008-10-26 18:15 ` Markus Mottl
2008-10-26 19:47 ` Mauricio Fernandez
2008-10-24 21:39 ` Mauricio Fernandez
2008-10-24 22:27 ` Mikkel Fahnøe Jørgensen
2008-10-25 19:19 ` Mauricio Fernandez [this message]
2008-10-23 16:46 ` Markus Mottl
2008-10-23 14:55 ` [Caml-list] " Gerd Stolpmann
2008-10-23 18:41 [Caml-list] " Dario Teixeira
2008-10-23 18:58 ` Markus Mottl
2008-10-23 20:04 ` Dario Teixeira
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081025191909.GH32611@NANA.localdomain \
--to=mfp@acm.org \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox