[clean-list] About abstract synonym types...

Marco Kesseler m.wittebrood@mailbox.kun.nl
Thu, 05 Feb 2004 20:55:08 +0100


> -----Original Message-----
> From: clean-list-admin@cs.kun.nl 
> [mailto:clean-list-admin@cs.kun.nl] On Behalf Of Fergus Henderson
> Sent: donderdag 5 februari 2004 14:33
> To: Arjen van Weelden
> Cc: Fabien TODESCATO; clean-list@cs.kun.nl
> Subject: Re: [clean-list] About abstract synonym types...
> 
> 
> On 05-Feb-2004, Arjen van Weelden <arjenw@cs.kun.nl> wrote:
> > Arjen van Weelden (by mistake) wrote:
> > >[Fergus wrote:]
> > >>    - how do they interact with separate compilation?
> > >>      Does changing the definition of an abstact synonym type
> > >>      require recompiling modules that import the module which
> > >>      defines it?
> > >
> > >They should not force compilation of other modules, but because the
> > >semi-abstract definition is in the .dcl definition module, it will 
> > >trigger recompilation.
> > 
> > John just told me this is not correct. It SHOULD force recompilation
> > because the compiler optimizes/generates different code 
> because of the 
> > implementation of the semi-abstract types. Which is of 
> course obvious, 
> > if you think about it ;-).
> 
> No, it's not obvious -- it is implementation-dependent.  
> These are abstract types, so there are no actual operations 
> being performed on them; they are just being passed around.  
> Whether or not the compiler will generate different code for 
> different concrete types if they are just being passed around 
> is implementation-dependent.
> 
> For example, the original Mercury implementation represents 
> all data types as a single word (types such as tuples that 
> don't fit in a single word get boxed), and the argument 
> passing convention is that the first input argument goes in 
> register r1, the second in r2, etc.  This argument passing 
> convention does not depend on the types of the arguments. I 

Isn't it so that some boxing and unboxing may occur - next to just
passing around types -, which does make the convention depend on the
type of the arguments?

Regards,
Marco