Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: David Chemouil <David.Chemouil@enseeiht.fr>
To: caml-list@inria.fr
Subject: polymorphic variants
Date: Fri, 09 Jun 2000 10:52:33 +0200	[thread overview]
Message-ID: <3940B051.BF1136F7@enseeiht.fr> (raw)



Hi,




I and my teammates are currently writing a compiler for a distributed
language, called ML-Act, that generates OCaml 3.00 code. I'm involved in
the code generation and middleware design. 

The middleware is made of servers which are, of course, intended to work
with many different applications. 

Each application is likely to send messages through the network. We only
find the type of an argument when compiling an ML-Act program.

The problem is that, as server communicate for admistrative reasons,
they exchange messages with arguments of which I already know the type
constructor. 

As a consequence, the servers must manipulate a type 'argument' which is
not yet completely defined: the part interesting the servers is defined
but not the one interesting the generated OCaml program. 

Therefore, the server programs could not be linked, because the type
'argument' can't be created as long as I don't know all the type
constructors. So, these server programs should be compiled for a
specific application, for which I would have found all possible
constructors for an argument.

The solution I found is the following one: I use polymorphic variants.
Then, the servers use polymorphic constructors, and can be compiled.
And for each compiled ML-Act application, I generate a type 'argument'
containing, as constructors, the server constructors, plus the
constructors found at compilation.


However, I wonder if my solution is really good, from a software
engineering point of view. Or, on the contrary, is it a good example of
why polymorphic variants can be interested. In fact, I wonder how I
could have done without this new possibility in OCaml 3.00.


-- 
David Chemouil [mailto:chemouil@enseeiht.fr] [mobile: 06 84 16 26 65]

Laboratoire d'informatique et de mathématiques appliquées (IRIT-INPT)

"Je vous ai fait trop faibles pour sortir du gouffre, parce que 
 je vous ai fait assez forts pour n'y point tomber" -- Rousseau




             reply	other threads:[~2000-06-09 17:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-09  8:52 David Chemouil [this message]
2000-06-09 19:04 ` Markus Mottl
2000-06-09 20:03 ` Markus Mottl
2007-01-16 20:32 Polymorphic Variants Tom

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=3940B051.BF1136F7@enseeiht.fr \
    --to=david.chemouil@enseeiht.fr \
    --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