[Grace-core] Tuples - Re: [Minigrace] In praise of consistency

Michael Homer mwh at ecs.vuw.ac.nz
Tue May 29 18:05:15 PDT 2012


On Wed, May 30, 2012 at 12:45 PM, James Noble <kjx at ecs.vuw.ac.nz> wrote:
>> Tuple-passing was in the spec at one point, but it gets very
>> confusing. In particular, it seemed that Tuple had to be the top type
>> or else single arguments wouldn't behave properly. There's no type
>> information to disambiguate
>
> So I'm trying to remember the issues around tuples.
> I think there are two problems - consistency / ambiguity in the behaviour,
> and efficiency of the calling conventions.   For now I'll ignore efficiency.
>
> That's what happens now, as I understand it.   Where does tupling come in?
> Well I guess the varargs methods _all already tuple_.  I think in the "forthcoming"
> version of minigrace, with the "new AST"   all calls will be compiled tupled -
> Michael is that right?
I am not aware of anything that is different than before. There are no tuples.
> On the implementation side, I think because any call can be variadic - with no special syntax on the calling side - that under the "new AST" the "calling convention" (requesting convention?)
> tuples up everything anyway - including single arguments into a oneple.  But i'm happy to be corrected!   This makes interoperability with almost anything harder.
Arguments are passed as a flat array of object pointers, as they were
before. Alongside that is an array of lengths of each part, and the
number of parts. Single-argument calls are essentially the same as
they always were, with extra arguments in the calling convention and
another layer of indirection for the length.
-Michael


More information about the Grace-core mailing list