-
Notifications
You must be signed in to change notification settings - Fork 32
SpankyMode
== Spanky mode ==
Larceny's R6RS-conforming mode, nicknamed "Spanky", is intended for testing the portability of R6RS programs. Toward that end, it provides as few optional features as possible (since all such features are non-portable), and sacrifices performance in order to detect violations and uses of non-portable features. Programs that have been tested in Larceny's R6RS-conforming mode will be more likely to run in other implementations of R6RS Scheme than programs that have been tested only in Larceny's R6RS-compatible mode. On the other hand, programs that appear to run correctly in less rigorous implementations of R6RS Scheme may contain latent portability bugs that will prevent them from running in Larceny's R6RS-conforming mode. Those programs will probably run in Larceny's R6RS-compatible mode, however.
Spanky mode will enforce all implementation restrictions mandated by the R6RS. In addition, it will attempt to enforce additional restrictions that are merely recommended or permitted by the R6RS, and will also explore some dark corners where latent bugs are likely to lurk in seemingly R6RS-conformant programs. Some of the ways in which Spanky mode will surpass its R6RS obligations are noted here.
Spanky will not recognize any extensions to the lexical syntax mandated by the R6RS.
Spanky will not run a program unless it is said to be safe.
Spanky will check to make sure that the number of return values matches the number expected by the continuation whenever the R6RS allows such checking.
Spanky will detect attempts to mutate an immutable value.
Spanky will endeavor to behave in surprising ways whenever its behavior is unspecified by the R6RS.
Spanky will choose different orders in which to evaluate the subforms of a procedure call.
Spanky will support only the standard libraries that are described in the R6RS, along with the libraries that are contained within the file that contains the top-level program. No mechanism for splitting a program into multiple files will be provided, since the R6RS does not mandate any such mechanism.
Spanky will distinguish or not distinguish, at its whim, instances of a library for different phases. This will assist with testing for latent bugs in programs that, contrary to the draft R6RS, expect libraries to have a consistent semantics.
Spanky will try to find a reasonably perverse interpretation of top-level semantics, to assist with testing for latent bugs in programs that, contrary to the draft R6RS, expect all implementations to have a consistent top-level semantics.
Spanky will attempt to use several different semantics for eqv?
and eq?
, while taking care to satisfy all R6RS requirements for these predicates.
Spanky may use IEEE single precision flonums instead of the IEEE double precision used by Larceny's R6RS-compatible mode, or may round to single before storing into a destination.
Spanky may not be able to represent infinities or NaNs, or may use signalling NaNs, or may raise an exception when it sees the lexical syntax for an infinity or NaN (as allowed by section 9.9.2 of the current draft R6RS). (The -but-not-that-pedantic
command-line switch will disable this feature.)
Spanky will raise an exception when one of these procedures is passed arguments of differing exactness, and the numerical value of the result cannot be represented as an inexact number without loss of exactness. (The -but-not-that-pedantic
command-line switch will disable this feature.)
Spanky will require the radix to be 2, 8, 10, or 16, even if the R6RS allows (but does not require) other radixes.
Spanky will perform more checking than is required of procedures such as map
and for-each
.
Spanky will explore the underspecified behavior of quasiquotation.
Spanky will decide randomly whether to copy a string that is already in the specified form.
Spanky's native endianness will not be the endianness that most programmers would expect for the target processor. For example, it might be big-for-bytevectors-but-little-for-floats
. (The -but-not-that-pedantic
command-line switch will disable this feature.)
Spanky's (native-eol-style)
may be spanky
, which will not be accepted by the eol-style
syntax or make-transcoder
procedure. (The -but-not-that-pedantic
command-line switch will disable this feature.)
If no transcoder is specified when opening a text file, then Spanky will select a transcoder at random. (The -but-not-that-pedantic
command-line switch will disable this feature.)
Spanky might or might not copy a bytevector or string before opening an input port that delivers the contents of the bytevector or string.
We don't know exactly how Spanky will process syntax-case
macros. Neither will you.