HDTenEightyP/NetNews huggingface dataset:
From: brent@ssd.csd.harris.com (Brent Benson)
Newsgroups: comp.lang.scheme
Subject: Re: What's the story with ATOM??
Date: 15 Dec 92 15:09:26 GMT
Organization: Harris Computer Systems

matt@volga.Berkeley.EDU (Matt Wright) writes:

> ... The Book says it's just anything that's not a pair...  EdScheme
> thinks '() isn't an atom (contrary to The Book...)

This is not contradictory, the empty list is not pair.  The empty list
is both an atom and a list.

> What's the story on this?  Do people (e.g., implementors) have
> rationales for doing it a particular way?  To me, (lambda (x) (not
> (pair? x))) makes sense, but on the other hand, it's weird to me
> that a vector is an atom; I'd rather think of a pair as a vector of
> length two than of a vector as an atom.

> Do people think this should be in the standard (non-essential, I
> would think)?  Or should I just never use it?

In my opinion, the atom/pair distinction is useful when dealing with a
small subset of the Scheme data types (symbols, number and pairs), and
for pedagogical purposes, but not very useful for programming in the
large, primarily because of the presence of a greater variety of types
(characters, vectors, strings, etc.).

If you want to now if something is a symbol, use symbol?.  If you want
to now if something is a number or a symbol, use (or (symbol? obj)
(number? obj)).  If you want to now if something is not a pair, use
(not (pair? obj)).  Otherwise, you end up trying to force a square peg
into a round hole.

--
Brent Benson                     
Harris Computer Systems
From: bh@anarres.CS.Berkeley.EDU (Brian Harvey)
Newsgroups: comp.lang.scheme
Subject: Re: Are interpreters now as fast as compiled code used to be?
Date: 16 Dec 92 23:06:39 GMT
Organization: University of California, Berkeley
NNTP-Posting-Host: anarres.cs.berkeley.edu

thinman@netcom.com (Technically Sweet) writes:
>This is why Dylan should have continuations.  The only target
>Dylan platform that causes problems for continuations is the Mac
>without PMMU.

Implementation inefficiency isn't the only problem with continuations.  The
other problem is that nobody understands them.  I used to think that it was
only I who don't understand them, until I noticed how RNRS keeps having
corrections to R(N-1)RS because of some thought-to-be-well-understood feature
that breaks when continuations are used.
Newsgroups: comp.lang.scheme
Subject: Re: Something I don't understand about bindings
From: max@Kolmogorov.gac.edu (Max Hailperin)
Date: 16 Dec 92 14:34:12
Reply-To: Max Hailperin <max@nic.gac.edu>
Distribution: world
Organization: Gustavus Adolphus College, St. Peter, MN
In-reply-to: doner@Aero.org's message of 15 Dec 1992 21:23:15 GMTLines: 28

In article <1glic3INNq5b@news.aero.org> doner@Aero.org (John Doner) writes:

   ... On the other hand, his original define (again according to r4rs) is
   equivalent to

           (define timed-prime-test
                   (lambda (n)
                           (define start-time (runtime))
                           (define found-prime? (prime? n))
                           .
                           .
                           .
                                   ))

   So the sequence of expressions beginning with the inner defines is
   the body of a lambda expression.  And r4rs says the expressions in
   the body of a lambda expression are to be evaluated sequentially....

Ahhh..., but they *aren't* expressions.  Read R4RS carefully and you
will find that a definition is not an expression.  Thus the fact that
the body *expressions* are evaluated in order is irrelevant, and
indeed the SICP code quoted will not necessarily work in all
R4RS-compliant scheme implementations (though contrary to how some
might read the previous post, a scheme implementation in which the
code works is not thereby non-R4RS-compliant).  Note, btw, that the
code everyone has been talking about long predates R4RS, and that the
authors specifically admitted in the instructors manual that it was a
mistake.
From: gjc@mitech.com (George J. Carrette)
Newsgroups: comp.lang.scheme
Subject: Re: Are interpreters now as fast as compiled code used to be?
Date: 15 Dec 92 10:45:46 GMT
Organization: Mitech Corporation, Concord MA

In article <FEELEY.92Dec14215701@zohar.ai.mit.edu>, feeley@zurich.ai.mit.edu (Marc Feeley) writes:
> If you assume the
> hardware's performance increases by a factor of 3 every year (which is
> probably an underestimate right now), it shouldn't take more than 4 or
> 5 years for the switchover to happen.

Factor of 3 every year is a bit high. That means a factor
of 59049 over a decade.
From: gjc@mitech.com (George J. Carrette)
Newsgroups: comp.lang.scheme
Subject: Are interpreters now as fast as compiled code used to be?
Date: 14 Dec 92 12:14:23 GMT
Organization: Mitech Corporation, Concord MA

Informal survey, how fast is your Scheme interpreter?

The question is: With the latest wave of stock hardware,
                 have simple interpreters gotten as fast as
                 compilers were only a couple years ago?

   (define (standard-fib x)
     (if (< x 2)
         x
         (+ (standard-fib (- x 1))
            (standard-fib (- x 2)))))

(standard-fib 20) => 6765 ; in how many seconds?

In SIOD 2.9 (this is a s-exp interpreter using lists for environment rep)
we get a result in 0.42 seconds on the low-end VMS Alpha machine.
(1.3 seconds on Solbourne 5E/900)
 
-gjc
Newsgroups: comp.lang.scheme,comp.lang.lisp
From: ab2r@quads.uchicago.edu (Marshall Abrams)
Subject: Want history/command editing facilities in free Lisps
Summary: Just wanted to suggest that implementors add this feature
Reply-To: ab2r@midway.uchicago.edu
Organization: University of Chicago Computing Organizations
Date: Tue, 15 Dec 1992 03:40:53 GMT

In article <HANCHE.92Dec9104214@ptolemy.ams.sunysb.edu>
hanche@ams.sunysb.edu (Harald Hanche-Olsen) writes: 

>Simple scheme implementations like scm with just a simple line
>oriented interface are only fun to use on operating systems like unix
>where you can use good editors like emacs for a front end. 

I'm really thankful to all of the free Lisp and Scheme
implementors out there, but I want to put in a plug for adding a
command line editing/history mechanism to these programs.  If I
were a real C programmer, and had time, I suppose I'd do it
myself.  (Hmm--Maybe I'll try to do a portable one in Lisp some
time.  I suppose I know enough to do this.  Now, if I only had
more time...:-) Anyway, it would be a really nice feature
for those of us who use Lisps in operating systems like MSDOS.  I
can get by pretty well at this point just typing things in and
backspacing back to typos--I've been playing with Lisp long
enough that my mental parentheses-matcher is fairly accurate.
But being able to edit and go back to prior entries is handier.
This is especially true for people starting out with Lisp.  Not
having a history mechanism (or an editor interface such as Gnu
Emacs (or GW-BASIC, for that matter)) negates a lot of the
benefits to novices of using an interpreted language.  But anyone
who's not an expert probably wants to experiment by typing in
this or that at some point.  Probably gurus need to do this
sometimes, too, at least to make quick changes to variables.  And
it's just so much easier if you can recall and edit past lines.

(The history mechanism is one of my favorite things about the
one commercial product I've got, Star Sapphire Common Lisp.)

So how about it, implementors?  I know it's extra work, but if
you're doing enhancements anyway, I suggest that this ought to be
fairly high on your list.

(Xlisp-Plus 2.1 does allow you to use DOS command line
facilities.  So if you've got something set up in DOS to give you
history/editing, you get it for free in Xlisp-Plus.  It's nice.
(Thanks, Tom Almy.)  The drawback is that DOS gets to see the
keystrokes before Xlisp does, and then a Ctrl-C aborts Xlisp
rather than just your Lisp form.  It's also possible to use small
Lisps within the Epsilon editor, which I've done sometimes with
Xlisp, XScheme, and SCM (I think), but it's messy. The Lisp often
gets confused about what you've typed in.  You think you've
entered a final paren, but between Epsilon and Lisp, it never got
there.)


Anyway, thanks again to free Lisp implementors, whether your
Lisps have history mechanism or not.


Marshall Abrams
ab2r@midway.uchicago.edu

(BTW, I am aware of the +, ++, +++ abbreviations, but this isn't
From: gjc@mitech.com (George J. Carrette)
Newsgroups: comp.lang.scheme
Subject: Summary. Interpreters are faster than I thought
Date: 17 Dec 92 12:21:03 GMT
Organization: Mitech Corporation, Concord MA

A good deal of private email has come in on the speed of
interpreters issue. Most with benchmarks of interpreters
that are faster than SIOD. In fact I was most impressed by
some results with SCM that had (standard-fib 20) running a
good 3.8 times faster, and SCM is still an s-expression
interpreter although it has been extended with some tricks
that remind me a bit of the pdp-10 maclisp coded scheme
interpreter that was used at MIT around 1980 for the
last 6.031 classes ever, and I think the first 6.001 classes.

In summary. Some scheme interpreters are pretty close to being only 3
times slower than compiled code. Therefore interpreters are indeed
as fast or faster than compiled code on machines from a couple years
ago.

-----------------------------

FIB has always been a favorite benchmark of many people, probably
because it is easy to count operations but not entirely trivial.

However, it tends to bring up the issue of numeric optimizations,
which can be hairy and distracting.

So here is another version of fib that uses binary arithmetic
implemented as lists of symbols. It runs around 50 times slower
than using built-in arithmetic. 

;-*-mode:lisp-*-
; a fib benchmark that uses binary arithmetic.
; 16-DEC-92 George Carrette. GJC@MITECH.COM
; Wanted a benchmark that avoided built-in numbers
; and that did more work.
;
; Benchmark: (b->number (b-fib '(A A B A B))) => 6765
;
; Note: (b->number '(A A B A B)) => 20
;
; (C) Copyright 1992 George Carrette. As described in SLIB.C

(define (b-fib x)
  (if (b< x '(A B))
      x
      (b+ (b-fib (b- x '(B)))
          (b-fib (b- x '(A B))))))

(define (b->number x)
  (if (null? x)
      0
    (+ (if (eq? (car x) 'B) 1 0)
       (* 2 (b->number (cdr x))))))

(define (b+ x y)
  (if (null? x)
      y
    (if (null? y)
	x
      (if (eq? (car x) 'A)
	  (cons (car y) (b+ (cdr x) (cdr y)))
	(if (eq? (car y) 'A)
	    (cons 'B (b+ (cdr x) (cdr y)))
	  (cons 'A (b+ (b+ '(B) (cdr x)) (cdr y))))))))

(define (b- x y)
  (if (null? y)
      x
    (if (null? x)
	(error "negative number")
      (if (eq? (car y) 'A)
	  (bA-cons (car x) (b- (cdr x) (cdr y)))
	(if (eq? (car x) 'B)
	    (bA-cons (if (eq? (car y) 'B) 'A 'B) (b- (cdr x) (cdr y)))
	  (cons 'B (b- (b- (cdr x) '(B)) (cdr y))))))))

(define (bA-cons x l)
  (if (and (null? l) (eq? x 'A))
      '()
    (cons x l)))

(define (b< x y)
  (if (null? x)
      (not (null? y))
    (or (b< (cdr x) (cdr y))
	(if (equal? (cdr x) (cdr y))
	    (if (eq? (car x) 'A)
		(eq? (car y) 'B))))))








Newsgroups: comp.lang.scheme
From: thinman@netcom.com (Technically Sweet)
Subject: Re: Are interpreters now as fast as compiled code used to be?
Organization: International Foundation for Internal Freedom
Date: Tue, 15 Dec 1992 20:17:35 GMT

I would have thought that the primary issue was keeping the 
interpreter code area in cache?  And, of course, using memory
mapping to implement continuations.

-- 

Lance Norskog

Data is not information is not knowledge is not wisdom.
From: gjc@mitech.com (George J. Carrette)
Newsgroups: comp.lang.scheme
Subject: Re: Summary. Interpreters are faster than I thought
Date: 18 Dec 92 12:40:49 GMT
Organization: Mitech Corporation, Concord MA

In article <4094@mitech.com>, gjc@mitech.com (George J. Carrette) writes:
> So here is another version of fib that uses binary arithmetic
> implemented as lists of symbols. It runs around 50 times slower
> than using built-in arithmetic. 
> 

I posted a fairly bogus version of "b-", which not only was ugly, it
did not work on schemes that returned #unspecified instead of #f when
falling off the end of a "if" form that had 2 instead of 3 legs.

Here is JAR's much nicer version:

;From:	UUCP%"jar@cs.cornell.edu" 18-DEC-1992 02:32
;To:	gjc@mitech.com

;That's a really ugly b<, try this one.

(define (b< x y)
  (and (not (null? y))
       (or (null? x)
	   (b< (cdr x) (cdr y))
	   (and (equal? (cdr x) (cdr y))
		(eq? (car x) 'A)
		(eq? (car y) 'B)))))

(define (number->b n)
  (if (zero? n)
      '()
      (cons (if (odd? n) 'B 'A)
	    (number->b (quotient n 2)))))
From: schwartz@roke.cs.psu.edu (Scott Schwartz)
Newsgroups: comp.lang.scheme
Subject: Re: Are interpreters now as fast as compiled code used to be?
Date: 15 Dec 92 01:10:15 GMT

gjc@mitech.com (George J. Carrette) writes:
   In SIOD 2.9 (this is a s-exp interpreter using lists for environment rep)
   we get a result in 0.42 seconds on the low-end VMS Alpha machine.
   (1.3 seconds on Solbourne 5E/900)

With Bartlett's Scheme->C on a sparcstation 2,  I get:
	0.2 real         0.0 user         0.1 sys

Of course, nothing that runs for that short a time will be a sensible
yardstick.
From: doner@Aero.org (John Doner)
Newsgroups: comp.lang.scheme
Subject: rsa algorithm
Date: 15 Dec 1992 18:38:03 GMT
Organization: The Aerospace Corporation
Distribution: world
NNTP-Posting-Host: armadillo.aero.org

Anyone have some code to implement the rsa encryption algorithm?

Newsgroups: comp.lang.scheme,comp.lang.lisp
From: marcoxa@IMAGE.CS.NYU.EDU (Marco Antoniotti)
Subject: Re: Want history/command editing facilities in free Lisps
Organization: New York University
Date: Wed, 16 Dec 1992 08:32:21 GMT
From: feeley@zurich.ai.mit.edu (Marc Feeley)
Newsgroups: comp.lang.scheme
Subject: Re: Are interpreters now as fast as compiled code used to be?
Date: 14 Dec 92 21:57:01
Organization: M.I.T. Artificial Intelligence Lab.
NNTP-Posting-Host: zohar.ai.mit.edu
In-reply-to: gjc@mitech.com's message of 14 Dec 92 12:14:23 GMT

In article <4051@mitech.com> gjc@mitech.com (George J. Carrette) writes:
Path: ai-lab!snorkelwacker.mit.edu!stanford.edu!agate!spool.mu.edu!uunet!mitech!gjc
   From: gjc@mitech.com (George J. Carrette)
   Newsgroups: comp.lang.scheme
   Date: 14 Dec 92 12:14:23 GMT
   Organization: Mitech Corporation, Concord MA
   Lines: 19

   Informal survey, how fast is your Scheme interpreter?

   The question is: With the latest wave of stock hardware,
		    have simple interpreters gotten as fast as
		    compilers were only a couple years ago?

      (define (standard-fib x)
	(if (< x 2)
	    x
	    (+ (standard-fib (- x 1))
	       (standard-fib (- x 2)))))

   (standard-fib 20) => 6765 ; in how many seconds?

   In SIOD 2.9 (this is a s-exp interpreter using lists for environment rep)
   we get a result in 0.42 seconds on the low-end VMS Alpha machine.
   (1.3 seconds on Solbourne 5E/900)

   -gjc

Well here are the numbers for Gambit running on a lowly 68020 based SUN3
(which has been around for almost a decade):

3.100 secs for interpreted code
 .600 secs for compiled code with no declarations
 .040 secs for compiled code with fixnum declarations

There is almost a factor of 100 in performance between interpreted
code and compiled code with declarations.  If you assume the
hardware's performance increases by a factor of 3 every year (which is
probably an underestimate right now), it shouldn't take more than 4 or
5 years for the switchover to happen.

By the way, does SIOD implement the whole numeric tower?

Marc
Newsgroups: comp.lang.scheme
From: Joerg Beekmann <jbeekman@prodigy.bc.ca>
Subject: Re: Are interpreters now as fast as compiled code used to be?
Organization: Prodigy Technologies Corp.
X-Useragent: Nuntius v1.0
     <4067@mitech.com>
Date: Thu, 17 Dec 1992 19:00:44 GMT


Newsgroups: comp.lang.scheme
From: pmetzger@snark.shearson.com (Perry E. Metzger)
Subject: Re: Are interpreters now as fast as compiled code used to be?
Organization: /usr/local/lib/news/organization
Date: Wed, 16 Dec 1992 20:04:17 GMT

feeley@zurich.ai.mit.edu (Marc Feeley) writes:
>Well a factor of 3 for the last decade is clearly not valid but for
>the next 5 years it might be.  DEC's Alpha introduced this year (200 MIPS
>or so) is about 3 times faster than last year's HP9000/700 (70 MIPS).
>If next year DEC comes out with their BIPS processor (1000 MIPS) my
>factor of 3 seems about right.
>
>Clearly this increase in performance will level off at some point in
>the future.[...]

Well, SOMEDAY it will likely level off, but there are no signs that
this will happen before we start hitting fundamental barriers imposed
by physics. See Drexler's seminal book on nanotechnology "Engines of
Creation" for some idea of how far we still have to go and what will
soon be possible.

However, isn't this all getting pretty far from scheme?
--
Perry Metzger		pmetzger@shearson.com
--
"They can have my RSA key when they pry it from my cold dead fingers."
Newsgroups: comp.lang.scheme
From: oz@ursa.sis.yorku.ca (Ozan Yigit)
Subject: fibs [Re: Are interpreters now as fast...]
Organization: York U. Student Information Systems Project
Date: Tue, 15 Dec 1992 18:49:29 GMT

Scott Schwartz writes [in response to the usual simple fib]:

   Of course, nothing that runs for that short a time will be a sensible
   yardstick.

Here are the FIB routines I had been using in PSI tests. Just something
with more meat for those who are tired of the potatoe :-) version.

enjoy...	oz
---
C++ was invented because Vogon poetry | electric: oz@sis.yorku.ca
wasn't destructive enough. -anonymous | ph:[416] 736 2100 x 33976

--- cut here ---
;;; fib
;;; shamelessly snarfed from
;;; R. Kent Dybvig
;;; Three Implementation Models for Scheme
;;; Department of Computer Science Technical Report #87-011
;;; University of North Carolina at Chapel Hill
;;;  April 1987

;;; fib with peano arithmetic (using numbers)

(define addr
   (rec addr
      (lambda (x y)
         (if (zero? y)
             x
             (addr (1+ x) (1- y))))))

(define fibr
   (rec fibr
      (lambda (x)
         (if (zero? x)
             0
             (if (zero? (1- x))
                 1
                 (addr (fibr (1- x))
                       (fibr (1- (1- x)))))))))

;;; fib with peano arithmetic (using numbers) in CPS

(define addk
   (rec addk
      (lambda (x y k)
         (if (zero? y)
             (k x)
             (addk (1+ x) (1- y) k)))))

(define fibk
   (rec fibk
      (lambda (x k)
         (if (zero? x)
             (k 0)
             (if (zero? (1- x))
                 (k 1)
                 (fibk (1- x)
                       (lambda (a)
                          (fibk (1- (1- x))
                                (lambda (b)
                                   (addk a b k))))))))))

;;; fib with peano arithmetic (using numbers) with set!

(define add!
   (lambda (x y)
      ((rec add!
         (lambda ()
            (if (zero? y)
                x
                (begin (set! x (1+ x))
                       (set! y (1- y))
                       (add!))))))))

(define fib!
   (rec fib!
      (lambda (x)
         (if (zero? x)
             0
             (if (zero? (1- x))
                 1
                 (add! (fib! (1- x))
                       (fib! (1- (1- x)))))))))

;;; fib with peano arithmetic (using numbers) with call/cc

(define addc
   (rec addc
      (lambda (x y k)
         (if (zero? y)
             (k x)
             (addc (1+ x) (1- y) k)))))

(define fibc
   (rec fibc
      (lambda (x c)
         (if (zero? x)
             (c 0)
             (if (zero? (1- x))
                 (c 1)
                 (addc (call/cc (lambda (c) (fibc (1- x) c)))
                       (call/cc (lambda (c) (fibc (1- (1- x)) c)))
                       c))))))
From: doner@Aero.org (John Doner)
Newsgroups: comp.lang.scheme
Subject: Re: Something I don't understand about bindings
Date: 15 Dec 1992 17:03:04 GMT
Organization: The Aerospace Corporation
Distribution: world
NNTP-Posting-Host: armadillo.aero.org

In article <a2vogler.724431792@rzdspc23>, a2vogler@rzdspc23.informatik.uni-hamburg.de (Christian Vogler) writes:

|> The following fragment is supposed to measure how much time
|> execution of the procedure took (assuming that there is a
|> runtime primitive):
|> 
|> (define (timed-prime-test n)
|>   (define start-time (runtime))
|>   (define found-prime? (prime? n))
|>   (define elapsed-time (- (runtime) start-time))
|>   (print n)
|>   (cond (found-prime?
|>          (print " *** ")
|>          (print elapsed-time))))
|> 
|> The procedure then correctly prints the elapsed time for finding
|> a prime number, but why does this work? Why is the (runtime) in
|> the definition of start-time being evaluated at once, when the
|> procedure (timed-prime-test) is entered, while the
|> (runtime) in the definition of elapsed-time apparently is not evaluated
|> before it actually is printed?
|> 

You are probably interpreting the define's as defining functions, whereas they
are actually binding variables to new locations and assigning numeric values to
those locations.  The defines are evaluated sequentially, and all three of 
start-time, found-prime?, and elapsed-time have their values before the printing
begins.
From: jbs@Congruent.COM (Jeffrey Siegal)
Newsgroups: comp.lang.scheme
Subject: Re: How to keep track of procedures ?
Date: 11 Dec 92 17:28:57 GMT
Organization: Congruent Corporation; New York, NY
In-reply-to: st1pdw@fencer.cis.dsto.gov.au's message of 10 Dec 92 23:06:24 GMT

In article <1992Dec11.100624.1@fencer.cis.dsto.gov.au> st1pdw@fencer.cis.dsto.gov.au writes:

   As scheme procedures are accumulated over time it's hard to keep track
   of them all so that they are readily available when you want them.

I'd say you're missing the point a bit if you really want to keep
track of all the procedures.  Its like keeping track of all the
numbers or strings.

If you want to keep track of the top level procedures, that is an
development environment issue.  I haven't seen any Scheme environments
that do a particularly good job of this (I would define what the best
C environments do as reasonably good).

Jeffrey Siegal
From: carey@alta.tivoli.com (Carey Jung)
Newsgroups: comp.lang.scheme
Subject: PC-Scheme docs wanted
Date: 18 Dec 92 15:52:58 GMT
Organization: TIVOLI Systems


I've pulled a copy of PCS/Geneva off the net.  Very nice package, especially
with the BGI graphics support and the Edwin editor.  Very little documentation,
though.  (They refer you to some PC-Scheme manual by MIT Press, which I don't
want to buy if I can help it.)  Does anyone have a cheat sheet or quick
reference guide for PC-Scheme and , in particular, for Edwin, that they could
mail me?  I'd appreciate it very much.  Thanks.

-carey

-- 
  Carey Jung                 Tivoli Systems                 carey@tivoli.com
		     ...!uunet!cs.utexas.edu!tivoli!carey
  Carey Jung                 Tivoli Systems                 carey@tivoli.com
		     ...!uunet!cs.utexas.edu!tivoli!carey