guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Add `fixnum?' VM primitive


From: Ludovic Courtès
Subject: Re: [PATCH] Add `fixnum?' VM primitive
Date: Fri, 25 Mar 2011 14:21:06 +0100
User-agent: Gnus/5.110013 (No Gnus v0.13) Emacs/23.3 (gnu/linux)

Hi!

Andreas Rottmann <address@hidden> writes:

[...]

>>> Excellent.  Should we put `define-inlinable' in some common place to
>>> avoid code duplication?  If so, where?
>>
>> That would be nice, if we are confident that it’s not broken any more. ;-)
>> ISTR that Chez’ ‘define-integrable’ macro is hairier than that, so I
>> wonder if our implementation is too naive.  Thoughts?
>>
> I'll have another look at that; if it turns out it's good, would `(ice-9
> inline)' be a proper place for it?

Or even in the default name space, IMO.

It should be documented with a warning, as done in the Elisp manual
(info "(elisp) Inline Functions").

[...]

>> BTW why does the ZIP implementation in Industria keep calling ‘fixnum?’?
>>
> It's actually the implementation of `(rnrs arithmetic fixnums)' that
> calls fixnum for almost every operation; also see my other mail [0],
> where I talk about lifting that at least for some operations.

OK, I see.

I think that a fixnum API sucks.  In an ideal world, the implementation
would be optimized such that you can be switch from fixnum to bignum
with very little overhead:

  1. The run-time support should be optimized to make arithmetic
     operations fast in the fixnum case.

  2. When the compiler can statically determine that code is dealing
     with fixnums, it can generate code that uses untagged machine
     integers (that’s what Bigloo does, for instance).

I’ve always thought that R5RS implicitly acknowledges the fact that
implementations can provide almost costless fixnum/bignum transition.

Thanks,
Ludo’.



reply via email to

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