[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] [CHICKEN 5] Change numerics representation

From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] [CHICKEN 5] Change numerics representations
Date: Tue, 9 Aug 2016 18:53:36 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Aug 09, 2016 at 10:31:54AM +0200, address@hidden wrote:
> > All in all, I think these changes are worthwhile but for the caveat
> > that it results in us having NO MORE reserved type tags left!  In
> > fact, the complete change is only possible because we dropped the
> > SWIG pointer type; before that we only had two reserved types left.
> > I don't see an easy way to reclaim type tags elsewhere; we don't have
> > that many.  Maybe (but only MAYBE) we could get rid of lambda info as
> > a separate core type.
> Maybe we can phase out the "tagged pointer" type? Having one reserved tag
> left would be a good thing, IMHO.

Yeah, tagged pointers don't have much added value, but that's mostly
because there's no way to force the type.  It would be more useful if
you could annotate foreign function declarations so that they only
accept pointers with a given tag.

Here's a radical idea: How about removing the plain "pointer" type?  It
can be implemented as a tagged pointer with a tag of whatever we like
(for example #f).  It does mean that each and every pointer needs another
word of storage, but most code doesn't rely on pointers very heavily

I find it difficult to choose between these two kinds of pointers.
It feels a bit like a tagged pointer is just as easily represented by
a pointer in a record type of one field.  On the other hand, like I
mentioned above, it might be better to embrace the pointer's tag and
make the FFI able to rely on tag checking for extra safety.  If we
go this route, we would also need to add a tag to the pointer-vector,
though, I think...

Anyway, food for thought.  But I also don't really see why we absolutely
need to have a reserved tag, which does nothing.


Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]