Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: Caml-list Digest, Vol 18, Issue 37
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-12-22 (11:16)
From: Peter Sewell <Peter.Sewell@c...>
Subject: Re: Caml-list Digest, Vol 18, Issue 37

"Till Varoquaux" <> wrote:
>Gcaml ( also has types
>informations at runtime. It seems to be pretty close to what has been
>asked (ie simplicity of dynamically typed systems with security of
>statical types). I haven't played with it, so I don't exactly know
>what it does. However I do know it supposedly provides type safe
>marshalling, which gets me to ask: what is the main difference between
>marshalling in hashcaml and g'caml?

If I recall correctly, the type equality used by GCaml is much coarser
than the OCaml static type equality - for example, if you have two
type definitions with isomorphic structure but different constructor
names, GCaml would let you marshal at one type and unmarshal at the
other.  In contrast, HashCaml gets the static and dynamic type
equalities much closer in sync, including taking account of abstract
types.  The implementations are probably also rather different:
HashCaml records the results of static type inference and adds explicit
type-passing for polymorphic functions, but it does not add any type
information per-value at runtime, which I imagine (without checking)
GCaml does, to support type analysis of arbitrary values.