English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    
Browse thread
Emulating width subtyping with 1st-class modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dario Teixeira <darioteixeira@y...>
Subject: Re: [Caml-list] Emulating width subtyping with 1st-class modules
Hi,

> It depends on what you call "heavy". For the syntactic
> aspects, as you say, Camlp4 can be helpful. One could also
> imagine future extensions in the compiler itself, e.g.:

I meant "heavy" performance-wise, which you've also clarified -- thanks!

Incidentally, has the Ocaml team ever entertained adding native support
for a record type with width subtyping?  From my type-theory-non-expert
point of view, what strikes me about width subtyping is how closely related
it seems to the structural subtyping found in the object system and in
polymorphic variants.  It would therefore fit very nicely along those
features.  Perhaps it could even leverage the same row variable mechanism.

While 1st-class-modules add yet another user-space solution to the width
subtyping problem (the other prominent approaches being the object system
and Jacques Garrigue's Polymap [1]), these user-space solutions always
imply some -- albeit small -- price to pay performance-wise.

Cheers,
Dario Teixeira

[1] http://www.math.nagoya-u.ac.jp/~garrigue/code/ocaml.html