Version française
Home     About     Download     Resources     Contact us    
Browse thread
Efficency of varient types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Baelde <david.baelde@g...>
Subject: Re: [Caml-list] Efficency of varient types
Hi,

First, I'd like to point that you're talking about sum types and not
variants. For short, variants are the backquoted labels `Int of int,
and I think they cost more at runtime, for they cannot be encoded as
integers.

My solution for your problem would be to write a simple type inference
in order to check your scheme programs before translating. It's not so
hard if you use tools like lambda-prolog for example. Of course you
won't be able to translate untypable programs, but I think that's no
problem. The only difficulty which I foresee is having polymorphism
infered, at least it is not obvious to do with lambda-prolog, and
you'll probably miss it.

Cheers.
--
David