Landin - The Next 700 Programming Languages (1966)

download Landin - The Next 700 Programming Languages (1966)

of 5

Transcript of Landin - The Next 700 Programming Languages (1966)

  • 8/21/2019 Landin - The Next 700 Programming Languages (1966)

    1/10

    The N e x t 7 0 0 Programming Languages

    P. J . Landin

    U n i v a c D i v is i o n o f Sp e r r y R an d C o r p . N e w Y o r k N e w Y o r k

    . . .

    t oday . . . 1,700 special programming languages used to 'com-

    municate ' in over 700 application areas. --Computer S o f t w a r e Issues,

    an American Mathematical Association Prospectus, July 1965.

    A fam i ly o f un implemented computing languages is de-

    sc r ibed that is in tended to span d i f f erences o f app l icat ion are a

    by a un i f ied f ram ew ork . Th is f ram ew ork d ic ta tes the rules

    ck out the uses of user-coined names, and the conventions

    ab out cha racte riz ing functional relationships. W ithin 'lhis f ra me -

    work ' lhe design o f a spec if ic langu age sp l its into two inde-

    pend ent par ts . On e is ' lhe cho ice o f w r i t ten app earan ces o f

    programs (or more genera l ly , the i r physica l representat ion ) .

    The o:her is the choice of the ab strac t ent it ies (such as numbers,

    charac ter-strings, l ists of them, funct ional relat ions amo ng

    them) that can be re ferred to in the language.

    The system is biase d tow ard s expressions rathe r than

    statements. I t inc ludes a nonproc edura l (p urely funct ional)

    subsystem fhat a ims to e xpa nd the c lass o f users ' needs that

    can be met by a single print - instruct ion, without sacri f ic ing the

    important p ropert ies that make convent ional r ight -hand -s ide

    expressions easy to construct and understand.

    1. I n t r o d u c t i o n

    Most programming languages are partly a way of

    expressing things in terms of other things and partly a

    basic set of given things. The Isw~M (If you See What I

    Mean) system is a byprodu ct of an attem pt to disentangle

    these two aspects in some current languages.

    This attempt has led the author to think that many

    linguistic idiosyneracies are concerned with the former

    rather than the latter, whereas aptitude for a particular

    class of tasks is essentially determined by the latter rather

    than the former. The conclusion follows that many

    language characteristics are irrelevant to the alleged

    problem orientation.

    IswI~ is an attempt at a general purpose system for

    describing things in terms of other things, that can be

    problem-oriented by appropriate choice of primitives .

    So it is not a language so much as a family of languages,

    of which each member is the result of choosing a set of

    primitives. The possibilities concerning this set and what

    is needed to specify such a set are discussed below.

    Isw~M is not alone in being a family, even after mere

    syntactic variations have been discounted (see Section 4).

    In practice, this is true of most languages that achieve

    more than one implementation, and if the dialects are well

    disciplined, they might with luck be characterized as

    Presented at an ACM Programming Languages and Pragmatics

    Conference, San Dimes, California, August 1965.

    1Throe is no more use or mentiol~ of X n this paper--eognoseenti

    will nevertheless sense an undercurrent. A not inappropriate title

    would have been Church without lambda,

    differences in the set of things provided by the library or

    operating system. Perhaps had ALGOL 60 been launched

    as a family instead of proclaimed as a language, it would

    have fielded some of the less relevant criticisms of its

    deficiencies.

    At first sight the facilities p rovide d in IswI~,~ will app ear

    comparatively meager. This appearance will be especially

    misleading to someone who has not appreciated how much

    of current manuals are devoted to the explanation of

    common (i.e., problem-orientation independent) logical

    structure rather than problem-oriented specialties. For

    example, in almost every language a user can coin names,

    obeying certain rules about the contexts in which the

    name is used and their relation to the textual segments

    that introduce, define, declare, or otherwise constrain its

    use. These rules vary considerably from one language to

    another, and frequently even within a single language

    there may be different conventions for different classes of

    names, with near-analogies that come irritatingly close to

    being exact. (Note that restrictions on what names can

    be coined also vary, but these are trivial differences. When

    they have any logical significance it is likely to be perni-

    cious, by leading to puns such as ALaOL'S integer labels.)

    So rules about user-coined names is an area in which

    we might expect to see the history of computer applica-

    tions give ground to their logic. Another such area is in

    specifying functional relations. In fact these two areas are

    closely related since any use of a user-coined name im-

    plicitly involves a functional relation; e.g., compare

    x ( x - k a ) f ( b + 2 c )

    w h e r e x = b -4- 2 c w h e r e

    f x ) = x x + a )

    ISW~M is thus part. pro gram ming lan guage and par t pro-

    gram for research. A possible first step in the research

    program is 1700 doctoral theses called A Correspondence

    betwe en x and Chu rch 's X-notation. ''~

    2 . T h e w h e r e - N o t a t i o n

    In ord inary mathem atica l communication, these uses

    of

    ' w h e r e '

    require no explanation. Nor do the following:

    f ( b - l - 2 c ) ---I- ( 2 b - - c )

    w h e r e f ( x ) = x ( x - t - a )

    f (b A -- 2 c) - - f ( 2 b - c )

    w h e r e f ( x ) = x ( x + a )

    a n d b =

    u / u + l )

    a n d c =

    v / v - t - 1 )

    g ( f

    w h e r e

    f ( x ) = a x 2 - ]- b x - I- c ,

    u / ( u - 4 - 1 ) ,

    v / ( v + l ) )

    w h e r e g ( f , p , q ) = f ( p - k 2 q , 2 p - - q )

    Volume 9 / Number 3 / March, 1966 C o m m u n i c a t i o n s o f t h e ACM 157

  • 8/21/2019 Landin - The Next 700 Programming Languages (1966)

    2/10

    A p h r a s e o f t h e f o r m ' w h e r e d e f i n i t i o n ' w i l l b e c a l l e d a

    w h e r e - c l a u s e . A n e x p r e ss i o n o f t h e f o r m 'e x p r e s s io n

    w h e r e - c l a u s e ' i s a w h e r e - e x p r e s s i o n . I t s t w o p r i n c ip a l

    c o m p o n e n t s a re c a ll e d, re s p e c t i v e ly , i t s m a i n c l a u s e

    a n d it s s u p p o r t i n g d e f i n i ti o n . T o p u t ' w h e r e ' in t o a

    p r o g r a m m i n g l a n g u a g e t h e f o l l o w in g q u e s ti o n s n e e d

    a n s w e r s .

    L i n g u i s t i c S t r u c t u r e .

    W h a t s t r u c t u r e s o f e x p r e s s io n

    c a n a p p r o p r i a t e l y b e q u a l i f ie d b y a w h e r e - c l a u s e , e .g . ,

    c o n d i t i o n a l e x p r e s s i o n s , o p e r a n d - l i s t i n g s , s t a t e m e n t s ,

    d e c l a r a t i o n s , w h e r e - e x p r e s s i o n s ?

    L i k e w i s e , w h a t s t r u c t u r e s o f e x p r e s s i o n c a n a p p r o -

    p r i a t e l y b e w r i t t e n a s t h e r i g h t - h a n d s i d e

    (rhs)

    of a

    s u p p o r t i n g d e f i n i t i o n ? W h a t

    contexts

    a r e a p p r o p r i a t e f o r a

    w h e r e - e x p r e s s i o n , e . g . , a s a n a r m o f a c o n d i t i o n a l e x -

    p r e s si o n , a n o p e r a t o r , t h e m a i n - c l a u s e o f a w h e r e - e x -

    p r e s s i o n , t h e l e f t - h a n d s i d e

    (lhs)

    o f a s u p p o r t i n g d e f i n i t io n ,

    t h e r h s o f a s u p p o r t i n g d e f i n i t i o n ?

    S y n t a x .

    H a v i n g a n s w e r e d t h e a b o v e q u e s t i o n s , w h a t

    a r e t h e r u l e s f o r w r i t i n g t h e a c c e p t a b l e c o n f i g u r a t i o n s

    u n a m b i g u o u s l y ? E . g . , w h e r e a r e b r a c k e t s o p t i o n a l o r

    o b l i g a t o r y ? o r o t h e r p u n c t u a t i o n ? o r l i n e b r e a k s ? o r i n -

    d e n t a t i o n ? N o t e t h e s e p a r a t i o n o f d e c is io n s a b o u t s t r u c -

    t u r e f r o m d e c i s i o n s a b o u t s y n t a x . ( T h i s i s n o t a d e n i a l

    t h a t l a n g u a g e d e s i g n e r s m i g h t i t e r a t e , l i k e h a r d w a r e

    d e s i g n e r s w h o d i s t i n g u i s h l e v e l s o f h a r d w a r e d e s i g n . )

    S e m a n t i c C o n s t r a i n ts o n L i n g u i s t i c S t r u c t u r e .

    I n t h e

    a b o v e e x a m p l e s e a c h m a i n c l a u s e w a s a n u m e r i c a l ex-

    p r e s s i o n ; i . e . , g i v e n a p p r o p r i a t e m e a n i n g s f o r t h e v a r i o u s

    i d e n ti f ie r s i n it , it d e n o t e d a n u m b e r . W h a t o t h e r k i n d s o f

    m e a n i n g a r e a p p r o p r i a t e f o r a m a i n c la u s e , e . g ., a r r a y s ,

    f u n c t i o n s , s t r u c t u r e d e s c r i p t i o n s , p r i n t - f o r m a t s ?

    L i k e w i se w h a t k i n d s o f m e a n i n g a r e a p p r o p r i a t e f o r

    rhs ' s

    o f s u p p o r t i n g d e f i n i t io n s ? N o t i c e t h e r e i s n o t a t h i r d

    q u e s t i o n a n a l o g o u s t o t h e t h i r d q u e s t i o n a b o v e u n d e r

    l ingu is t ic s t ruc ture .

    T h i s i s b e c a u s e a w h e r e - e x p r e s s i o n

    m u s t m e a n t h e s a m e k i n d o f t h i n g a s it s m a i n c l a us e a n d

    h e n c e r a is e s n o n e w q u e s t i o n c o n c e r n i n g w h a t c o n t e x t s

    a r e m e a n i n g f u l . N o t i c e a l s o t h a t t h e q u e s t i o n s a b o u t

    m e a n i n g a r e a l m o s t e n t i r e l y i n d e p e n d e n t o f th o s e a b o u t

    s t r u c t u r e . T h e y d e p e n d o n c l a s s i f y i n g e x p r e s s i o n s i n t w o

    w a y s t h a t r u n a c r o s s e a c h o t h e r .

    Outcome.

    W h a t i s t h e o u t c o m e o f t h e m o r e r e c o n d i t e

    s t r u c t u r a l c o n f i g u r a t i o n s a m o n g t h o s e d e e m e d a d m i s s i b l e ,

    e .g . m i x e d n e s t s o f w h e r e - e x p r e s s i o n s , f u n c t i o n d e f i n i ti o n s ,

    c o n d i t i o n a l e x p r e s s i o n s , e t c . ?

    E x p e r i m e n t a l p r o g r a m m i n g h a s l e d t h e a u t h o r t o t h i n k

    t h a t t h e r e i s n o c o n f i g u r a t io n , h o w e v e r u n p r o m i s i n g i t

    m i g h t s e e m w h e n j u d g e d c o l d , t h a t w i ll n o t t u r n u p q u i t e

    n a t u r a l l y . F u r t h e r m o r e , s o m e c o n fi g u r a t io n s o f ' w h e r e '

    t h a t m i g h t f i r st a p p e a r t o r e f l e c t s o m e w h a t p e d a n t i c d i s -

    t i n c t i o n s , i n f a c t p r o v i d e c l o s e m a t c h e s f o r c u r r e n t l a n -

    g u a g e f e a t u r e s s u c h a s n a m e / v a l u e a n d o w n (see [2, 3]) .

    A l l t h e s e q u e s t i o n s a r e n o t a n s w e r e d i n t h i s p a p e r . T h e

    t e c h n i q u e s f o r a n s w e r i n g t h e m a r e o u t l i n e d i n S e c t i o n 4 .

    O n e o t h e r i s s u e a r i s e s w h e n ' w h e r e ' i s a d d e d t o a

    p r o g r a m m i n g l a n g u a g e - - t y p e s a n d s p e c i f i c a t i o n s . A

    m e t h o d o f e x p r e s s i n g t h e s e f u n c t i o n a l l y i s e x p l a i n e d i n

    [2 ]. I t a m o u n t s t o u s in g n a m e d t r a n s f e r - fu n c t i o n s i n s t e a d

    o f c l a ss n a m e s l ik e i n t e g e r , i .e . , w r i t i n g

    w h e r e n = round(n)

    i n s t e a d o f t h e s p e c i f i c a t i o n

    i n t e g e r n

    T h u s t h e u s e o f f u n c t i o n a l n o t a t i o n d o e s n o t j e o p a r d i z e

    t h e d e t e r m i n a t i o n o f t y p e f r o m t e x t u a l e v i d e n c e .

    3 . P h y s i c a l I S W I M a n d : L o g ic a l I S W I M

    L i k e A L G O L 6 0 , I S W I M h a s n o p r e s c r i b e d p h y s i c a l

    a p p e a r a n c e . A L G OL C 0 'S d e s i g n e r s s o u g h t t o a v o i d c o m m i t -

    m e n t t o a n y p a r t i c u l a r s e t s o f c h a r a c t e r s o r t y p e f a ce s .

    A c c o r d i n g l y t h e y d i st i n g u is h b e t w e e n p u b l i c a t i o n h m -

    g u a g e , r e f e re n c e l a n g u a g e a n d h a r d w a r e l a n g u a g e s .

    O f th e s e t h e r e f e r e n c e l a n g u a g e w a s t h e s t a n d a r d a n d w a s

    u s e d i n t h e r e p o r t i ts e lf w h e n e v e r p i e ce s o f A L G O L 6 0

    o c c u r r e d . P u b l i c a t i o n a n d h a r d w a r e l a n g u a g e s a r e t r a n s -

    l i te r a t i o n s o f t h e r e f e r e n c e l a n g u a g e , v a r y i n g a c c o r d i n g t o

    t h e i n d i v i d u a l t a s t e , n e e d s a n d p h y s i c a l c o n s t r a i n t s o n

    a v a i l a b le t y p e f a c e s a n d c h a r a c t e rs .

    S u c h v a r i a t i o n s a r e d i f f e r e n t p h y s i c a l r e p r e s e n t a t i o n s

    o f a s in g l e a b s t r a c t i o n , w h o s e m o s t f a i t h f u l p h y s i c a l

    r e p r e s e n t a t i o n i s t h e r e f e r e n c e l a n g u a g e . I n d e s c r ib i n g

    I s w I ~ w e d i st i n g u is h a n a b s t r a c t l a n g u a g e c a ll e d l o g i c a l

    ISWIM, w h o s e t e x t s a r e m a d e u p o f t e x t u a l e l e m e n t s ,

    c h a r a c t e r i z e d w i t h o u t c o m m i t m e n t t o a p a r t i c u l a r p h y s i c a l

    r e p r e s e n t a t i o n . T h e r e i s a p h y s i c a l r e p r e s e n t a t i o n s u i t a b le

    f o r t h e m e d i u m o f t h i s r e p o r t , a n d u s e d f o r p r e s e n t in g

    e a c h p i e c e o f I s w I ~ 1 t h a t o c c u r s i n t h i s r e p o r t . S o t h i s

    p h y s i c a l r e p r e s e n t a t i o n c o r r e s p o n d s t o r e f e r e n c e A LG O L

    6 0 , a n d i s c a l l e d r e f e r e n c e I SW I M , o r t h e I s w I ~ i

    r e f e r e n c e r e p r e s e n t a t i o n , o r t h e I sw I ~ ,r r e f e r e n c e h m -

    g u a g e .

    T o a v o i d i m p r e c i s i o n o n e s h o u l d n e v e r s p e a k j u s t o f

    ISWIM, b u t a l w a y s o f l o g i c a l I s w x M o r o f s u c h -

    a n d - s u c h p h y s i c a l I SW l M . H o w e v e r , i n l o o s e s p e e c h ,

    w h e r e t h e p r e c i s e i n t e n t i o n i s c l e a r o r u n i m p o r t a n t , w e

    r e f e r t o I S W lM w i t h o u t q u M i fi e a ti o n . W e a i m a t a m o r e

    f o r m a l r e l a t i o n b e t w e e n p h y s i c a l a n d l o g i c a l l a n g u a g e s

    t h a n w a s t h e c a s e i n t h e A L G O L C 0. T h i s i s n e c e s s a r y s i n c e

    w e w i s h t o s y s t e m a t i z e a n d m e c h a n i z e t h e u s e o f d i f fe r e n t

    p h y s i c a l r e p r e s e n t a t io n s .

    4 . F o u r L e v e l s o f A b s t r a c t i o n

    T h e

    p h y s i c a l ~ l o g i c a l

    t e r m i n o l o g y i s o f t e n u s e d t o

    d i s t in g u i s h f e a t u r e s t h a t a r e a f o r t u i t o u s c o n s e q u e n c e o f

    p h y s i c a l c o n d i t i o n s f r o m f e a t u r e s t h a t a r e i n s o m e s e n s e

    m o r e e s s e n t i a l . T h i s i d e a i s c a r r i e d f u r t h e r b y m a k i n g a

    s i m i la r d i s t i n c t io n a m o n g th e m o r e e s s e n t i a l f e a t u r e s.

    I n f a c t I S W l M i s p r e s e n t e d h e r e a s a f o u r - l e v e l c o n c e p t

    c o m p r i s i n g t h e f o l l o w i n g :

    ( 1) p h y s i c a l I s w l M ' S, o f w h i c h o n e i s t h e r e f e r e n c e

    l a n g u a g e a n d o t h e r s a r e v a r i o u s p u b l i c a t i o n a n d h a r d w a r e

    l a n g u a g e s ( n o t d e s c r i b e d h e r e ).

    1 5 8 C o m m u n i c a t i o n s o f t h e A C M V o l t, m e 9 / N u m b e r 3 / M a r c h , 19 66

  • 8/21/2019 Landin - The Next 700 Programming Languages (1966)

    3/10

    ( 2 ) l o g i ca l I S W l M , w h i c h i s u n c o m m i t t e d a s t o c h a r -

    a c t e r s e ts a n d t y p e f a ce s , b u t c o m m i t t e d a s to t h e s e q u e n c e

    o f t e x t u a l e l em e n t s , a n d t h e g r a m m a t i c a l r u le s f o r g r o u p -

    i n g t h e m , e .g ., b y p a r e n t h e s e s , i n d e n t a t i o n a n d p r e c e d e n c e

    r e l a t i ons .

    ( 3 ) a b s t r a c t I s w l s ,, , w h i c h i s u n c o m m i t t e d a s to t h e

    g r a m m a t i c a l r u l e s o f s e q u e n c e a n d g r o u p i n g , b u t c o m -

    m i t t e d a s to t h e g r a m m a t i c a l c a t e g o ri e s a n d t h e i r n e s t i n g

    s t r u c t u r e . T h u s a b s t r a c t I sw is ,~ i s a t r e e l a n g u a g e o f

    whi ch l og i ca l I sw l M i s one l i nea r i za t i on .

    ( 4 ) a p p l i c a t i v e e x p r e s s i o n s ( A E s ) , w h i c h c o n s t i t u t e

    a n o t h e r t r e e l a n g u a g e , s t r u c t u r a l l y m o r e a u s t e r e t h a n

    a b s t r a c t I SW l M , a n d p r o v i d i n g c e r t a i n b a s i c g r a m m a t i c a l

    c a t e g o r i e s in t e r m s o f w h i c h a l l o f I s w 1 ~ ' s m o r e n u m e r o u s

    c a t e g o r i e s c a n b e e x p r e s s e d .

    T h e s e t o f a c c e p t a b l e t e x t s o f :t p h y s i c a l I SW l M i s

    s p e ci fi ed b y t h e r e l a ti o n s b e t w e e n 1 a n d 2 , a n d b e t w e e n

    2 a n d 3 . T h e o u t c o m e o f e a c h t e x t i s s p e c i fi e d b y t h e s e

    r e l a t io n s , t o g e t h e r w i t h a f r a m e o f r e f e r e n c e , i .e . , a r u l e

    t h a t a s s o c i a t e s a m e a n i n g w i t h e a c h o f a c h o s e n s e t o f

    i den t i f i e r s .

    T h e s e a r e th e t h i n g s t h a t v a r y f r o m o n e m e m b e r o f o u r

    l a n g u a g e f a m i l y to t h e n e x t . T h e s p e c if i ca t io n o f t h e f a m i l y

    i s c o m p l e t e d b y t h e r e l a t i o n b e t w e e n a b s t r a c t I s w I ~ a n d

    A E s , t o g e t h e r w i th a n a b s t r a c t m a c h i n e t h a t i n t e r p r e t

    A E s . T h e s e e l e m e n t s a re t h e s a m e f o r al l m e m b e r s o f t h e

    f a m i l y a n d a r e n o t d i s c u s s e d i n t h i s p a p e r ( s e e [ 1 , 2 , 4 ] ) .

    T h e r e l a t io n s h i p b e t w e e n p h y s i c a l I S W l M a n d l o g ic a l

    IS W IM i s f i x e d b y s a y i n g w h a t p h y s i c a l t e x t s r e p r e s e n t

    e a c h l o g ic a l e l e m e n t , a n d a ls o w h a t l a y o u t is p e r m i t t e d i n

    s t r i n g i n g t h e m t o g e t h e r . T h e r e l a t i o n s h i p b e t w e e n l o g i c a l

    I s w ~ a n d a b s t r a c t I sw l M is f ix e d b y a fo r m a l g r a m m a r

    n o t u n l i k e t h e o n e i n t h e A L G O L 6 0 r e p o r t , t o g e t h e r w i t h a

    s t a t e m e n t c o n n e c t i n g t h e p h r a s e c a t e g o ri e s w i t h t h e

    a b s t r a c t g r a m m a t i c a l c a t e g o r i e s .

    T h e s e t w o r e l a t i o n s c o v e r w h a t i s u s u a l l y c a l le d t h e

    s y n t a x o r g r a m m a r o f a l an g u a g e. I n t h is p a p e r

    s y n t a x i s n o t d i s c u s s ed b e y o n d a f e w g e n e r a l r e m a r k s a n d

    a f e w e x a m p l e s w h o s e m e a n i n g s h o u l d b e o b v i o u s .

    T h e r e l a ti o n s h i p b e t w e e n a b s t r a c t I s w l s ( a n d A E s i s

    f ix e d b y g i v i n g t h e f o r m o f A E e q u i v a l e n t t o e a c h a b s t r a c t

    I s w iM g r a m m a t i c a l c a t e g o r y . I t h a p p e n s t h a t t h e s e l a t t e r

    i n c l u d e a s u b s e t t h a t e x a c t l y m a t c h e s A E s . H e n c e t h i s

    l i n k i n o u r c h a i n o f re h ~ ti o n s i s r o u g h l y a m a p p i n g o f

    I SW I M i n t o a n e s s e n t i a l k e r n e l o f I s w IM , o f w h i c h al l t h e

    r e s t i s m e r e d e c o r a t i o n .

    5 . A b s t r a c t I S W I M

    T h e t e x t s o f a b s t r a c t I SW l M a r e c o m p o s i t e i n f o r m a t i o n

    s t r u c t u r e s c a l l e d

    amessage's.

    T h e f o l l o w i n g s t r u c t u r e

    d e f i n i t i o n d e f i n e s~ t he c l a s s a messa ge i n t e r m s o f a cl a ss

    ca l l ed

    identifier.

    I t a l s o d e f i n e s s e v e r a l f u n c t i o n s f o r

    m a n i p u l a t i n g a messa ge ' s . T h e s e c o m p r i s e t h e p r e d i c a t e s

    2 Writin g a struc tur e definition i~volves coining nam es for the

    var ious a l ternat ive formats of a m e s s a g e ' s and thei r components .

    The only obscure coinage is beet , which abbrevia t es beta-

    redex, i .e . , an express ion amenable to rule ( f l ) ; see Section 7'.

    demand, simple, infixed,

    e t c ; a l s o t h e s e l e c t o r s

    body, ra to

    leflarm, nee,

    e t c ; a ls o ( t a k i n g f o r g r a n t e d c e r t a i n u n

    f o r m a l i z e d c o n v e n t i o n s c o n c e r n i n g s t r u c t u r e d e f i n i t i o n

    t h e c o n s t r u c t o r s ,

    consdemand, conscombination

    ( e l s e w h e

    ~ b b r e v i a t e d t o combine), consstandardade], e t c . E x a m p l e

    o f r e f e r e n c e I s w I ~ a r e g i v e n a l o n g s id e , a g a i n s t t h e r i g h

    m a r g i n .

    An amessage is

    either a

    d e m a n d ,

    and has [P r in t

    a + 2

    a b o dy which is an aexprcss ion,

    or else a definition, [Def

    x = a + 2

    w h e r e r e c

    an aexpression (aexp) is

    e i ther

    s i m p l e ,

    and has

    [ C A t h 2 3

    a b o dy which is an identifier

    o r a c o m b i n a t i o n ,

    in which case it has

    [ s i n ( a + 2

    a rator , which is an aexp, or

    and a

    r a nd ,

    whic h is an aexp, a +

    or c o n d i t i o n a l , in which case it is

    e i ther

    two-armed,

    and has

    [ p - -* a + 2 b ; 2 a -

    a c o n d i t i o n , which is an aexp,

    and a

    t e f t a r m ,

    which is an aexp,

    and a r i g h t a r m , which is an aexp,

    or one-armed, and has [ q -+ 2 a -

    a c o n d i t i o n ,

    which is an aexp,

    and an a r m , which is an aexp,

    or a

    l i s t i n g ,

    and has

    [ a+ b , c + d , e +

    a b o dy which is an aexp-list ,

    or bee t , and has [x( x+l ) wh ere x = a +

    a m a i n c l a u s e ,

    which is an aexp, or

    and a s u p p o r t let x = a + 2b; x( x+ l

    which is an adef,

    a n d

    an adefinition (adef) is

    e i ther s tandard, and has [ x = a + 2

    a de f inee (nee ) ,

    which is an abe,

    and a de f i n i e ns (n i e ns ) , which is an aexp,

    or

    f u n c t i o n f o r m ,

    ar id has [ f (x) =z(x +l

    a le f thandside ( lhs ) ,

    which is an abe- l i s t of length >2,

    and a r ighthandside (rhs) , which is an aexp

    or

    p r o g r a m p o i n t ,

    and has [pp f (x ) = x(x+ l

    a b o dy which is an adef,

    or c i r c u l a r , and has [ t ee f (n )= (n= 0) -+ l ; n f ( n - 1

    a b o dy which is an adef,

    or

    s i m u l t a n e o u s ,

    and has

    [ x = a + 2 b

    a n d

    y = 2 a - -

    a b o dy , which is an adef-list ,

    or bee t , and has [ f (y) =z( x+y

    a m a i n c l a u s e , w h e r e x = a + 2

    which is an adef,

    and a

    s u p p o r t ,

    which is an adef.

    w here an abe i s

    e i ther s i m p l e , and has

    body, which is an identifier,

    or else, is an abv-lislo.

    [x , (y , z ) ,

    A p r o g r a m - p o i n t d e f i n it i o n i n t r o d u c e s a d e v i a n t k i n

    o f f u n c t io n . A p p l y i n g s u c h a f u n c t i o n p r e c i p i t a te s p r

    m a t u r e t e r m i n a t io n o f t h e w h e r e - e x p r e s s i o n c o n t a i n i n

    i t , a n d c a u s e s i ts r e s u l t t o b e d e l i v e r e d a s t h e v a l u e o f t h

    e n t i r e w h e r e - e x p r e s s i o n .

    P r o g r a m - p o i n t s a r e I s w l i ' S , n e a r e s t t h i n g to ju m p i n g

    A s s i g n m e n t i s c o v e r e d a s a p a r t i c u l a r c a s e o f a n o p e r a t o

    F o r b o t h o f th e s e t h e p r e c i s e s p e c i f ic a t i o n is in t e r m s o f t h

    u n d e r l y i n g a b s t r a c t m a c h i n e ( s e e [ 2 ] ) .

    V olum e 9 / N um ber 3 / M arch , 1966 C om m unic a t i ons o f t he A C M

    15

  • 8/21/2019 Landin - The Next 700 Programming Languages (1966)

    4/10

    6 . R e l a t i o n s h i p t o L I S P

    I s w I ~ r c a n b e l o o k e d o n a s a n a t t e m p t t o d e l i v e r L i s P

    f r o n I i t s e p o n y m o u s c o m m i t m e n t t o l i s t s , i t s r e p u t a t i o n

    f o r h a n d - t o - m o u t h s t o r a g e a ll o c a ti o n , t h e h a r d w a r e

    d e p e n d e n t f l a v o r o f it s p e d a g o g y , i t s h e a v y b r a c k e t i n g ,

    a n d i t s c o m p r o m i s e s w i t h t r a d i t i o n . T h e s e f i v e p o i n t s a r e

    n o w d e a l t w i t h i n t u r n :

    ( 1) I s w i ~ h a s n o p a r t i c u l a r p r o b l e m o r i e n t a t io n .

    E x p e r i m e n t s s o f a r h a v e b e e n m a i n l y i n n u m e r i c a l w o r k

    a n d l a n g u a g e p r o c e s s in g w i t h b r i e f e x c u r s io n s i n t o c o m -

    m e r c i a l p r o g r a m m i n g a n d e l s ew h e r e . N o b ia s t o w a r d s o r

    a w a y f r o m a p a r t i c u l a r f ie ld o f a p p l i c a t i o n h a s e m e r g e d .

    ( 2 ) O u t s i d e a c e r t a i n s u b s e t ( c o r r e s p o n d i n g c l o s e l y t o

    A LG O L ~ 0 w i t h o u t d y n a m i c o w n a r r a y s ) , I s w IM n e e d s

    g a r b a g e c o l l e c t i o n . A n e x p e r i m e n t a l p r o t o t y p e i m p l e -

    m e n t a t i o n f o l lo w e d c o m m o n A L GO L 6 0 p r a c t ic e . I t u s e d

    d y n a m i c s t o r a g e a l lo c a t i o n w i t h t w o s o u rc e s , o n e L I F O

    a n d t h e o t h e r g a r b a g e c o l l e c t e d , w i t h t h e i n t e n t i o n t h a t

    t h e L I F O s o u r c e s h o u l d t a k e a s b i g a s h a r e a s p o s s i b l e .

    H o w e v e r , a s w i t h A L G O L 6 0 , t h e r e i s a l a t e n t p o t e n t i a l

    f o r p r e a ll o e a t i n g s t o r a g e i n c e r t a i n f a v o r a b l e a n d c o m -

    m o n l y u s e f u l si t u a ti o n s . C o m p a r e d w i t h L I S P t h e c h i e f

    a m e l i o r a t i o n o f s t o r a g e a l l o c a t i o n c o m e s o u t o f a m e r e

    s y n t a c t i c d i ff e re n c e , n a m e l y , t h e u s e o f

    w h e r e ( o l ' l e t '

    w h i c h i s e x a c t l y e q u a l i n p o w e r a n d p r o g r a m s t r u c t u r e ) .

    T h i s p r o v i d e s a b l o c k - s t r u c t u r e n o t d i s s i m i l a r i n t e x t u a l

    a p p e a r a n c e f r o m A L G O L 6 0 'S , t h o u g h i t s l ip s o f f t h e p e n

    m o r e e a s i l y , a n d i s i n m a n y r e s p e c t s m o r e g e n e r M .

    ( 3 ) L i s P h a s s o m e d a r k c o r n e r s , e s p e c i a l l y o u t s i d e

    p u r e L IS P , i n w h i c h b o t h t e a c h e r s a n d p r o g r a m m e r s

    r e s o r t t o t a l k i n g a b o u t a d d r e s s e s a n d t o d r a w i n g s t o r a g e

    d i a g r a m s . T h e a b s t r a c t m a c h i n e u n d e r l y i n g I s w I ~ , r i s

    a i m e d a t i l l u m i n a t i n g t h e s e c o r n e rs w i t h a m i n i n m m o f

    h a r d w a r e d e p e n d e n ce .

    ( 4 ) T h e t e x t u a l a p p e a r a n c e o f I s w I ~ l i s n o t l ik e L i s p ' s

    S - e x p r e s s i o n s . I t i s n e a r e r t o L I SP 'S M - e x p r e s s i o n s ( w h i c h

    c o n s t i t u t e a n i n f o r m a l l a n g u a g e u s e d a s a n i n t e r m e d i a t e

    r e s u l t i n h a n d - p r e p a r i n g L I SP p r o g r a m s ) . I s w lA i h a s t h e

    f o l l o w i n g a d d i t i o n a l f e a t u r e s :

    ( a ) A u x i l i a r y d e f i n i t io n s , i n d i c a t e d b y ' l e t ' o r ' w h e r e ' ,

    w i t h t w o d e c o r a t i o n s : ' a n d ' f o r s i m u l t a n e o u s d e f i n i ti o n s ,

    a n d

    ' rec '

    f o r s e lf - r e f e r e n t i a l d e f i n i t i o n s ( n o t t o b e m i s t a k e n

    f o r a w a r n i n g a b o u t r e c u r s i v e ac t iva t ion, w h i c h c a n o f

    c o u r s e a ls o a r i se f r o m s e l f - a p p l i c a t i o n , a n d w i t h o u t s e l f -

    r e f e r e n c e ) .

    ( b ) I n f i x e d o p e r a t o r s , i n c o r p o r a t e d s y s t e m a t i c a l l y . A

    l o g i c a l IS W I M c a n b e d e f i n e d i n t e r m s o f f o u r u n s p e c i f i e d

    p a r a m e t e r s : t h r e e s u b s e t s o f th e c l a ss o f

    ident i f ie rs ,

    f o r u s e

    a s p r e f i x e d , i n fi x e d a n d p o s t f i x e d o p e r a t o r s ; a n d a p r e c -

    e d e n c e r e l a t i o n d e f i n e d o v e r t h e u n i o n o f t h e s e s u b se t s .

    ( c) I n d e n t a t i o n , u s e d t o i n d i c a t e p r o g r a m s t r u c t u r e . A

    p h y s i c a l I s w iM c a n b e d e f i n e d i n t e r m s o f a n u n s p e c i fi e d

    p a r a m e t e r : a s u b s e t o f p h r a s e c a t e g o r ie s , in s t a n c e s o f

    w h i c h a r e r e s t r i c t e d i n l a y o u t b y t h e f o l l o w i n g r u l e c a l le d

    t h e o f fs i de r u l e . T h e s o u t h e a s t q u a d r a n t t h a t j u s t c o n -

    t a i n s t h e p h r a s e ' s f i r s t s y m b o l n m s t c o n t a i n t h e e n t i r e

    p h r a s e , e x c e p t p o s s i b ly f o r b r a c k e t e d s u b s e g m e n t s . T h i s

    r u l e h a s t h r e e i m p o r t a n t f e a t u r e s . I t i s b a s e d o n v e r t i c a l

    a l i g n m e n t , n o t c h a r a c t e r w i d t h , a n d h e n c e is e q u a l ly

    a p p r o p r i a t e in h a n d w r i t t e n , t y p e s e t o r t y p e d t e x t s. I t s

    u s e is n o t o b l i g a t o r y , a n d u s e o f it c a n b e m i x e d f r e e l y w i t h

    m o r e c o n v e n t i o n M a l t e r n a t i v e s l i k e p u n c t u a t i o n . A l so , i t

    i s i n c o r p o r a t e d i n I s w I ~ t i n a s y s t e m a t i c w a y t h a t a d m i t s

    o f a l t e r n a t i v e s w i t h o u t c h a n g i n g o t h e r f e a t u r e s o f I s w ~ . r

    a n d t h a t c a n b e a p p l i e d t o o t h e r l a n g u a g e s .

    ( 5 ) T h e m o s t i m p o r t a n t c o n t r i b u t i o n o f L i s P w a s n o t

    i n l i s t p r o c e s s i n g o r s t o r a g e a l l o c a t i o n o r i n n o t a t i o n , b u t

    i n th e l o gic ~d p r o p e r t i e s l y i n g b e h i n d t h e n o t a t i o n , t t e r e

    I s w i ? i m a k e s l i t t l e i m p r o v e m e n t b e c a u s e , e x c e p t f o r a f e w

    m i n o r d e t a i ls , L i s p l e f t n o n e t o m a k e . T h e r e a r e t w o

    e q u i v a l e n t w a y s o f s t a t i n g t h e s e p r o p e r t i e s .

    ( a ) L I s P s i m p l i f ie d t h e e q u i v a l e n c e r e l a t i o n s t h a t

    d e t e r m i n e t h e e x t e n t t o w h i c h p ie c e s o f p r o g r a m c a n b e

    i n t e r c h a n g e d w i t h o u t a f f e c t in g t h e o u t c o m e .

    (b)

    L IS P b r o u g h t t h e c la s s o f e n t i ti e s t h a t a r e d e n o t e d

    b y e x p r e s s i o n s a p r o g r a m m e r c a n w r i t e n e a r e r t o t h o s e

    t h a t a r is e i n m o d e l s o f p h y s i c a l s y s t e m s a n d i n m a t h e -

    m a t i e M a n d l o g i c a l s y s t e m s .

    T h e s e r e m a r k s a r e e x p a n d e d i n S e c t i o n s 7 a n d 8 .

    7 . T h e C h a r a c t e r i s t ic E q u i v a l e n c e s o f I S W I M

    F o r m o s t p r o g r a m m i n g l a n g u a g e s t h e r e a r e c e r t a i n

    s t a t e m e n t s o f t h e k i n d , T h e r e is a s y s t e m a t i c e q u i v a l e n c e

    b e t w e e n p i e c e s o f p r o g r a m l ik e t h is , a n d p i e ce s li k e t h a t ,

    t h a t

    ne a r l y

    h o l d b u t n o t q u i t e. F o r i n s t a n c e i n A L G OL 6 0

    t h e r e i s a ne a r l y t r u e s u c h s t a t e m e n t c o n c e rn i n g p r o c e d u r e

    c a l ls a n d b l o c k s .

    A t f i r s t s i g h t i t m i g h t a p p e a r p e d a n t i c t o q u i b b l e a b o u t

    s u c h u n t i d i n e s s - - W h a t ' s t h e p o i n t o f h a v i n g t w o d i f fe r e n t

    w a y s o f d o i n g t h e s a m e t h i n g a n y w a y ? I s n ' t i t b e t t e r t o

    h a v e t w o fa c il it ie s t h a n j u s t o n e ? T h e a u t h o r b e l ie v e s

    t h a t e x p r e s s i v e p o w e r s h o u l d b e b y d e s i g n r a t h e r t h a n

    a c c i d e n t , a n d t h a t t h e r e i s g r e a t p o i n t i n e q u i v a l e n c e s t h a t

    h o l d w i t h o u t e x c e p t i o n . I t i s a p l a t i t u d e t h a t a n y g i v e n

    o u t c o m e c a n b e a c h i e v e d b y a w i d e v a r i e t y o f p r o g r a m s .

    T h e p r a c t i c a b i l i t y o f a l l k i n d s o f p r o g r a m - p r o c e s s i n g

    ( o p t i m i z i n g , c h e c k i n g s a t i s f a c t i o n o f g i v e n c o n d i t i o n s ,

    c o n s t r u c t i n g a p r o g r a m s a t is f y i n g g i v e n c o n d i t io n s )

    d e p e n d s o n t h e r e b e i n g e l e g a n t e q u i v a l e n c e r u l es . F o r

    I s w l M t h e r e a r e f o u r g r o u p s 3, c o n c e r n i n g :

    ( 1) t h e e x t e n t t o w h i c h a s u b e x p r e s s i o n c a n b e r e p l a c e d

    b y a n e q u i v a l e n t s u b e x p r e ss i o n w i t h o u t d i s t u r b i n g t h e

    e q u i v a l e n c e c la s s o f th e w h o l e e x p r e s si o n . W i t h o u t t h i s

    g r o u p t h e o t h e r r u l e s w o u l d b e a p p l i c a b l e o n l y t o c o m p l e t e

    e x p r e s s i o n s , n o t t o s u b e x p r e s s i o n s .

    ( 2 ) u s e r - c o i n e d n a m e s , i .e . , i n d e f i n i t io n s a n d , i n p a r t i c u -

    l a r , f u n c t i o n d e f i n i t i o n s .

    ( 3 ) b u i l t - i n e n t i t i e s i m p l i c i t i n s p e c i a l f o r m s o f e x -

    p r e s s i o n . T h e o n l y i i i s t a n e e s o f t h i s i n I sw llv [ a r e c o n d i t i o n a l

    e x p r e s s i o n s , l i s ti n g s a n d s e l f - r e f e r e n t i a l d e f i n i t io n s .

    ( 4) n a m e d e n t i ti e s a d d e d i n a n y s p e ci fi c p r o b l e m -

    o r i e n t a t i o n o f I s w I M .

    3 To faci l i t a te subsequ ent di scussion each rule i s preceded

    by a name, e.g., (~t) , ( , ) , e tc . These are chosen to conform

    with precedents in Curry 's Combinatory Logic.

    1 6 0 C o m m u n i c a t i o n s o f t h e A C M V o l u m e 9 / N u m b e r 3 / M a r c h , 1 96 6

  • 8/21/2019 Landin - The Next 700 Programming Languages (1966)

    5/10

    G R O U P 1

    ( tz ) I f L - = L ' t h e n L ( M ) - = L ' ( M )

    @ ) I f M ~ M ' t h e n L ( M ) ~ L ( M ' )

    @ ' ) I f M ~ M ' t h e n

    ( L , . . . , M , . . - , N ) ~ ( L , . . . , M ' , . . . N )

    ( v ) I f L ~ L ' t h e n ( L - - ~ M ; N ) ~ ( L '- - + M , N )

    ( v ' ) I f M ~ M ' t h e n

    ( L -- a M ; N ) ~ ( L - a M ' ; N )

    ( vi ~) I f N - ~ N ' t h e n ( L - - ~ M ; N ) ~ ( L -- ~ M ; N ' )

    ( v ~ ) I f M -= M ~ t h e n ( L w h e r e x = M )

    ~- ( L w h e r e x = M t)

    T h e s i g n i f i c a n t o m i s s i o n s h e r e a r e t h e m a i n - c l a u s e i n t h e

    l a s t c a s e a b o v e , t h e

    r h s

    o f a f u n c t i o n d e f i n i t i o n

    f ( x ) = M

    a n d o f a c i r c u l a r d e f i n i t i o n r e e :c = M .

    G R o u e 2

    ( l e t ) l e t x = M ; L --= L w h e r e x = M

    ( I ' ) f ( x ) = L ~ f = ( g w h e r e g ( x ) = L )

    f ( a , b , c ) ( x , y ) = L ~ f ( a , b , c ) = ( g w h e r e g ( x , y ) = L )

    a n d s o o n f o r e a c h s h a p e o f le f t - h a n d s i d e

    ( I ) ( f w h e r e f ( x ) = L ) M ~ L w h e r e x = M

    ( ~ ' ) ( x = L ) w h e r e y = M ~ x ~ ( L w h e r e y = M )

    ( D ' ) x = L a n d y = M a n d ~ - . . - a n d z = N

    ( z , y , , z ) = ( L , M , - , N )

    R u l e s ( I ' ) , ( ~ ' ) , ( D ' ) , t o g e t h e r w i t h ( Y ) b e l o w , e n a b l e

    a n y d e f i n i t i o n t o b e s t a n d a r d i z e d , i .e . , e x p r e s s e d i n a

    l h s / r h s

    f o r m , i n w h i c h t h e

    l h s

    i s p r e c i s e l y t h e d e f i n e e . T h u s

    a n o n s t a n d a r d d e f i n i t i o n c a n b e t r a n s f o r m e d s o a s t o b e

    a m e n a b l e t o r u le s ( ~ ) a n d ( ~) ( s ee G r o u p 2 ' ) .

    G R O U P 2 f

    (f l ) L w h e r e x = M

    S u b s t ~ i Ch e r e

    M

    S u b s t L

    X

    m e a n s r o u g h l y t h e e x p r e s s i o n re s u l t in g

    f r o m s u b s t i t u ti n g A f o r B t h r o u g h o u t C . H e r e ' x ' m a y b e

    a n y l i s t - s t r u c t u r e o f

    d i s t i n c t

    i d e n t i f i e r s , p r o v i d e d t h a t

    ' M ' h a s s t r u c t u r e t h a t f i t s i t .

    T h i s r u l e is t h e m o s t i m p o r t a n t , b u t i t h a s o n l y l im i t e d

    v a l i d i ty , n a m e l y , w i th i n t h e p u r e l y f u n c t i o n a l s u b s e t o f

    IS W lM t h a t r e s u lt s f r o m n o t u s i n g t h e p r o g r a m - p o i n t

    f e a t u r e o r a s s i g n m e n t .

    I t s i m p o r t a n c e l i es in a v a r i a n t o f a f a m o u s t h e o r e m o f

    m a t h e m a t i c a l l o g i c , t h e C h u r c h - R o s s e r t h e o r e m . T h i s

    c o n c e r n s th e p o s s i b i li t y o f e l i m i n a ti n g ' w h e r e ' f r o m a n

    e x p r e ss i o n b y r e p e a t e d l y a p p l y i n g t h e r u l e s s t a t e d a b o v e ,

    i n c l u d i n g c r u c i a l l y ( ~) . T h e t h e o r e m e n s u r e s t h a t i f t h e r e

    a r e s e v e r a l w a y s o f d o i n g t h is t h e y a l l r e a c h t h e s a m e

    r esu l t .

    T h e a u t h o r t h i n k s t h a t t h e f r u i t fu l d e v e l o p m e n t t o

    e n c o m p a s s a l l I S W l M w i ll d e p e n d o n e s t a b l i s h i n g s a f e

    a r e a s o f a n ISW lA ~ e x p r e s s io n , i n w h i c h i m p e r a t i v e f e a t u r e s

    c a n b e d i s r e g a rd e d . T h e u s e f u ln e s s o f t h i s d e v e l o p m e n t

    w i ll d e p e n d o n h o w s u c c e s s f u l ly IS W l M ' S n o n i m p e r a t i v e

    f e a t u r e s s u p e rs e d e c o n v e n t i o n a l p r o g r a m m i n g .

    GROUP 3

    ( - -~ ) t r u e - -~ M ; N ~ M

    ( - - / ) f a l s e - ~

    M

    N ~ N

    ( -- -~ ) P ~ M ~ P ~ M ; u n d e f i n e d

    ( u n d e f i n e d ) u n d e f i n e d ~ s e l f a p p l y ( s e l f a p p l y )

    w h e r e s e l f a p p l y ( f ) = f ( f )

    ( Y ) r e c x = L ~ x = ( L w h e r e r e c x = L )

    ( D ) ( x , - . . , z ) = M ~ - ( x , ' , z ) =

    n u l l ( t k w )

    h w , . . . , h ( t ~ - l w )

    w h e r e w = M

    ( f o r k > 2 )

    (x, (u, v), z) = M =- (x, (u, v), z) =

    n u l l ( t a w )

    h ( w ) ,

    ( n u l l ( t2 w ' ) - - ~

    h ( w ' ) , h ( t ( w ' ) )

    w h e r e w ' =

    h ( t ( w ) ) )

    h ( t 2 w )

    w h e r e

    w = M

    arid so on for each shape of definee

    ( n u l l ) n u l l ( n u l l i s l ) - = t r u e

    ( n u l l I ) n u l l ( L a, . . ' , L k ) ~

    f a l s e

    w h e r e ( x , ' , z)

    = L b , L k ( k > 2 )

    ( h ) h ( L b , L k ) ~ x

    w h e r e ( x , - . . , z )

    = L j , . - . , L i t ( k > 2 )

    ( t ) t ( L 1 , . . . , L ~ ) ~ y , . . . , z

    w h e r e ( x , y , - . - , z )

    = L 1 , ' , L k (k _ 3 )

    ( t ' ) t ( t (L l , L2)) =-- nul l is t

    w h e r e ( x , y ) = L1, L2

    T h e r u l e s a b o u t l i s ti n g s m a y a p p e a r w i l l f u l l y i n d i r e c t .

    T h e m o r e n a t u r a l t r a n s f o r m a t i o n s a r e t h o s e e ff e c t ed b y

    a p p l y i n g , f o r e x a m p l e , ( D I ') t h e n ( ~) . B u t t h e s e w o u l d

    h a v e s u f f e r e d t h e s a m e l i m i t e d v a l i d i t y a s ( ~) . I n t h e i r

    a b o v e s l i g h t l y c a u t i o u s f o r m u l a t i o n t h e v a l i d i t y o f ( D I ' ) ,

    e t c . is u n r e s t r i c t e d , a n d t h e m o r e p o w e r f u l eq u i v a l e n c e s

    t h a t h o l d f o r n o n i m p e r a t i v e e x p r e s s i o n s a r i s e e n t i r e l y

    f rom ( /3) .

    G R o u P 4

    A p r o b l e m - o r i e n t a t i o n o f Is w I~ r c a n b e c h a r a c t e r i z e d

    b y a d d i t i o n a l a x i o m s . I n t h e s i m p l e s t c a s e s u c h a n a x i o m

    i s a n I s w i M d e f i n i t i o n . T h e r e s u l t i n g m o d i f i c a t i o n i s c a l l e d

    a d e f i n i t i o n a l e x t e n s i o n o f t h e o r i g i n a l s y s t e m .

    I n m o r e e l a b o r a t e c a s e s a x i o m s m a y m u t u a l l y c o n s t r a i n

    a g r o u p o f i d e n t if i e r s ; e. g . t h e f o l l o w i n g r u l e f o r e q u a l i t y

    a m o n g i n t e g e r s :

    ( = ) S u p p o s e L a n d M a r e I S W I M w r i t t e n i n t e g e rs

    ( i . e . , s t r i n g s o f d i g i t s ) ; t h e n e i t h e r o n e o r t h e o t h e r o f t h e

    f o l lo w i n g h o l d s :

    L = M ~ - t r u e

    L = M ~ f a l s e

    a c c o r d i n g a s L a n d 114 d i f f e r a t m o s t i n l e f t h a n d z e r o s, o r

    n o t .

    A n o t h e r e x a m p l e p r e s e n t e d e v e n l e s s f o r m a l l y i s t h e

    s t r u c t u r e d e f i n i t i o n f o r a b s t r a c t I S W l M .

    G r o u p 1 a b o v e m a k e s n o p r o v i s i o n f o r s u b s t i t u t i o n s

    w i t h i n e x p r e s s i o n s t h a t a r e q u a l i f i e d b y a s u p p o r t i n g

    d e f i n i t i o n o r a r e u s e d t o d e f i n e a f u n c t i o n . H o w e v e r s u c h

    a s u b s t i t u t i o n i s l e g i t i m i z e d a s l o n g a s i t d o e s n o t i n v o l v e

    t h e d e f i n e e s o r v a r i a b l e s , b y e n c a s i n g i t w i t h i n a p p l i c a t i o n s

    o f ru l e ( / 3) a n d i t s i n v e r s e ( w i t h a n y o t h e r r u l e s t h a t m i g h t

    V o l u m e 9 / N u m b e r 3 M a r c h , 1 96 6

    C o m m u n i c a t io n s o f t h e A C M

    161

  • 8/21/2019 Landin - The Next 700 Programming Languages (1966)

    6/10

    b e n e e d e d t o p r o d u c e s o m e t h i n g t h a t i s a m e n a b l e t o ( ~ ) ,

    i . e . , a bee t w i t h a

    s t a n d a r d

    def i n i t i on) .

    E q u i v M e n c e ru l e s c a n b e u se d t o p r o v e t h i n g s a b o u t t h e

    s y s t e m . F o r e x a m p l e , t h e r e a d e r w i ll r e a d i ly v e r i f y t h a t

    t h e e q u i v a l e n c e o f

    f (6) wh ere re ef (n ) = (n=0 ) --~ 1; n f ( n - - l )

    a n d

    6 (f(5) w h e r e re e f (n) = (n=0 ) --~ 1;

    n f

    ( n - - l ) )

    c a n b e e s t a b l i s h e d w i t h t h e f o l l o w i n g s t e p s :

    ( I ' ) , ( Y ) , ( f~ ), ( Y ) ,

    (f3), (I) , (= ), ( i3) backwards, (Y) backwards,

    (I ') backwards.

    i n t h i s s e q u e n c e w e o m i t t h e a u x i l i a r y a p p l i c a t i o n s o f ( ~ ) ,

    e t c. t h a t a r e n e e d e d a t M m o s t e v e r y s t e p t o le g i ti m i z e t h e

    s u b s t i t u t i o n .

    8 . A p p l i c a t i o n a n d D e n o t a t i o n

    T h e c o m m o n p l a c e e x p r es s io n s o f a r i t h m e t i c a n d a l g e b r a

    h a v e a c e r t a i n s i m p l i c i t y t h a t m o s t c o m m u n i c a t i o n s t o

    c o m p u t e r s la c k . I n p a r t i c u l a r , ( a ) e a c h e x p r e s s i o n h a s a

    n e s t i n g s u b e x p r e s s i o n s t r u c t u r e , ( b ) e a c h s u b e x p r e s s i o n

    d e n o t e s s o m e t h i n g ( u s u a ll y a n u m b e r , t r u t h v M u e o r

    n u m e r i c a l f u n c t i o n ) , ( c ) t h e t h i n g a n e x p r e s s i o n d e n o te s ,

    i .e . , i t s v a l u e , d e p e n d s o n l y o n t h e v a l u e s of i t s sub-

    e x p r es s io n s , n o t o n o t h e r p r o p e r t i e s o f th e m .

    I t i s t h e s e p r o p e r t i e s , a n d c r u c i a l l y ( c ) , t h a t e x p l a i n s

    w h y s u c h e x p r e s s i o n s a r e e a s i e r t o c o n s t r u c t a n d u n d e r -

    s t a n d . T h u s i t is ( c ) t h a t l ie s b e h i n d t h e e v o l u t i o n a r y

    t r e n d t o w a r d s b i g g e r r i g h t h a n d s i d e s i n p l a c e o f s t ri n g s

    o f s m a l l , e x p l i c i tl y s e q u e n c e d a s s i g n m e n t s a n d j u m p s .

    W h e n f a c e d w i t h a n e w n o t a t i o n t h a t b o r r o w s t h e f u n c -

    t i o n a l a p p e a r a n c e o f e v e r y d a y a l g e b r a , i t i s (c ) t h a t g i v e s

    u s a t e s t f o r w h e t h e r t h e n o t a t i o n is g e n u i n e l y fu n c t i o n a l

    o r m e r e l y m a s q u e r a d i n g .

    T h e i m p o r t a n t f e a t u r e o f IS W IM 's e q u i v a l e n c e r u l e s is

    c h a t t h e y g u a r a n t e e t h e s a m e d e s i r a b l e p r o p e r t i e s t o

    IS W lM 'S n o n i m p e r a t i v e s u b se t . W e m a y e q u a t e a b s t r a c t

    o b j e c t w i t h e q u i v a l e n c e c l a ss , a n d e q u a t e d e n o t e s

    w i t h

    i s

    a m e m b e r o f . T h e n t h e p r o p e r t ie s (g ) a n d ( v )

    e n s u r e s a n o l o g i e s o f ( c ) a b o v e . T h e y s t a t e t h a t t h e v a l u e

    o f an o p e r a t o r / o p e r a n d c o m b i n a t i o n d e p e n d s o n l y o n t h e

    v a l u e s

    o f i ts c o m p o n e n t s u b e x p r e ss i o n s, n o t o n a n y o t h e r

    a s p e c t s o f t h e m .

    T h u s c o n d i t i o n s ( g ) a n d ( v ) a r e e q u i v a l e n t t o t h e

    e x i s te n c e o f a d y a d i c o p e r a t i o n a m o n g t h e a b s t r a c t o b -

    j e c t s; w e c a ll t h i s o p e r a t i o n a p p l i c a t i o n .

    T h e t e r m i n o lo g y o f a b s t r a c t o b j e c t s , d e n o t i n g a n d

    a p p l i c a t i o n is f r e q u e n t ly m o r e c o n v e n ie n t t h a n t h a t o f

    e q u i v a l e n c e r e la t io n s . F o r e x a m p l e , i t s u g g e st s a n o t h e r

    w a y o f c h a r a c t e r i z i n g e a c h p r o b l e m - o r i e n t a t i o n o f I S W l M .

    W e c a n t h i n k o f a se t o f a b s t r a c t o b j e c t s w i t h a p a r t i a l l y

    d e f i n e d d y a d i c a p p l i c a t i o n o p e r a t i o n a n d a m o n a d i c

    d e s i g n a t i o n o p e r a t i o n t h a t a s s o c ia t e s a p r i m i t i v e

    a b s t r a c t o b j e c t w i t h e a c h o f s o m e c h o s e n s e t o f n a m e s ,

    c a l le d t h e c o n s t a n t s o f t h e s p e c ia l s y s t e m .

    C o n s i d e r f o r e x a m p l e a p r o g r a m m i n g l a n g u a g e t h a t

    c o n t a i n s e x p r e s s i o n s s u c h a s

    ' w i n e '

    A n y o n e w i t h a g e n e r o u s o n t o l o g y w i ll a d m i t t h a t

    t h i s 6 - c h a r a c t e r e x p r es s i o n d e n o t e s t h e 4 - c h a r a c t e r - s t r in g

    w i n e

    F o r s u c h a p e r s o n i t s u s e i n t h e l a n g u a g e i s c h a r a c t e r i z e d

    b y

    • t h e o b j e c t s t h a t i t i s a p p l i c a b le t o , a n d t h e o b j e c t i t

    p r o d u c e s i n e a c h c a s e ( e . g . , s t r i n g s m i g h t b e u s e d l i k e

    v e c t o r s , w h o s e a p p l i c a t i o n t o a n i n t e g e r p r o d u c e s a n

    i t e m o f t h e s t r i n g ) .

    • T h e o b j e c t s t h a t i t is a m e n a b l e t o , a n d t h e o b j e c t i t

    y i e l d s i n e a c h c a s e ( e . g . , p r e f i x i n g , a p p e n d i n g , s e l e c t i o n ,

    e t c . ) .

    T h e s c e p t i c n e e d n o t f e e l l e f t o u t . H e j u s t h a s t o t a l k , a

    b i t m o r e c l u m s i l y , a b o u t

    ' w ine '

    b e i n g i n t h e e q u i v a l e n c e c l as s t h a t a ls o c o n t a i n s

    concatenate ( 'wi ' , 'he ' )

    a n d

    append (f i f lhle t terof (romanalphabet) ,

    ( threelet terstemof ( 'winter ' ))

    T h e n h e g o e s o n t o s p e a k o f th e e q u i v a l e n c e c l as s o f

    e x p r e s s i o n s t h a t c a n s e r v e a s o p e r a n d o r o p e r a t o r t o a n y

    o f t h e a b o v e , a n d t h e e q u i v a l e n c e c l as s o f th e r e s u l t i n g

    o p e r a t o r / o p e r a n d c o m b i n a t i o n .

    9 . N o t e o n T e r m i n o l o g y

    I SW I M b r i n g s i n t o s h a r p r e l ie f s o m e o f t h e d i s t i n c t i o n s

    t h a t t h e a u t h o r t h i n k s a r e i n t e n d e d b y s u c h a d j e c t i v e s a s

    p r o c e d u r a l , n o n p r o e e d u r a l , a l g o r i t h m i c , h e u r i s t i c , i m p e r a -

    t i v e , d e c l a r a t i v e , f u n c t i o n a l , d e s c r i p t i v e . H e r e i s a s u g -

    g e s t e d c l a s s i f i c a t i o n , a n d o n e n e w w o r d .

    F i r s t, n o n e o f t h e s e d i s t i n c ti o n s a r e c o n c e r n e d w i t h t h e

    u s e o f p i d g i n E n g l i sh r a t h e r t h a n p i d g i n a l g eb r a . A n y

    p i d g i n a l g e b r a c a n b e d r e s s e d u p a s p i d g i n E n g l i s h t o

    p l e a s e t h e g e n e r a l s . C o n v e r s e l y , i t i s a s p e c i a l e a s e o f t h e

    t h e s is u n d e r l y i n g I SW l M t h a t a n y p i d g i n E n g l i s h t h a t h a s

    s o fa r b e e n i m p l e m e n t e d c a n b e s t r i p p e d t o p i d g i n a l g e b r a .

    T h e r e i s n e v e r t h e l e s s a n i m p o r t a n t p o s s i b il i ty o f h a v i n g

    l a n g u a g e s t h a t a r e h e u r i s ti c o n a c c o u n t o f t h e i r a p p l i c a -

    t i v e s t r u c t u r e b e i n g h e u r i st i c .

    A n i m p o r t a n t d i s t i n c t i o n i s t h e o n e b e t w e e n i n d i c a t i n g

    w h a t b e h a v i o r , s t e p - b y - s te p , y o u w a n t t h e m a c h i n e t o

    p e r f o rm , a n d m e r e l y i nd i c at in g w h a t o u t c o m e y o u w a n t .

    P u t t h a t w a y , t h e d i s t in c t i o n w il l n o t s t a n d u p t o c l os e

    i n v e s t i g a t i o n . I s u g g e s t t h a t t h e c o n d i t i o n s ( a - e ) i n S e c t i o n

    8 a r e a n e c e ss a r y p a r t o f m e r e l y i n d i c a t in g w h a t o u t c o m e

    y o u w a n t . T h e w o r d d e n o t a t i v e s e em s m o r e a p p r o -

    p r i a t e t h a n n o n p r o e e d u r a l , d e c l a r a t i v e o r f u n c t i o n a l . T h e

    a n t i t h e s is o f d e n o t a t i v e is

    i m p e r a t i v e .

    E f f e c t i v e l y

    d e n o t a t i v e m e a n s c a n b e m a p p e d i n t o IS W~ M w i t h o u t

    u s i n g j u m p i n g o r a s s ig n m e n t , g i v e n a p p r o p r i a t e p ri m i -

    t i ves .

    1 6 2 C o m m u n i c a t i o n s of th e ACM Voh, me 9 / Nu mb er 3 / M ar ch , 1966

  • 8/21/2019 Landin - The Next 700 Programming Languages (1966)

    7/10

    I t f o l l o w s t h a t f u n c t i o n a l p r o g r a m m i n g h a s l i t t l e t o d o

    w i t h f u n c t i o n a l n o t a t i o n . I t i s a t r i v i a l a n d p o i n t l e s s t a s k

    t o r e a r r a n g e s o m e p i e c e o f s y m b o l i s m i n t o p r e f i x e d o p e r a -

    t o r s a n d h e a v y b r a c k e t i n g . I t i s a n i n t e l l e c tu a l l y d e m a n d -

    i n g a c t i v i t y t o c h a r a c t e r i z e s o m e p h y s i c a l o r l o g i c a l

    s y s t e m a s a s e t o f e n t i ti e s a n d f u n c t i o n a l r e l a t i o n s a m o n g

    t h e m . H o w e v e r , i t m a y b e le ss d e m a n d i n g a n d m o r e

    r e v e a l i n g t h a n c h a r a c t e r i z i n g t h e s y s t e m b y a c o n v e n t i o n a l

    p r o g r a m , a n d i t m a y s e r ve t h e s a m e p u r po s e . H a v i n g

    f o r m u l a t e d t h e m o d e l , a s p e c if i c d e s i r e d f e a t u r e o f t h e

    s y s t e m c a n b e s y s t e m a t i c a l l y e x p r e s s e d i n f u n c t i o n a l

    n o t a ti o n . E u t o t h e r n o t a t i o n s m a y b e b e t t e r h u m a n

    e n g i n e e r i n g . S o t h e r o le o f f u n c t i o n a l n o t a t i o n i s a s t a n d a r d

    b y w h i c h t o d e s c r i b e ot h e r s , a n d a s t a n d b y w h e n t h e y f a il .

    T h e p h r a s e d e s c r ib e i n t e r m s o f h a s b e e n u s e d a b o v e

    w i t h r e f e r e n c e t o a l g o r i t h m i c m o d e s o f e x p r e s s i o n , i . e . ,

    i n t e r c h a n g e a b l y w i t h e x p r e s s i n t e r m s o f . I n t h is s e n s e

    3

    + 4 i s a d e s c ri p t i o n of t h e n u m b e r 7 in t e r m s o f t h e

    n u m b e r s 3 a n d 4 . T h i s c o n f li c ts w i t h c u r r e n t u s e o f t h e

    p h r a s e d e s c r i p t i v e l a n g u a g e s , w h i c h a p p e a r s t o f o ll o w

    t h e l o g i c i a n s . F o r e x a m p l e , a l a n g u a g e i s d e s c r i p t i v e i n

    w h i c h t h e m a c h i n e i s t o l d

    P r i n t t h e x s u c h t h a t x 2 - - x - - 6 = 0 / ~ x > 0

    S u c h a c l a s s i fi c a ti o n o f l a n g u a g e s ( a s o p p o s e d t o m e r e l y

    e x p r e s s io n s w i t h i n la n g u a g e s ) i s u s e le s s , a n d e v e n h a r m f u l

    b y e n c o u r a g i n g s t u p i d l y r e s t r i c t i v e l a n g u a g e d e s ig n , i f i t

    e x c l u d e s t h e f o l l o w i n g :

    P r i n t s q u a r e ( t h e x s u c h t h a t x ~ - - x - - 6 = 0 A x > 0 )

    P r i n t u ( u + l )

    w h e r e u = t h e x s u c h t h ~ t x 2 - x - - 6 = 0 A x _> 0 .

    P r i n t f ( 1 , - - 1 , 6 )

    where f ( a ,

    b , c) = the x such that

    a x ~ ÷ b x + c = 0 A x > _0

    O n t h e o t h e r h a n d i t m i g h t r e a s o n a b l y e x c l u d e

    P r i n t

    so l e po s i t i v e z e r o o f

    ( 1 , - - 1 , - - 6 )

    w h e r e

    s o l e p o s i t i v e z e r o o ]

    h a p p e n s t o b e a l i b r a r y f u n c t i o n .

    T h e a u t h o r t h e r e f o r e s u g g e s t s t h a t t h e r e i s a u s e f u l

    d i s t i n c ti o n t h a t c a n b e m a d e h e r e c o n c e r n i n g

    l a n g u a g e s .

    C o n s i d e r t h e f u n c t i o n i , w h i c h o p e r a t e s o n a c l a s s ( o r

    p r o p e r t y ) h a v i n g a s o le m e m b e r ( o r i n s t a n c e ) , a n d t r a n s -

    f o r m s i t i n to i t s s ol e m e m b e r . W e a r e i n t e r e s t e d i n w h e t h e r

    o r n o t a l a n g u a g e p e r m i t s r e f e r e n c e t o i , w i t h m o r e o r

    l e ss r e s t r i c t e d d o m a i n .

    F o r e x a m p l e th e a b o v e p r o g r a m s b e c o m e :

    P r i n t i p w h e r e p ( x ) = x 2 - - x - - 6 A x > O )

    P r i n t squa r e ( i ( p

    w h e r e

    p ( x ) = x 2 - - x - - 6 A x > 0 ) )

    P r i n t u (u--}-1 )

    w h e r e u = i ( p

    w h e r e p ( x ) = x ~ - - x - - 6 A x > O )

    P r i n t f ( 1 , - - 1 , - - 6 )

    w h e r e f ( a , b , c ) =

    i ( p

    w h e r e

    p ( x ) = a x 2 - b b x + c A x > O)

    M o r e p r e c i s e ly , t h e d i s t i n c ti o n h i n g e s o n w h e t h e r , w h e n

    a p p l i c a t i v e s t r u c t u r e i s i m p u t e d t o t h e la n g u a g e , i t c a n

    b e d o n e w i t h o u t r e s o r t i n g t o i , o r to p r i m i t i v e s in t e r m s o f

    w h i c h i c a n b e d e f i n e d .

    T h i s d i s c u s s i on o f i r e v e a l s t h e p o s s i b i l i ty t h a t p r i m i t i v e s

    m i g h t b e s e n s a t i o n a l l y n o n a l g o r i t h m i e . S o t h e a l g o r i t h m i c /

    h e u r i s t ic d i s t in c t i o n c u t s a cr o s s t h e d e n o t a t i v e / i m p e r a t i v e

    V o l u m e 9 / N u m b e r 3 / M a r c h , 1 9 6 6

    ( i. e. , n o n p r o e e d u r a l / p r o c e d u r a l ) d i s t in c t i o n . O n t h e o t h e r

    h a n d i f l i m i t e d f o r m s o f i c a n b e a l g o r i t h m i z e d , t h e y s t il l

    d e s e r v e t h e t e r m d e s c r i p t i v e . S o t h i s f a c t o r i s a l so

    i n d e p e n d e n t .

    1 0. E l i m i n a t i n g E x p l ie l t S e q u e n e l n g

    T h m ' e i s a g a m e s o m e t i m e s p l a y e d w i t h A L G O L 6 0

    p r o g r a m s - - r e w r i t i n g t h e m s o a s t o a v o i d u s i n g l a b e l s a n d

    g o t o s t a t e m e n t s . I t i s p a r t o f a m o r e e m b r a c i n g g a m e - -

    r e d u c i n g t h e e x t e n t t o w h i c h t h e p r o g r a m c o n v e y s i t s

    i n f o r m a t i o n b y e x p l i c i t s e q u e n c i n g . R o u g h l y s p e a k i n g t h i s

    a m o u n t s t o u s i ng f e w e r a n d l a r g e r s ta t e m e n t s . T h e g a m e ' s

    s i g ni f ic a n c e li e s i n t h a t i t f r e q u e n t l y p r o d u c e s a m o r e

    t r a n s p a r e n t p r o g r a m - - e a s i e r t o u n d e r s t a n d , d e b u g ,

    m o d i f y a n d i n c o r p o r a t e i n t o a l a r g e r p r o g r a m .

    T h e a u t h o r d o e s n o t a r g u e t h e e a s e a g a i n s t e x p l i c it

    s e q u e n c i n g h e re . I n s t e a d h e t a k e s a s p o i n t o f d e p a r t u r e t h e

    o b s e r v a t i o n t h a t t h e u s e r o f a n y p r o g r a m m i n g l a n g u a g e i s

    f r e q u e n t l y p r e s e n t e d w i t h a c h o i c e b e t w e e n u s i n g e x p l ic i t

    s e q u e n c i n g o r s o m e a l t e r n a t i v e f e a t u r e o f t h e l a n g u a g e .

    F u r t h e r m o r e l a n g u a g e s v a r y g r e a t l y i n t h e a l t e r n a t i v e s

    t h e y o f f e r . F o r e x a m p l e , o u r g a m e i s g r e a t l y f a c i l i t a t e d b y

    A L G OL 6 0 'S c o n d i t i o n a l s t a t e m e n t s a n d c o n d i t i o n a l e x -

    p r e s s i o n s . S o t h e q u e s t i o n c o n s i d e r e d h e r e i s : W h a t o t h e r

    s u c h f e a t u r e s a r e t h e r e ? T h i s q u e s t i o n i s c o n s i d e r e d b e -

    c a u s e , n o t s u r p r i s i n g l y , i t t u r n s o u t t h a t a n e m p h a s i s o n

    d e s c r i b in g t h i n g s i n t e r m s o f o t h e r t h i n g s l e a d s t o t h e

    s a m e k i n d o f r e q u i r e m e n t s a s a n e m p h a s i s a g a i n s t e x p l i c i t

    s e q u e n c i n g .

    T h o u g h A ~G O ~ g 0 is c o m p a r a t i v e l y f a v o r a b l e t o t h i s

    a c t i v i t y , i t s h a r e s w i t h m o s t o t h e r c u r r e n t l a n g u a g e s

    c e r t a i n d e f i ci e n ci e s t h a t s e v e r e l y li m i t h o w f a r t h e g a m e

    c a n g o. T h e a u t h o r ' s e x p e r i m e n t s s u g g e s t t h a t t w o o f t h e

    m o s t n e e d e d f e a t u r e s a r e :

    • T r e a t a l i s t i n g o f e x p r e s s i o n s a s a s p e c i a l e a s e o f t h e

    c l a s s o f e x p r e s s i o n s , e s p e c i a l l y i n t h e a r m s o f a c o n d i t i o n a l

    e x p r e s s i o n , a n d i n d e f i n i n g a f u n c t i o n .

    • T r e a t , a r g u m e n t l i s t s a s a s p e c i a l e a s e o f l is t s . S o a

    t r i a d ic f u n c t i o n c a n h a v e i t s a r g u m e n t s s u p p l i e d b y a

    c o n d i t i o n a l w h o s e a r m s a r e 3 - l i s t i n g s , o r b y a p p l i c a t i o n o f

    a f u n c t i o n t h a t p r o d u c e s a 3 -l i s t. A s i m i l a r s i t u a t i o n a r i s e s

    w h e n a 3 - l i s t i n g o c c u r s a s a d e f i n e e . ( E v e n L I s P t r i p s u p

    h e r e , o v e r l i s t s o f l e n g t h o n e . )

    T o c l a r i fy t h e i r p r a c t i c a l u s e , h e r e a r e s o m e o f t h e

    s t e p s b y w h i c h m a n y a c o n v e n t i o n a l A L G O L e 0 o r P L / 1

    p r o g r a m c a n b e t r a n s f o r m e d i n t o a n I s w I~ ,r p r o g r a m t h a t

    e x p l o i t s I s w I s l ' s n o n i m p e r a t i v e f e a t u r e s .

    ( 1) R e w r i t e t h e p r o g r a m s o a s t o us e t w o - d i m e n s i o n a l

    l a y o u t a n d a r r o w s t o i l l u m i n a t e t h e e x p l i c i t s e q u e n c i n g ,

    i . e . , a s a f l o w c h a r t w i t h a l g e b r a i c s t e p s . R e a r r a n g e t h i s t o

    a c h i e v e t h e l e a s t c o n f u s i ng n e t w o r k o f a r r o w s .

    ( 2) A p p l y t h e f o l l o w in g c h a n g e s r e p e a t e d l y w h e r e v e r

    t h e y a r e a p p l i c a b l e :

    ( a ) R e p l a c e a s t ri n g o f i n d e p e n d e n t a s s i g n m e n t s b y o n e

    m u l t i p l e a s s i g n m e n t .

    ( b ) R e p l a c e a n a s s i g n m e n t h a v i n g p u r e l y l o c a l s i gn if i-

    c a n c e b y a w h e r e - c l a u s e .

    ( e) R e p l a c e p r o c e d u r e s b y t y p e - p r o c e d u r e s ( p o s s i b ly

    C o m m u n i c a t i o n s o f t b e A C M 163

  • 8/21/2019 Landin - The Next 700 Programming Languages (1966)

    8/10

    w i t h m u l t i p l e t y p e ) , a n d p r o c e d u r e s t a t e m e n t s b y a s si g n-

    m e n t s t a t e m e n t s .

    ( d) R e p l a c e c o n d i t i o n a l j u m p s b y c o n d i t i o n a l s t a te -

    m e n t s h a v i n g b i g g e r a r m s .

    ( e) R e p l a c e a b r a n c h w h o s e a r m s h a v e a s si g n ee s i n

    c o m m o n b y a n a s s ig n m e n t w i t h c o n d i t i o n a l r i g h t - h a n d

    side.

    ( f) R e p l a c e a j o i n b y t w o c a l ls fo r a p r o c e d u r e .

    I t s h o u l d b e o b s e r v e d t h a t t r a n s l a t in g i n t o I SW l M d o e s

    n o t

    force

    s u c h r e a r r a n g e m e n t s ; i t m e r e l y f a c i l i t a t e s t h e m .

    O n e i n t e r e s t i n g o b s e r v a t i o n i s t h a t t h e m o s t r e c a l c i t r a n t

    u s e s o f e x p l i c i t s e q u e n c i n g a p p e a r t o b e a s s o c i a t e d w i t h

    s u c c e s s / f a i l u r e s i t u a t i o n s a n d t h e a c t i o n n e e d e d o n f a i l u r e .

    S e c t i o n 2 di s c us s e d a d d i n g ' w h e r e ' t o a c o n v e n t i o n a l

    p r o g r a m m i n g l a n g u a g e. T h e o r y a n d e x p e r i m e n t b o t h

    s u p p o r t t h e o p p o s i t e a p p r o a c h , t h a t t a k e n i n L l s v , o f

    a d d i n g i m p e r a t i v e f e a t u r e s t o a b a s i c a l l y n o n i m p e r a t i v e

    l a n g u a g e . O n e b i g a d v a n t a g e i s t h a t t h e r e s u l ti n g l a n g u a g e

    w i ll h a v e a n o n i m p e r a t i v e s u b s e t.

    T h e s p e c i a l c l a i m o f IS W l M i s t h a t i t g r a f t s p r o c e d u r a l

    n o t i o n s o n t o a p u r e l y f u n c t i o n a l b a s e w i t h o u t d i s t u r b i n g

    m a n y o f t h e d e s i r a b l e p ro p e r t i e s. T h e u n d e r l y i n g i d e a s

    h a v e b e e n p r e s e n t e d i n [2 ]. T h i s p a p e r c a n d o n o m o r e t h a n

    b e g i n t h e t a s k o f e x p l a i n i n g t h e i r p r a c t i c a l s i g n i f i c a n c e .

    11 . C o n c l u s i o n

    T h e l a n g u a g e s p e o p l e u s e t o c o m m u n i c a t e w i t h c o m -

    p u t e r s d i f f e r i n t h e i r i n t e n d e d a p t i t u d e s , t o w a r d s e i t h e r a

    p a r t i c u l a r a p p l i c a t io n a r e a , o r a p a r t i c u l a r p h a s e o f c o m -

    p u t e r u s e ( h ig h le v e l p r o g r a m m i n g , p r o g r a m a s s e m b l y ,

    j o b s c h e d u l i n g , e t c ) . T h e y a l s o d i f fe r i n p h y s i c a l a p p e a r -

    a n c e , a n d m o r e i m p o r t a n t , i n lo g i ca l st r u c t u r e . T h e q u e s -

    t i o n a r i se s , d o t h e i d i o s y n c r a c i e s r e f l e c t b a s i c l o g i c a l

    p r o p e r t i e s o f t h e s i t u a t i o n s t h a t a r e b e i n g c a t e r e d f o r ?

    O r a r e t h e y a c c i d e n t s o f h i s t o r y a n d p e r s o n a l b a c k g r o u n d

    t h a t m a y b e o b s c u r i n g f r u i t f u l d e v e l o p m e n t s ? T h i s

    q u e s t i o n i s c l ea r l y i m p o r t a n t i f w e a r e t r y i n g t o p r e d i c t o r

    i mq_ uence l ang uag e e vo l u t i on .

    T o a n s w e r i t w e m u s t t h i n k i n te r m s , n o t o f l a n g u a g e s ,

    b u t o f fa m i l ie s o f l a n g u a g e s. T h a t i s t o s a y w e m u s t

    s y s t e m a t i z e t h e i r d e s i g n s o t h a t a n e w l a n g u a g e i s a p o i n t

    c h o s e n f ro m a w e l l - m a p p e d s p a c e, r a t h e r t h a n a l a b o r i o u s ly

    d e v i s e d c o n s t r u c t io n .

    T o t h i s e n d t h e a b o v e p a p e r h a s m a r s h a l l e d t h r e e

    t e c h n i q u e s o f la n g u a g e d e s i g n : a b s t r a c t s y n t a x , a x i o m a t i z a -

    t i o n , a n d a n u n d e r l y i n g a b s t r a c t m a c h i n e .

    I t i s a s s u m e d t h a t f u t u r e c a ll s o n la n g u a g e d e v e l o p m e n t

    c a n n o t b e f o r s t a l l e d w i t h o u t g e n e r ~ l i z i n g t h e a l t e r n a t i v e s

    t o e x p l ic i t s e q u e n c in g . T h e i n n o v a t i o n s o f p r o g r a m -

    p o i n t s a n d t h e o f f -s i d e r u l e a r e d i r e c t e d a t t w o o f t h e

    p r o b l e m s ( r e s p e c ti v e l y i n t h e a r e a s o f s em a n t i c s a n d

    s y n t a x ) t h a t m u s t c o n s e q u e n t l y b e f a ce d .

    Acknowledgments. T h e a u t h o r i s g r a te f u l f o r h e lp f u l

    d i s c u s s io n s w i t h W . H . B u r g e . W i d e r i n f l u e n c e s o n t h e

    i n v e s t i g a t io n o f w h i c h t h i s p a p e r i s o n e o u t c o m e a r e

    m e n t i o n e d i n [ 1 ]. O f t h e s e t h e m a i n o n e s a r e t h e p u b l i c a -

    t io n s o f C u r r y a n d o f M c C a r t h y .

    ~ E F E R E N C E S

    1. LANDIN, P. J. The mechanical evalua tion of expressions.

    Comput. J. 6, 4 (Jan. 1964), 308-320.

    2. -- . A correspond ence betwee n ALGOL 60 arid Church 's

    Lambda-notat ion . Comm. ACM 8 (1965), 89-101; 158-165.

    3. -- . A formal descrip tion of ALGOL 60. In Formal Language

    Description Languages for Computer Programming, T. B.

    Steel, Jr. (Ed.), Nort h Hollan d, Amst erdam , 1965.

    4. -- . An abstract machine for designers of computing lan-

    guages. (Summary). IFIP65 Proc., Part II.

    D I S C U S S I O N

    Naur: Ilegarding indentation, in many ways I am in sympathy

    with this, but I believe that if it came about that this notation

    were used for very wide communication and also publication, you

    would regret it because of the kind of rearr angem ent of manu-

    scripts done in printing, for example. You very frequently run

    into the problem that you have a wide written line and then

    suddenly you go to the Communications of the ACM and radically,

    perhaps, you have to compress it. The printer will do this in any

    way he likes; he is used to having great freedom here and he will

    foui up your notation.

    Landin:

    I have great experience with this. (L aughter) I thi nk

    I am probably the only person who has run through three versions

    of the galley proofs for the

    Communications of the ACM.

    However,

    I think that next time I could do better, and I think it is worth

    looking into. At any rate, the principle tha t [ have described here

    is a good deal bet ter than some that one might think of ; for example

    it does riot depend on details of character width, character by

    charac ter--i t is just as good handwritten as it is printed. Secondly,

    limiting the breadth of the page, I agree with you, needs more

    consideration. By the time I got through with the particular

    example I am talking about, by getting it printed, I had devised

    what I thought was a fairly reasonable method of communicating

    the principles that have been used in indentation.

    Floyd:

    Anot her object ion that 7[ thi nk is quite serious to

    indentati on is that while it works on the micr o-scale --that is, one

    page is all r ig ht--wh en dealing with an extensive program, t urning

    from one page to the next there is no obvious way of indicating

    how far indentat ion stretches because there is no printing at all to

    indicate how far you have indented. I would like you to keep that

    in mind.

    Landin:

    Yes, I agree. In practice I deal with this by first making

    the page breaks in sensible places.

    Floyd:

    That ' s a l l right as long as you don't have an indented

    region which is simply several pages long.

    Landin:

    Well in that ease the way I did it was to cut down the

    number of carryover levels to about four or five from one page to

    another. You can at least make it simpler when you are hand-

    writing by putting some kind of symbols at the bottom of the page

    and top of the continuation.

    Floyd:

    Even if you regard your indent ation spaces as characters

    there still doesn' t seem to be any way--in fact, I am fairly sure

    there is no way--of representing the indentation conventions

    within a phrase-structure grammar.

    Landin:

    Yes, but some indentation conventions can be kept

    within phrase structure grammars by introducing two terminal

    symbols that are grammatically like parentheses, but are textually

    like typewriter keys for settling and clearing tabulation positions.

    More precisely, the textual representation of the second of these

    symbols can be explained as the following sequence of typewriter

    actions: 1) line-feed; 2) back-space as far as the right-most tab

    position that is still currently active; 3) clear tab position; and

    4) do step 2 again.

    While this fits some indentation conventions, the olle I propose

    is too permissive to be included. For my language I have written

    a formal grammar t hat is not phrase str ucture and includes one

    departure that meets this problem.

    1 6 4 Comm unic ati ons of the ACM Volume 9 / Numb er 3 / Marc h, 1966

  • 8/21/2019 Landin - The Next 700 Programming Languages (1966)

    9/10

    Leavenworth:

    I should like to raise the question of eliminating

    explicit jumps, I mean of using recursion as against interation.

    Landin:

    It seems to me that there are rather a small number of

    function s which you could use if you were writing a Lisp progr am

    in the places where ordinary programs would use iterations, and

    that if you were to use these the processor might do as well as if

    you had writte n a loop. For example, ite ra te (m, f, x) might

    apply f, m times to x with the result f ~(x). This is the simplest

    kind of loop I know and the function iterate provides a purely

    functional notation for this rather simple kind of loop. If a lot of

    familiar t ypes of loop can be repre sented by a few functions which

    could be defined recursively, I think it is sensible to take these as

    primitive. Another such function is while (p, f, x) which goes on

    applying f to x until the predica te p becomes false.

    Strachey:

    I must just interp olate here something which is a bit

    of adverti sing l suppose. Nearly all the linguistic feature s, such as

    where and while and and and recursive, that Peter Landin has

    been talking about are incorporated as an integral part of a pro-

    gramming language being developed at Cambridge and London

    called CPL. In fact the wher e clauses are a very important feature

    of this la nguage.

    Irons:

    I have put together a program which uses some of these

    features and which has a standard output which prints the pro-

    gram in an ind ented manne r. If it runs off the ri ght end of the page,

    it t:rnduces another page to go on the right, and so forth. While

    certainly there are some situations that occur when it would be a

    bit awkward to make the paper go around the room, I have found

    that in practice, by and large it is true that this is a very profit-

    able a ay of operating.

    Strachey:

    I should like to intervene now and try to initiate a

    slightly more general discussion on declarative or descriptive

    languages and to try to clear up some points about which there is

    considerable confusion. I have called the objects I am trying to

    discuss DLs because I don't quite know what they are. Here are

    some questions concerning ])Ls: (1) What are DLs? (2) What is

    their relationship to imperative languages? (3) Why do we need

    DLs? (4) How can we use them to program? (5) How can we

    implement them? (6) How can we do this efficiently? (7) Should we

    mix l)Ls with imperative languages?

    It seems to me that what I mean by DLs is not exactly what

    other people mean. I inean, roughly, languages which do not

    contain assignment statements or jumps. This is, as a matter of

    fact, not a very clear distinction because you can always disguise

    the assignments and the jumps, for that matter, inside other state-

    meat forms which m~ke them look different. The important

    characteristic of DLs is that it is possible to produce equivalence

    relations, particularly the rule for substitution which Peter

    Landin describes as (~) in his paper. That equivalance relati on,

    which appears to be essential in ahnost every proof, does not

    hold if you allow assignment statements. The great advantage

    then of l)Ls is that they give you some hope of proving the equi-

    valence of progra m transf ormat ions and to begin to have a calculus

    for combining and manipulating them, which at the moment we

    haven't got.

    I suggest that an answer to the second question is tha t DLs form

    a subset of all languages. They are an interesting subset, but one

    which is inconvenient to use unless you are used to it. We need

    them because at the moment we don't know how to construct

    proofs with languages which include imperatives and jumps.

    How should we use them to program? I think thi s is a matter of

    learning a new programnling technique. I am not convinced that

    all problems are amenable to programming in DLs but I am not

    convinced that there are any which are not either; I preserve an

    open mind on this point. It is perfectly true that in the process of

    rewriting programs to avoid labels and jumps, you've gone half

    the way towards going into 1)Ls. When you have also avoided

    assignment statements, you've gone the rest of the way. With

    many problems yeu can, in fact, go the whole way. LisP has no

    assignment statements and it is remarkable what you can do with

    pure Lisp if you try. If you thin k of it in terms of the i mple menta -

    tions that we know about, the result is generally intolerably

    ineffi cient --but then th at is where we come to the late r questions.

    How do we implement them? There have not been many at-

    tempts to implement DLs efficiently, I think. Obviously, it can be

    done fairly straightforwardly by an interpret ive method, but this

    is very slow. Methods which compile a runable prog ram run into a

    lot of very interesting problems. It can be done, because DLs are

    a subset of ordinary programming languages; any progr amming

    language which has sufficient capabilities can cope with them.

    There arc problems, however: we need entities whose value is a

    functi on--not the application of a function but a functi on--and

    these involve some problems.

    Itow to implement efficiently is another very interesting and

    difficult problem. It means, I think, recognizing certain subsets

    and transforming them from, say, recursions into loops. This can

    certainly be done even if they have been written iu terms of

    recursions and not, as Peter Landin suggested, in terms of already

    transformed functions like iterate or while.

    I think the last question, Should DLs be nIixed with impera-

    tive languages? , clearly has the answer that they should, be-

    cause at the moment we don't know how to do everything in pure

    DLs. If you mix declarative and imperative features like this, you

    may get an apparently large programming language, but the

    important thing is that it should be simple and easy to define a

    function. Any language which by mere chance of the way it is writ-

    ten makes it ex tremel y difficult to write compositions of function s

    and ve ry easy to writ e sequences of command s will, of course, in an

    obvious psychological way, hinder people from using descriptive

    rather t han imperative features. In the long run, I think the effect

    will delay our underst andin g of basic similarities, which underlie

    different sorts of programs and different ways of solving problems.

    Smith:

    As I understand the declarative languages, there has to

    be a mixture of imperative and descriptive statements or no com-

    putation will take place. If I give you a set of simultaneous equa-

    tions, you may say yes? , meaning well, what am I supposed to

    do about it, or you may say yes , meaning yes I underst and, but

    you don't do anything until I say now find the values of the vari-

    ables . In fact, in a well-developed language there is not just one

    question th at I can ask but a n umber of questions. So, in effect, the

    declarat ive sta tem ent s are like data which you set aside to be u~ed

    later after I give you the imperatives, of which I had a choice,

    which get the action.

    Strachey:

    This is a major poin t of confusion. There are two ideas

    here and I think we should try to sort them out. If you give a

    quadratic equation to a machine and then say print the value of

    x , this is not the sort of language that I call a DL. I regard it as

    an implicit language--that is, one where you give the machine the

    data and then hope that it will be smart enough to solve the prob-

    lem for you. It is very different from a language such as LisP,

    where you define a function explicitly and have only one impera-

    tive. which says evaluate this expression and print the result.

    Abrahams:

    I've clone a fair amount of programming in LisP,

    and there is one situat ion which I feel is sympt omat ic of the times

    when you really do want an imperative language. It is a situation

    tha t arises if you are planning to do programming in pure Lisp and

    you find that your functions accumulate a large number of argu-

    ments. This often happens when you have a nmnber of variables

    and you are actually going through a process and at each stage of

    the process you want to change the state of the world a little bit --

    say, to change one of these variables. So you have the choice of

    either trying to communicate them all, or trying to do some sort

    of essentially imperative action that changes one of them. If you

    try to list all of the transitions from state to stat e and incorporate

    them into one function, you'll find that this is not really a very

    natural kind of function because the natures of the transitions

    are too different.

    Volum e 9 / Numb er 3 / March , 1966 Commu nic ati ons of the ACM 1 6 5

  • 8/21/2019 Landin - The Next 700 Programming Languages (1966)

    10/10

    L a n d i n : I said in iny talk that LisP had not gone quite all the

    way and I think that this difficulty is connected with going all the

    way. If we write a function definition where the right- hand side is

    a listing of expressions such as

    F x ) = E 1 , E 2 , E ~

    thel~ we can say that this function will produce a three-list as its

    result. If llOW we have ~mother functio n

    G ( x ,

    y, z) = E, on some

    occasion we might have an expression such as

    G (a 2 , b 2 , c ~ )

    and we

    often feel that we should be able to write G ( F ( t ) ) , and ano ther

    example which should be allowed is

    G ( a > b -- ~ E 1 , E 2 , E 3 else E4 , E5 , E6).

    l am not quite sure but I think you can get around your problem

    by treating every function as if i t were in fact monadic and ha d

    a single argum ent which was the l ist struc ture you are tryi ng to

    process.

    A b r a h a m s :

    This is a difficulty in other progr ammi ng languages

    too; you can not define a function of an indefinite numbe r of argu-

    ments .

    N a u r :

    I s t i l l don ' t unders tand th is d is t inct ion about an im-

    plicit language. Does i t mean that whenever you have such a

    language there is a buil t-in feature for solving equations?

    A b r a h a m s : I think the point is whether you are concerned with

    the problem or are concerned with the method of solution of the

    problem.

    I n g e r m a n :

    I suggest tha t in the si tuatio n where you have speci-

    fied ever ything that you want to know, thoug h the exact sequence

    in which you evoke the various operations to cause the solution is

    left unspecified, then you have som eth ing which is effectively a

    descriptive language; if you have exactly the same pieces of in-

    format ion , surrounded wi th p romises tha t you wil l do th is and

    then th is , then you have an imperat ive language. The s ign i f icant

    point is that i t is not all or nothing but there is a scale and while

    it is probably pre tty simple to go all the way with imperative s,

    the chan ces of being ttble to get all the wa y descr iptive is abou t

    zero, but there is a settle and we should recognize this scale.

    S m i l h : I think that there is a confusion between implic