[bitc-dev] Opinions wanted: Infix shift operators

Nathaniel W Filardo nwf at cs.jhu.edu
Fri Aug 6 15:20:26 PDT 2010


On Fri, Aug 06, 2010 at 01:50:54PM -0700, Jonathan S. Shapiro wrote:
> On Fri, Aug 6, 2010 at 11:45 AM, wren ng thornton <wren at freegeek.org> wrote:
> 
> > Jonathan S. Shapiro wrote:
> > > I would actually prefer to use the currying syntax myself, and if someone
> > > can show me how to make that work I think I would adopt it.
> >
> > For value-level stuff, the approach used by the spineless taggless
> > g-machine (GHC's runtime machine) offers one way of implementing
> > currying without the overhead you get from the naive implementation.
> >
> > Essentially, you use a closure of the eta-expanded form. The first
> > pointer is to the code block, and the remaining pointers/values are the
> > stack frame. (Thus, you can take over the extra pointer in the C call
> > stack, just like OOP does for passing an object's vtable.) I'm assuming
> > BitC uses a C-like call stack instead of putting everything in the heap
> > like functional languages do, so the exact approach would need some
> > modification to fit in with BitC's execution model, but I don't foresee
> > any show-stopping issues.
> >
> 
> I'ld be happy to look again, but this approach didn't seem to play well with
> the registerized argument passing conventions used by most modern
> processors. Basically, it works well if arguments can be accumulated on the
> stack, but not very well if accumulating them requires shifting them around
> between registers.
> 
> Beyond that, the decision to registerize arguments in BitC isn't elective;
> it's prescriptive. It is mandatory to use the native calling convention.
> 
> If there is a way to do this without tying arity into function types, I'ld
> really like that, and I'll definitely look at the spineless tagless G
> machine work.
> 
> shap

In particular, there's this paper that seems relevant:
www.cl.cam.ac.uk/~mb566/papers/tacc-hs09.pdf

--nwf;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://www.coyotos.org/pipermail/bitc-dev/attachments/20100806/95dfa62d/attachment.bin 


More information about the bitc-dev mailing list