caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christian Rinderknecht <christian.rinderknecht@devinci.fr>
To: Ker Lutyn <ker527mail@yahoo.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] extending a type with Marshal
Date: 10 Oct 2003 11:19:16 +0200	[thread overview]
Message-ID: <1065777556.21150.15.camel@lulu.devinci.fr> (raw)
In-Reply-To: <20031008212257.19628.qmail@web40606.mail.yahoo.com>

Hello Ker,

On Wed, 2003-10-08 at 23:22, Ker Lutyn wrote:
> [...]
> In other words, Foo sends message A to Bar. We'd like to be able to
> handle two possibilities:
> 
> (1) Foo sends message A' to Bar, who interprets it as A.
> (2) Foo sends message A to Bar, who interprets it as A'.
> 
> ...where A' is an extension of A.
> 
> To do this it would be necessary to 'extend' a type at one end [...]

This kind of concept is already present (subtyping, versioning,
relaying) in a specification language called Abstract Syntax Notation
One (ASN.1), and, at least, easily supported by one of its encoding rule
called Basic Encoding Rule (BER).

The point of ASN.1 is sharing the same ASN.1 module between the two
possibly hetereogeneous peers, also agreeing on an encoding/decoding
scheme (e.g. BER) and then each peer compile the ASN.1 module into type
definitions and codecs in his application language (obviously, you seems
interested in O'Caml). Then compile and link.

In my PhD thesis I wrote a parser and a checker for ASN.1:1988/90, but
no code generation for O'Caml. I remember that Erlang had such a
facility integrated transparently. It is worth looking this way.

For all information about ASN.1, see the excellent site of France
Telecom R&D at http://asn1.elibel.tm.fr/. By the way, these folks
develop some ASN.1 tools in O'Caml, but do not disclose their source
code in general.


Hope this helps,


Christian

-- 
---------------------------------------------------------------------------
Christian Rinderknecht                        Phone: +33 1 41 16 70 39
Assistant Professor                           Fax:   +33 1 41 16 71 71
D.E.R. Genie Informatique (ESILV)
Pole Universitaire Leonard de Vinci
F-92916 Paris La Defense Cedex (France)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2003-10-10  9:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-08 21:22 Ker Lutyn
2003-10-08 21:38 ` Richard Jones
2003-10-08 21:54 ` Peter Jolly
2003-10-10  8:37 ` skaller
2003-10-10  9:19 ` Christian Rinderknecht [this message]
2003-10-10 10:38   ` skaller
2003-10-10 17:19   ` Martin Berger
2003-10-12  9:01   ` William Chesters
2003-10-12  9:06     ` William Chesters
2003-10-12 19:45     ` About ASN.1 and network encoding (was: Re: [Caml-list] extending a type with Marshal) David MENTRE

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=1065777556.21150.15.camel@lulu.devinci.fr \
    --to=christian.rinderknecht@devinci.fr \
    --cc=caml-list@inria.fr \
    --cc=ker527mail@yahoo.com \
    /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;
as well as URLs for NNTP newsgroup(s).