Imperative Notation

Antonio Eduardo Costa Pereira costa@ufu.br
Sat, 13 Feb 1999 11:06:13 -0200


Zuurbier, E. - AMSXE wrote:
> 
> If you manage to abstract away more than one environment/state, then the
> ultimate thing
> would be to abstract away *all* variables from a program. Actually, this was
> achieved
> in 1958 by Curry and Feys.
I thought  they were invented by Schonfinkel, when he published his
paper
Uber die Bausteine der Mathematischen Logik (1924). There, he names the
combinators
I (Identitastsfunktion) and K (Konstantzfunktion). Curry published his
paper
only 6 years latter.

> SK-combinators were never meant as a language for a human to write programs
> in,
> but as an intermediary language for implementation. But whoever hates
> explicit
> environment passing could dig SK-combinators up and see if they can be
> restyled to make them
> human readable and writeable after all.

Actually, there are people programming in combinators. The language
GRAAL
is quite popular and very fast (see Langage de programation sans
variable, Bernard Robinet, IBM-France). It was invented by a certain
Bellot, whose compilers produce code as fast as C (well, if you give
the optimizer as much time as Haskell requires to generate optimized
code, GRAAL can be faster than C :) Another "combinatory" programming
language is FP, but FP has only interpreters (as far as I know). 

Two small programs in GRAAL:

; Find the last element of a list
(DE LAST (IF  NULLoCDR  CAR  LASToCDR))

; Append two lists
(DE  APPEND
	(IF NULLoFST  SND  (CONS CARoFST
				(APPEND  CDRoFST SND)) ))

These two programs were not implemented in the original compiler,
written by Bellot. They were taken from the manual of a dialect
written by Cristina Bovo. Ms Bovo's language is slightly different
from Dr. Bellot.

The funny thing is that there are GRAAL programmers, who propose
syntactic sugar to add explicit environement passing. At least, this
was my interpretation of Dr Descles' book (where Robinet published
his paper).

Eduardo Costa