[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] chicken and stalin
From: |
John Cowan |
Subject: |
Re: [Chicken-users] chicken and stalin |
Date: |
Tue, 5 Jun 2007 13:45:10 -0400 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Dan Muresan scripsit:
> I think it's pretty well established that Stalin (and Gambit?) are
> faster than Chicken, but Chicken has a much better ecosystem (community,
> libraries etc).
No dispute about any of that.
> P.S. All this talk of Stalin has made me curious; is there a page
> documenting Stalin's limitations / standard adherence? If it's just the
> lack of syntax-rules support, that can be worked around with the help of
> Alexpander.
First, note that Stalin is an R4RS Scheme, so not only no syntax-rules,
but also no eval, dynamic-wind, or multiple values. It's not clear
to me whether () is true or false; R4RS allowed either behavior.
Here are the relevant parts of the README:
DEVIATIONS [from R4RS]
1. Unimplemented syntax:
4.2.6 Nested quasiquotation is not supported.
appendix Macros
2. Unimplemented procedures:
6.5.5 NUMERATOR
DENOMINATOR
RATIONALIZE
MAKE-RECTANGULAR
MAKE-POLAR
REAL-PART
IMAG-PART
MAGNITUDE
ANGLE
6.10.4 LOAD
TRANSCRIPT-ON
TRANSCRIPT-OFF
3. (1.1) Tail recursion optimization is done only on self calls.
[Apparently no longer true with a recent enough gcc.]
4. (6.5) The following numeric data types are not supported:
a. bignums: exact integers of arbitrary magnitude
Furthermore, exact integer arithmetic can overflow without signaling an
error and without yielding an inexact floating point number.
b. ratios: exact non-integer rationals
c. polar format complex numbers
d. exact rectangular format complex numbers
5. It is not possible to access all of the underlying C scalar types. (This
is not an incompatibility with R4RS but nonetheless important for other
reasons.)
a. No independent control over the float/double distinction.
b. No long/short chars/ints/floats/doubles
c. No unsigned chars/ints
6. (1.3.1) No R4RS compliance mode is provided.
7. Limitations of (6.5.6) STRING->NUMBER, (6.10.2) READ, and the source
program:
a. Can't parse largest negative number.
b. Can't parse polar numbers with @.
c. Can't parse rectangular numbers with i.
d. Can't parse ratios with /.
e. Can't parse numbers with embedded #.
f. Can't parse exactness with #E and #I.
g. Can't parse inexact numbers with mantissas where the digit string
before the decimal point would overflow if read as an exact number,
h. On Intel, SPARC, and SGI, the source program can't contain exact
integer constants <-536870912 or >536870911. On Intel and SPARC, the
compiler will generate incorrect C code without warning. On SGI, the
compiler might signal an exception or might generate incorrect C code
without warning. On Alpha, the source program can't contain exact
integer constants <-2305843009213693952 or >2305843009213693951. The
compiler will generate incorrect C code without warning.
8. (6.5.6) STRING->NUMBER doesn't accept the optional radix argument.
9. APPLY and CALL-WITH-CURRENT-CONTINUATION don't accept continuations or
foreign procedures as their first argument.
10. (6.2) EQV? might return #T when given two procedures that can never be
called.
(BEGIN (DEFINE (F X) (LAMBDA () X)) (EQV? (F 1) (F 2))) ==> #T
EQV? might return #T when given two fictitious pairs or degenerate vectors.
(EQV? (CONS #T #T) (CONS #T #T)) ==> #T
(EQV? (VECTOR #T) (VECTOR #T)) ==> #T
11. (6.5.5) =, <, >, <=, >= might not be transitive.
12. (6.5.6) STRING->NUMBER, READ, DISPLAY, and WRITE don't obey write/read
invariance for inexact numbers.
13. (APPLY (LAMBDA X X) y) ==> y without checking that y is a list and without
copying y. Furthermore, because of the way LIST is defined, (APPLY LIST X)
doesn't copy X.
14. (6.10.1) Closing a port that has already been closed yields undefined
behaviour rather than having no effect.
EXTENSIONS
Stalin extends R4RS in a number of ways:
1. New syntax: PRIMITIVE-PROCEDURE and FOREIGN-PROCEDURE.
2. New procedures: LIST-LENGTH, SUBLIST, SUB, LIST-APPEND, LIST-REVERSE, REF,
LIST-SET!, REF!, LIST-FILL!, FILL!, LIST-COPY, STRING->UNINTERNED-SYMBOL,
STRING-REVERSE, <<, >>, BITWISE-NOT, BITWISE-AND, BITWISE-OR,
MAKE-DISPLACED-VECTOR, SUBVECTOR, VECTOR-APPEND, VECTOR-REVERSE,
VECTOR-COPY, PANIC, POINTER?, INTEGER->STRING, INTEGER->INPUT-PORT,
INTEGER->OUTPUT-PORT, and INTEGER->POINTER.
3. New data type: pointer. ZERO? can be used to check for null pointers
(as well as null strings and null ports). INTEGER->POINTER can be used to
convert an integer address to a pointer. INTEGER->STRING,
INTEGER->INPUT-PORT, and INTEGER->OUTPUT-PORT can be used to convert an
integer address to a string, input port, or output-port, respectively.
4. New variable: ARGV is bound to a vector of strings containing the
command line arguments.
5. If the last expression executed by the program evaluates to an integer,
then its value is returned as the status code of the program. Otherwise,
the status code zero is returned.
6. Vectors are self evaluating.
7. DO iterator list can be empty.
8. Bodies can be empty.
9. The commands of DO and the expressions of COND, CASE, BEGIN, and DO are
considered bodies.
10. Bodies can have definitions intermixed with expressions.
11. Definitions are executed in order and can reference variables defined by
previous definitions.
12. Any body with just definitions treated like BEGIN.
13. Binding can be just a variable in LET, LET*, and LETREC.
14. DEFINE can take a single argument.
15. (EQV? "" "") ==> #T
(EQV? #() #()) ==> #T
16. The procedures LENGTH, APPEND, REVERSE, and COPY are generic.
17. EOF objects, input ports, and output ports are disjoint from each other
and all other data types.
18. All EOF objects are EQ?.
--
And through this revolting graveyard of the universe the muffled, maddening
beating of drums, and thin, monotonous whine of blasphemous flutes from
inconceivable, unlighted chambers beyond Time; the detestable pounding
and piping whereunto dance slowly, awkwardly, and absurdly the gigantic
tenebrous ultimate gods -- the blind, voiceless, mindless gargoyles whose soul
is Nyarlathotep. (Lovecraft) John Cowan|address@hidden|ccil.org/~cowan
- Re: [Chicken-users] chicken and stalin, (continued)
- Re: [Chicken-users] chicken and stalin, Andrew Bagdanov, 2007/06/05
- Re: [Chicken-users] chicken and stalin, Brandon Van Every, 2007/06/05
- Re: [Chicken-users] chicken and stalin, John Cowan, 2007/06/05
- Message not available
- [Chicken-users] chicken and stalin, Brandon Van Every, 2007/06/05
- Re: [Chicken-users] chicken and stalin, Dan Muresan, 2007/06/05
- Re: [Chicken-users] chicken and stalin, Andrew D. Bagdanov, 2007/06/05
- Re: [Chicken-users] chicken and stalin,
John Cowan <=
- Re: [Chicken-users] chicken and stalin, Brandon Van Every, 2007/06/05
- Re: [Chicken-users] chicken and stalin, Brandon Van Every, 2007/06/05
- Re: [Chicken-users] chicken and stalin, John Cowan, 2007/06/05
- Re: [Chicken-users] chicken and stalin, Brandon Van Every, 2007/06/05
- Re: [Chicken-users] chicken and stalin, felix winkelmann, 2007/06/06
- Re: [Chicken-users] chicken and stalin, felix winkelmann, 2007/06/05