Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #227: Fatal error right in front of screen


comp / comp.lang.lisp / Re: Church numerals in early lisp implementations?

SubjectAuthor
* Church numerals in early lisp implementations?Julieta Shem
+- Re: Church numerals in early lisp implementations?Daniel Cerqueira
+* Re: Church numerals in early lisp implementations?Alan Bawden
|`* Re: Church numerals in early lisp implementations?Julieta Shem
| `- Re: Church numerals in early lisp implementations?steve
`* Re: Church numerals in early lisp implementations?steve
 `* Re: Church numerals in early lisp implementations?Lawrence D'Oliveiro
  `- Re: Church numerals in early lisp implementations?Stefan Monnier

1
Subject: Church numerals in early lisp implementations?
From: Julieta Shem
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Sat, 11 May 2024 12:23 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jshem@yaxenu.org (Julieta Shem)
Newsgroups: comp.lang.lisp
Subject: Church numerals in early lisp implementations?
Date: Sat, 11 May 2024 09:23:34 -0300
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <875xvkmta1.fsf@yaxenu.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sat, 11 May 2024 14:23:38 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cab564bdf742567f9f52b833b9d228ea";
logging-data="2143180"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+IxGKH3IZazIZkt7o+Vfgk3kKqvo/7D4M="
Cancel-Lock: sha1:VEyBq03yse4dKC5SnDmp3B3tWAw=
sha1:qUJ05wpMPtbCjVAAqO8Yk+s0Cfs=
View all headers

McCarthy wrote this in ``History of Lisp''.

> Numbers were originally implemented in LISP I as lists of atoms, and
> this proved too slow for all but the simplest computations.

Was that Church numerals? Does anyone have examples of code from back
then? I'm picturing things such as

(defconstant zero nil)
(defconstant one (cons nil zero))

(defun zero? (x) (eq zero x))
(defun add1 (x) (cons nil x))
(defun sub1 (x) (cdr x))

(defun add (x y)
(cond ((zero? x) y)
(t (add (sub1 x) (add1 y)))))

CL-USER> (add one one)
(NIL NIL)

The paragraph continued:

> A reasonably efficient implementation of numbers as atoms in
> S-expressions was made in LISP 1.5, but in all the early LISPs,
> numerical computations were still 10 to 100 times slower than in
> FORTRAN. Efficient numerical computation requires some form of typing
> in the source language and a distinction between numbers treated by
> themselves and as elements of S-expressions. Some recent versions of
> LISP allow distinguishing types, but at the time, this seemed
> incompatible with other features.

Subject: Re: Church numerals in early lisp implementations?
From: Daniel Cerqueira
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Sat, 11 May 2024 13:44 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dan.list@lispclub.com (Daniel Cerqueira)
Newsgroups: comp.lang.lisp
Subject: Re: Church numerals in early lisp implementations?
Date: Sat, 11 May 2024 14:44:07 +0100
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <87v83ko448.fsf@lispclub.com>
References: <875xvkmta1.fsf@yaxenu.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sat, 11 May 2024 15:44:07 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="33e53c513558cf70507f045fbad9a7af";
logging-data="2172255"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/6izDmHWB7U15R7XQTq4RsStiTGRKpaYY="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:RpU13GAGrkMUkLT/hMJkW+Z/IG0=
sha1:bPw75vmtAKcIP65ESFTqwLxUJek=
View all headers

Julieta Shem <jshem@yaxenu.org> writes:

> McCarthy wrote this in ``History of Lisp''.
>
>> Numbers were originally implemented in LISP I as lists of atoms, and
>> this proved too slow for all but the simplest computations.
>
> Was that Church numerals? Does anyone have examples of code from back
> then? I'm picturing things such as
>
> (defconstant zero nil)
> (defconstant one (cons nil zero))
>
> (defun zero? (x) (eq zero x))
> (defun add1 (x) (cons nil x))
> (defun sub1 (x) (cdr x))
>
> (defun add (x y)
> (cond ((zero? x) y)
> (t (add (sub1 x) (add1 y)))))
>
> CL-USER> (add one one)
> (NIL NIL)
>
> The paragraph continued:
>
>> A reasonably efficient implementation of numbers as atoms in
>> S-expressions was made in LISP 1.5, but in all the early LISPs,
>> numerical computations were still 10 to 100 times slower than in
>> FORTRAN. Efficient numerical computation requires some form of typing
>> in the source language and a distinction between numbers treated by
>> themselves and as elements of S-expressions. Some recent versions of
>> LISP allow distinguishing types, but at the time, this seemed
>> incompatible with other features.

Wow! I am also interested in knowing this. I like this early LISP stuff
:-) .

Subject: Re: Church numerals in early lisp implementations?
From: Alan Bawden
Newsgroups: comp.lang.lisp
Organization: ITS Preservation Society
Date: Sun, 12 May 2024 01:43 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: alan@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: Church numerals in early lisp implementations?
Date: Sat, 11 May 2024 21:43:22 -0400
Organization: ITS Preservation Society
Lines: 18
Message-ID: <86frun24at.fsf@williamsburg.bawden.org>
References: <875xvkmta1.fsf@yaxenu.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 12 May 2024 03:43:25 +0200 (CEST)
Injection-Info: bawden.eternal-september.org; posting-host="6364db25a4f80be55d1cc6acb7a82f38";
logging-data="2490725"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JtE3Ug+Mux5q4FnnWvsBp"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:fnsoC2+ileSpEZtcOZlf469gJJo=
sha1:nlcBSaF3kfKv5i0pfEDbRTCxHJ0=
View all headers

Julieta Shem <jshem@yaxenu.org> writes:

McCarthy wrote this in ``History of Lisp''.

> Numbers were originally implemented in LISP I as lists of atoms, and
> this proved too slow for all but the simplest computations.

Was that Church numerals?

Certainly not.

The "atoms" is question were probably machine words containing the
digits of the number in some suitable base. I would guess base 2^36 or
2^35, depending on how they chose to represent negative numbers --
similar to the way GMP still works today. But I don't know for sure.
I've never seen this documented anywhere.

- Alan

Subject: Re: Church numerals in early lisp implementations?
From: Julieta Shem
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Sun, 12 May 2024 19:55 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jshem@yaxenu.org (Julieta Shem)
Newsgroups: comp.lang.lisp
Subject: Re: Church numerals in early lisp implementations?
Date: Sun, 12 May 2024 16:55:46 -0300
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <877cfykdod.fsf@yaxenu.org>
References: <875xvkmta1.fsf@yaxenu.org>
<86frun24at.fsf@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 12 May 2024 21:55:47 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8e50673e87fb0a0d3fd03bcc70b8d225";
logging-data="3116687"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QCJKiTjoxUof/DWIEJezD5iV6xXb+36A="
Cancel-Lock: sha1:imkWqTbuzZHyA3rWm6V890PW8Qg=
sha1:OSWiNsRUd8ep9ZEGAa0psr7vU/0=
View all headers

Alan Bawden <alan@csail.mit.edu> writes:

> Julieta Shem <jshem@yaxenu.org> writes:
>
> McCarthy wrote this in ``History of Lisp''.
>
> > Numbers were originally implemented in LISP I as lists of atoms, and
> > this proved too slow for all but the simplest computations.
>
> Was that Church numerals?
>
> Certainly not.
>
> The "atoms" is question were probably machine words containing the
> digits of the number in some suitable base. I would guess base 2^36 or
> 2^35, depending on how they chose to represent negative numbers --
> similar to the way GMP still works today. But I don't know for sure.
> I've never seen this documented anywhere.

Do you know if they have big numbers in those early implementations?
(Why would they use a list of things?) I'm now thinking that by ``list
of atoms'' (and with the light of from your post) they were supporting
big numbers. Their algorithms were perhaps naive, explaining ``the too
slow for all but the simplest computations''. Thanks!

Subject: Re: Church numerals in early lisp implementations?
From: steve
Newsgroups: comp.lang.lisp
Date: Thu, 16 May 2024 20:28 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-4.nntp.ord.giganews.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 16 May 2024 20:28:01 +0000
From: sgonedes1977@gmail.com (steve)
Newsgroups: comp.lang.lisp
Subject: Re: Church numerals in early lisp implementations?
References: <875xvkmta1.fsf@yaxenu.org>
Date: Thu, 16 May 2024 16:28:01 -0400
Message-ID: <87zfspy01a.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:SBhh4kQy3vtamU7Y2hlT/4MRk2U=
MIME-Version: 1.0
Content-Type: text/plain
Lines: 46
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-LsiKYamRFGcoW9tc3V9M7WzJDmIpMjTGNEg+eMS1TK/DlpUW/Q1MhX4siU6FtD2wTywON5z+Z9ri4CM!NcIlZzPKlRjC2ZqxsARvHlOWPNcLHprnYmxyvztfMJrX1A==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

Julieta Shem <jshem@yaxenu.org> writes:

> McCarthy wrote this in ``History of Lisp''.
>
< > Numbers were originally implemented in LISP I as lists of atoms, and
< > this proved too slow for all but the simplest computations.
>
> Was that Church numerals? Does anyone have examples of code from back
> then? I'm picturing things such as
>

I doubt it. check turning machine.

in original lambda-calc numbers where represented as applications of
lambda. check the wiki, it has mostly math since his science would not
fit well with these machines.

> (defconstant zero nil)
> (defconstant one (cons nil zero))
>
> (defun zero? (x) (eq zero x))
> (defun add1 (x) (cons nil x))
> (defun sub1 (x) (cdr x))
>
> (defun add (x y)
> (cond ((zero? x) y)
> (t (add (sub1 x) (add1 y)))))
>
> CL-USER> (add one one)
> (NIL NIL)
>
> The paragraph continued:
>
< > A reasonably efficient implementation of numbers as atoms in
< > S-expressions was made in LISP 1.5, but in all the early LISPs,
< > numerical computations were still 10 to 100 times slower than in
< > FORTRAN. Efficient numerical computation requires some form of typing
< > in the source language and a distinction between numbers treated by
< > themselves and as elements of S-expressions. Some recent versions of
< > LISP allow distinguishing types, but at the time, this seemed
< > incompatible with other features.

yes, church made the math and the original concepts I believe. Turning
machines were actually usefull if you could find your way into one.

Subject: Re: Church numerals in early lisp implementations?
From: Lawrence D'Oliv
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Thu, 16 May 2024 23:01 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Church numerals in early lisp implementations?
Date: Thu, 16 May 2024 23:01:47 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <v2638r$1q62t$3@dont-email.me>
References: <875xvkmta1.fsf@yaxenu.org> <87zfspy01a.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 17 May 2024 01:01:47 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="83e232b818d553f0fe0e404c9d6ad506";
logging-data="1906781"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WN40E1DLwCAN+dYLW8lVd"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:g6d9tcdmEVqdesgGl0KXzJw063A=
View all headers

On Thu, 16 May 2024 16:28:01 -0400, steve wrote:

> check turning machine.

Sounds like some kind of scam operation.

“The police raid of the check-turning operation arrested a dozen people
and seized half a dozen check-turning machines.”

“You are on trial for 350 counts of check-turning. How do you plead?”

Subject: Re: Church numerals in early lisp implementations?
From: steve
Newsgroups: comp.lang.lisp
Date: Sat, 18 May 2024 08:00 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!panix!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 18 May 2024 08:00:05 +0000
From: sgonedes1977@gmail.com (steve)
Newsgroups: comp.lang.lisp
Subject: Re: Church numerals in early lisp implementations?
References: <875xvkmta1.fsf@yaxenu.org>
<86frun24at.fsf@williamsburg.bawden.org> <877cfykdod.fsf@yaxenu.org>
Date: Sat, 18 May 2024 04:00:04 -0400
Message-ID: <87ed9zft2z.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:g7RL/7ikSKKuj1w0gwuabfiizdw=
MIME-Version: 1.0
Content-Type: text/plain
Lines: 83
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-PRX2Lyz5zKpvg5KdW1MaeVcdJYJtDDLqUOO+aEu55GSg6E2IMPx5h5pnQGU2F2qIWFmEu5Ak4C47QVm!1CfWKToBbzGYKefhXZjCuLbR4nYIiG1WCMMgTqlxqToxNw==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

Julieta Shem <jshem@yaxenu.org> writes:

> Alan Bawden <alan@csail.mit.edu> writes:
>
< > Julieta Shem <jshem@yaxenu.org> writes:
< >
< > McCarthy wrote this in ``History of Lisp''.
< >
< > > Numbers were originally implemented in LISP I as lists of atoms, and
< > > this proved too slow for all but the simplest computations.
< >
< > Was that Church numerals?
< >
< > Certainly not.
< >
< > The "atoms" is question were probably machine words containing the
< > digits of the number in some suitable base. I would guess base 2^36 or
< > 2^35, depending on how they chose to represent negative numbers --
< > similar to the way GMP still works today. But I don't know for sure.
< > I've never seen this documented anywhere.
>
> Do you know if they have big numbers in those early implementations?
> (Why would they use a list of things?) I'm now thinking that by ``list
> of atoms'' (and with the light of from your post) they were supporting
> big numbers.

it goes back to the CAR and CDR register.

> Their algorithms were perhaps naive, explaining ``the too
> slow for all but the simplest computations''. Thanks!

lisp was about the lambda and the closure. lexical scope possible. the
concept of numbers were not issues. https://en.wikipedia.org/wiki/S-expression

think of vixie tubes - how many numbers? infinite (with many tubes and a
cary flag )

vixie tubes are russian, soviet, Ukraine and therefor hard to get (very expensive; very
hard to trade for evil LEDs (photo dio). I have one for a heating mantel.
just set the timer function ..

(let ((x 5))
(funcall (lambda () (print x))))
(let ((y 3))
(funcall (lambda (x) (+ x y)) 3))

=> 6

(let ((y 'a))
(funcall (lambda (x) (list x y)) 3))

=> (3 a)

;; This is the best option but symbols and funcall took a lot of
;; hardware. notice the ``shadowing'' ; the set operator violates the
;; pure lambda . the pure lambda would be the programming language
;; called scheme. it is designed for specification not for efficiency.
;; I dunno it seems to be a french thing (RS5) (?)

;; apply was written by Guy Steele; (initially).

https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://en.wikipedia.org/wiki/Guy_L._Steele_Jr.&ved=2ahUKEwjhur3l25aGAxWthIkEHcPtACMQFnoECC8QAQ&usg=AOvVaw0oeV0gO0WRACOWzK2hZByX

(set 'number-1 (lambda ()
(lambda () 3)))

(funcall (funcall number-1))

=> 3

that would be 3 closures - or three LEDs.

;; in scheme

((lambda () ... ))

blah blah...

The (( means evaluate. scheme is not a bad language; but CL dives right
in.

Subject: Re: Church numerals in early lisp implementations?
From: Stefan Monnier
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Tue, 21 May 2024 16:30 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: monnier@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.lang.lisp
Subject: Re: Church numerals in early lisp implementations?
Date: Tue, 21 May 2024 12:30:37 -0400
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <jwvfrub9lge.fsf-monnier+comp.lang.lisp@gnu.org>
References: <875xvkmta1.fsf@yaxenu.org> <87zfspy01a.fsf@gmail.com>
<v2638r$1q62t$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 21 May 2024 18:30:43 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ff98a5a52c24689404a2aa94c510823c";
logging-data="728297"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18LtinVeCr9HMjfo57VRzYmCo7JCyiBN2E="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:HBLKzswM1cfC/62NKqvPX7mzEok=
sha1:4eUtsFmJd+i6rCw5tOdoBDJb6os=
View all headers

> “The police raid of the check-turning operation arrested a dozen people
> and seized half a dozen check-turning machines.”
>
> “You are on trial for 350 counts of check-turning. How do you plead?”

Thanks!

Stefan

1

rocksolid light 0.9.8
clearnet tor