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
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: 2005-11-27 (14:57)
From: Lukasz Stafiniak <lukstafi@g...>
Subject: Re: [Caml-list] Efficency of varient types
2005/11/26, Michael D. Adams <>:
> I have recently learned about OCaml and have been impressed by how
> fast it is in the benchmarks.  However I have discovered that variant
> types can slow down a program quite a bit.
> I am working on a program that translates code from scheme into ocaml.
>  (Later I will try python into ocaml.)  Because it is a dynamicly
> typed language, the most natural translation would make everything a
> function of a large variant type like:
> type value = Int of int
>  | Char of char
>  | String of string
>  (* etc. *)

Use MetaOCaml with native-code compilation and untagging.
MetaOCaml retypechecks and outputs the untagged version if it can.

Best Regards,