[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
re: issue BOGUS-FIXNUMS
- To: firstname.lastname@example.org
- Subject: re: issue BOGUS-FIXNUMS
- From: trwrb!smpvax1!jrg@ucbvax.Berkeley.EDU
- Date: Thu, 14 Jul 88 12:51:45 PDT
I believe it is imperative for Common Lisp to support a portable means
of declaring the range of integers to be handled ina particular operation
is within that range efficiently supported by the underlying hardware
architecture. This is what I mean when I say (declare (fixnum x)) in a
program. I understand that this limits the portability or usefulness of
my program after porting. But I believe this limitation is more funda-
mentally imposed by the underlying hardware architecture than by my
fixnum declaration -- the performance of operations involving "fixnums"
is critical to many programs.
When a Common Lisp provides only one integer representation, that may
limit the portability of my program, depending on the representation.
I may need large range; I may need the fastest possible integer operations
restricted to the range efficiently supported. A representation that
limits range to a fixed range is a bogus bignum implementation, in my book.
A representation that does not take advantage of fast integer arithmetic
performance for a restricted range of integers has a bogus fixnum implementa-
tion, similarly. That is assuming, of course, that there is only that one
When a Common Lisp provides more than two representations, it is also
limiting portability in some way. Let's say there are three representations.
Let's further say that one corresponds to the accepted definition of fixnum
and another to the accepted definition of bignum. Then use of the third
will likely limit portability, if my declarations are intended to be for
sake of efficiency. Use of (declare ((integer n0 n1) x)), could, of
course, be useful and portable given three representations. But they
would not be used for the same purpose as a fixnum or bignum declaration.
I guess my point is that the portability of my program is something I
determine based on the power of the hardware architecture and the quality
of the Lisp implementation. Given that the architecture is powerful
enough (has a wide enough word size, for example), I can port to it.
But my fixnum declarations are for performance. If it were not important
for that declaration to be made for efficiency, I likely wouldn't make it
at all. This may reflect a difference in philosophy between those who
declare everything for sake of program clarity or readability and me, I
suspect. Those who make declarations for other-than-performance likely find
my fixnum declarations utterly detestable. I'm not arguing one philosphy
versus the other; I assuming a sizeable set of programmers who use declara-
tions similarly to how I use them. Taking away the fixnum/bignum distinction
takes away a valuable and well-used tool.