caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Yaron Minsky" <yminsky@gmail.com>
To: "Jacques Carette" <carette@mcmaster.ca>
Cc: OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Typing Dynamic Typing in ocaml?
Date: Wed, 17 Dec 2008 20:16:42 -0500	[thread overview]
Message-ID: <891bd3390812171716m6652ddf9sd4d7db5221f7b898@mail.gmail.com> (raw)
In-Reply-To: <494956BD.9030000@mcmaster.ca>

[-- Attachment #1: Type: text/plain, Size: 2330 bytes --]

The following blog post might be of use.

   http://ocaml.janestreet.com/?q=node/18

y

On Wed, Dec 17, 2008 at 2:45 PM, Jacques Carette <carette@mcmaster.ca>wrote:

> I have two (related) questions:
> 1) Has anyone transcribed the TypeRep library into ocaml?
> http://people.cs.uu.nl/arthurb/dynamic.html
>
> 2) How do I embed 'dynamically known' data into a single ocaml
> data-structure?
>
> More specifically, I am experimenting with a (new) language which allows
> deduction and computations to be performed with equal ease on its terms.
>  This language uses ocaml has the host meta-language (ie the interpreter is
> written in ocaml).  I would like to be able to use arbitrary ocaml
> data-structures to represent some of my terms, when these terms are known to
> come from specific theories.  For example, I would like to use Bigint to
> represent integers, but without exposing that per se.  Perhaps a better way
> to phrase this would be to say that I want to have a "generic external data
> container" type in my language terms, which I can instantiate in multiple
> different ways (in the same program), with data handled in different
> modules, without having to change the 'generic' data-structure everytime I
> add a new module.
>
> Polymorphic variants of course come to mind - but they would force me to
> add a new type parameter to all my types, which I would rather avoid.  I
> would be quite happy to use polymorphic variants if I could 'hide away' the
> extra type parameter involved with open variants.  My attempts at hiding
> this parameter (with existentials) has been too successful, in that once
> hidden I can't extract my data from this container anymore [which is the
> correct behaviour for the compiler].
>
> I thought of using objects too, but my data does not really have any common
> structure, so the object would be a pure container.  I cannot see any
> advantage over polymorphic variants, and all the same headaches of an
> 'extra' polymorphic parameter remain.
>
> Jacques
>
>
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 3112 bytes --]

      parent reply	other threads:[~2008-12-18  1:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17 19:45 Jacques Carette
2008-12-17 19:58 ` [Caml-list] " Stéphane Glondu
2008-12-17 21:08   ` Jacques Carette
2008-12-17 21:15     ` Stéphane Glondu
2008-12-17 21:15     ` Daniel Bünzli
2008-12-17 20:29 ` Mikkel Fahnøe Jørgensen
2008-12-17 21:28 ` David Teller
2008-12-17 22:42 ` Mauricio Fernandez
2008-12-18  1:16 ` Yaron Minsky [this message]

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=891bd3390812171716m6652ddf9sd4d7db5221f7b898@mail.gmail.com \
    --to=yminsky@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=carette@mcmaster.ca \
    /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).