English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Compiler feature - useful or not?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-11-14 (12:37)
From: Alain Frisch <alain@f...>
Subject: Re: [Caml-list] Compiler feature - useful or not?
Pierre Weis wrote:
> type row = private int;;

The only difference with an abstract type is that some generic 
operations (comparision, equality) can be optimized, and currently, it 
happens only for some basic types. So exporting a private abbreviation 
(instead of an abstract type) is useless when the type is not a basic 
type. Is it correct?

I find it somewhat disturbing to expose low-level optimization features 
as part of the type system. Couldn't a similar thing (specializing 
operations on integers) be achieved by always storing manifest types in 
.cmxs files?  (Within a single compilation unit, the compiler could keep 
type definitions across module boundaries.)