1 May 2002 01:24
Re: Modules and typing
John Max Skaller <skaller <at> ozemail.com.au>
2002-04-30 23:24:55 GMT
2002-04-30 23:24:55 GMT
Francois Pottier wrote > >This is correct. This problem arises not only with abstract types, but more >generally, in any programming language that has polymorphism. The most common >solutions to the data representation issue are > > + adopt a uniform representation (e.g. everything-is-a-pointer), as in O'Caml > > + require that abstract types are pointer types, as in Modula-3 (?) and, more > recently, Cyclone > > + pass type information around at runtime, as in the TIL/ML compiler > > + adopt two representations, a uniform (boxed) one and a specialized (unboxed) > ones, and insert coercions in your code to switch between the two, as in one > of Xavier Leroy's papers > > + adopt specialized representations only, duplicating polymorphic functions > if they have to be used at several types whose representations differ > >As far as I can tell, you are interested in exploring the last option. > Yes. More precisely, in finding a hybrid system which permits superior performance without losing too much generality. I support pointers, so it should be possible for a single specialisation of a polymorphic function to be use where all the type variable are under a pointer. I currently expand products, but sum types use tagged pointers.(Continue reading)
RSS Feed