[m-dev.] storing GetVars vs Vars Re: source-to-source debugger proposal

Peter Moulder Peter.Moulder at infotech.monash.edu.au
Tue Oct 2 16:28:21 AEST 2007


On Tue, Oct 02, 2007 at 03:10:19PM +1000, Zoltan Somogyi wrote:
> On 28-Sep-2007, Peter Moulder <Peter.Moulder at infotech.monash.edu.au> wrote:
> > [...] a function pointer and the closure
> > information; is the closure information implemented as a pointer to a
> > record of [one word for each argument including typeinfo arguments],
> > or is it more expensive than that?  If it is just that then the
> > [costs of passing a closure] are
> > 
> >   - Allocate the closure record.
> >   - Fill it.  (Just [a word copy per argument], they're already local variables.)
> 
> That is your misconception. There is no type-safe way to fill the closure
> without doing *everything* that the GetVars approach [presumed typo
> for Vars approach or (equivalently) the implementation of the GetVars
> function] does, not unless you get *below* the source level.

It is unfortunate that something so endemic to logic/functional
programming as a closure call must involve chasing a linked list of
univ's, when the function already knows the number & (often) type of its
arguments, and the caller is compiler-generated.

pjrm.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list