* Re: Caml-list Digest, Vol 18, Issue 37
[not found] <20061222110003.D2056BC6C@yquem.inria.fr>
@ 2006-12-22 11:16 ` Peter Sewell
0 siblings, 0 replies; only message in thread
From: Peter Sewell @ 2006-12-22 11:16 UTC (permalink / raw)
To: caml-list
"Till Varoquaux" <till.varoquaux@gmail.com> wrote:
>Gcaml (http://web.yl.is.s.u-tokyo.ac.jp/~furuse/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.
Peter
^ permalink raw reply [flat|nested] only message in thread