[Larceny-users] fixnum math

William D Clinger will at ccs.neu.edu
Mon Sep 22 13:34:55 EDT 2008


Ray Racine noticed:
> fx math is unexpectedly slower.

Yes.  This is mentioned	in the note at the end of
Larceny	User Manual section 8.11 [1].

Larceny's GreatPrimOpCleanUp [2] will improve	matters
by making the R6RS fx operations run at	the same speed
as the generic operations, but the R6RS fx operations
will never be any faster than the generic operations
in Larceny because the R6RS requires all fx operations
to check their arguments and also their result.

At one point, the R6RS editors intended	to provide
an unsafe mode in which	the R6RS fx operations might
be faster than the generic operations, but unsafe fx
operations were	removed	from the draft R6RS at the
insistence of at least two discussants,	one of whom
was Aziz Ghuloum.  The idea that fx operations should
be faster than generic operations still	persists, but
that idea is not consistent with the R6RS as ratified.

Larceny	may eventually provide a Larceny-specific
library	that exports Larceny-specific versions of
the R6RS fx operations that run faster than the
generic	operations.  The Larceny-specific versions
would be unsafe	in the R6RS sense, because they	
would be incompatible with the R6RS operations,
but they would be safe in the traditional sense
of the word "safe".

Will

[1] http://larceny.ccs.neu.edu/doc/user-manual-alt.html#R6rsArithmeticSection
[2] https://trac.ccs.neu.edu/trac/larceny/wiki/GreatPrimOpCleanUp



More information about the Larceny-users mailing list