guile-devel
[Top][All Lists]
Advanced

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

Re: JACAL, scm


From: Aubrey Jaffer
Subject: Re: JACAL, scm
Date: Fri, 21 Sep 2001 21:59:17 -0400 (EDT)

 | From: Mikael Djurfeldt <address@hidden>
 | Date: 21 Sep 2001 14:07:08 +0200
 | 
 | Aubrey Jaffer <address@hidden> writes:
 | 
 | > Guile 1.4 (ftp://rpmfind.net/linux/contrib/libc6/i386/guile-1.4-2.i386.rpm)
 | > *fails* the R4RS Scheme conformance test
 | > http://swissnet.ai.mit.edu/ftpdir/scm/r4rstest.scm.
 | >
 | > Successfully running this file should be a requirement before release.
 | > The SCM makefile runs it every time it creates an executable:
 | > 
 | > check:  r4rstest.scm
 | >         $(SCMEXE) -fr4rstest.scm \
 | >          -e'(test-sc4)(test-cont)(test-delay)(gc)(if (pair? errs) (quit 
1))'
 | 
 | Guile has a test suite which includes all of the *correct* tests for
 | r4rs compatibility, but which, in addition, contains lots of further
 | tests.

guile> (let ((f -)) (let f ((n (f 1))) n)) ==> 1

But Allegro Petrofsky, Radey, and I think it should return -1.

guile> (expt 0 0) ==> 0

But R5RS says:

 - procedure: expt z1 z2
     Returns Z1 raised to the power Z2.  For z_1 ~= 0

                          z_1^z_2 = e^z_2 log z_1

     0^z is 1 if z = 0 and 0 otherwise.

There are also floating point problems:

 SECTION(6 5 6)
 Number readback failure for (+ 0.0 (* -100 #.#))
 -#.#
 (float-print-test #f)  ==> #f
  BUT EXPECTED #t
 ERROR: In procedure integer-expt:
 ERROR: Argument out of range: -52

I have done numerical programming for many years and Scheme numerics are
far and away the most trouble-free I have used.  Are Guile numerics
intentionally different from Scheme?

 | We always run this test suite before release.

As a general principle, compliance tests from outside your group have
better coverage than ones from inside.  In any case, the more the
merrier!

http://nis-www.lanl.gov/~rosalia/mydocs/guile-user_1.html#IDX30 says:

 ... Guile will interpret almost all standard scheme programs.  The only
 differences between the basic Guile language and R4RS scheme are that:

    Guile treats the empty list '() and the false symbol #f identically:
    both are equal to the empy list.  In this Guile resembles classical
    lisp dialects more than Scheme does (1).  Most boolean code will not
    suffer from this.  Guile is case sensitive, whereas R4RS is case
    insensitive.  We hope that few people have written scheme programs
    that depend on case.

My interest in Guile is to run JACAL (via current SLIB).  I have made
accommodations for symbol case and '() in both SLIB and JACAL.  If Guile
is committed to R4RS deviations other than those, then I will abandon my
effort to support Guile.

 | You are correct that Guile fails when loading r4rstest.scm.  It fails
 | when trying to evaluate the expression '(begin)'...

I just noticed that Guile 1.4 is over one year old, so that test wasn't
in r4rstest.scm at the time.  But it is important for macros to be able
to expand to nothing; (begin) is useful that way.

 | > Computing the digits of pi with INUMs (30-bit integers), SCM is still
 | > twice the speed of Guile:
 | 
 | We have a Guile VM which evaluates code up to 20 times faster than the
 | current Guile evaluator.

That is impressive!  SCM is about 10 times slower than hand crufted C,
which would make Guile about 20 times slower.  Prior to this, the best
claimed speed for byte-coding I recall hearing was 1/5 of C.



reply via email to

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