<<

Both!

Lisp Syntax

So, is (+ 1 2) a list of three things or code to add two numbers?

1 / 114 Lisp Syntax

So, is (+ 1 2) a list of three things or code to add two numbers?

Both!

2 / 114 Lisp

Program and data are identical in Lisp

3 / 114 Lisp programs can trivially manipulate other Lisp programs

. . . or even themselves

Lisp and interpreters are usually written in Lisp

In fact, in many Lisps there is a function called eval that takes some Lisp code (a list) and evaluates it

Lisp Syntax

This makes Lisp a particularly powerful language

4 / 114 . . . or even themselves

Lisp compilers and interpreters are usually written in Lisp

In fact, in many Lisps there is a function called eval that takes some Lisp code (a list) and evaluates it

Lisp Syntax

This makes Lisp a particularly powerful language

Lisp programs can trivially manipulate other Lisp programs

5 / 114 Lisp compilers and interpreters are usually written in Lisp

In fact, in many Lisps there is a function called eval that takes some Lisp code (a list) and evaluates it

Lisp Syntax

This makes Lisp a particularly powerful language

Lisp programs can trivially manipulate other Lisp programs

. . . or even themselves

6 / 114 In fact, in many Lisps there is a function called eval that takes some Lisp code (a list) and evaluates it

Lisp Syntax

This makes Lisp a particularly powerful language

Lisp programs can trivially manipulate other Lisp programs

. . . or even themselves

Lisp compilers and interpreters are usually written in Lisp

7 / 114 Lisp Syntax

This makes Lisp a particularly powerful language

Lisp programs can trivially manipulate other Lisp programs

. . . or even themselves

Lisp compilers and interpreters are usually written in Lisp

In fact, in many Lisps there is a function called eval that takes some Lisp code (a list) and evaluates it

8 / 114 Namely, read an expression, evaluate it, then print the result: often called a REP loop

Some Lisps do not allow user programs to run eval as there are some interesting issues that surround the function

Not least you can change or provide an alternative definition of eval

Lisp Syntax

When you use a Lisp it is essentially running this:

(print (eval (read))) in a loop

9 / 114 Some Lisps do not allow user programs to run eval as there are some interesting issues that surround the function

Not least you can change or provide an alternative definition of eval

Lisp Syntax

When you use a Lisp interpreter it is essentially running this:

(print (eval (read))) in a loop

Namely, read an expression, evaluate it, then print the result: often called a REP loop

10 / 114 Not least you can change or provide an alternative definition of eval

Lisp Syntax

When you use a Lisp interpreter it is essentially running this:

(print (eval (read))) in a loop

Namely, read an expression, evaluate it, then print the result: often called a REP loop

Some Lisps do not allow user programs to run eval as there are some interesting issues that surround the function

11 / 114 Lisp Syntax

When you use a Lisp interpreter it is essentially running this:

(print (eval (read))) in a loop

Namely, read an expression, evaluate it, then print the result: often called a REP loop

Some Lisps do not allow user programs to run eval as there are some interesting issues that surround the function

Not least you can change or provide an alternative definition of eval

12 / 114 As it runs

But don’! Most people have problems writing programs when they think they understand what an expression means: if that changes underfoot you have no chance

Lisp Syntax

Think about this: Lisp is a language that allows you to change the way it works

13 / 114 But don’t! Most people have problems writing programs when they think they understand what an expression means: if that changes underfoot you have no chance

Lisp Syntax

Think about this: Lisp is a language that allows you to change the way it works

As it runs

14 / 114 Lisp Syntax

Think about this: Lisp is a language that allows you to change the way it works

As it runs

But don’t! Most people have problems writing programs when they think they understand what an expression means: if that changes underfoot you have no chance

15 / 114 Some languages, e.g., ML and Lua, are fundamentally Lisp with an Algol syntax

The fact that most people don’t change Lisp is because the parenthesis syntax is actually quite useful

People do change eval to allow, say, the introduction of an OO system

Many ideas are first tried out in Lisp before being moved into a newly designed language

Lisp Syntax

You could even redefine read to allow a different syntax to Lisp: see Rlisp

16 / 114 The fact that most people don’t change Lisp is because the parenthesis syntax is actually quite useful

People do change eval to allow, say, the introduction of an OO system

Many ideas are first tried out in Lisp before being moved into a newly designed language

Lisp Syntax

You could even redefine read to allow a different syntax to Lisp: see Rlisp

Some languages, e.g., ML and Lua, are fundamentally Lisp with an Algol syntax

17 / 114 People do change eval to allow, say, the introduction of an OO system

Many ideas are first tried out in Lisp before being moved into a newly designed language

Lisp Syntax

You could even redefine read to allow a different syntax to Lisp: see Rlisp

Some languages, e.g., ML and Lua, are fundamentally Lisp with an Algol syntax

The fact that most people don’t change Lisp is because the parenthesis syntax is actually quite useful

18 / 114 Many ideas are first tried out in Lisp before being moved into a newly designed language

Lisp Syntax

You could even redefine read to allow a different syntax to Lisp: see Rlisp

Some languages, e.g., ML and Lua, are fundamentally Lisp with an Algol syntax

The fact that most people don’t change Lisp is because the parenthesis syntax is actually quite useful

People do change eval to allow, say, the introduction of an OO system

19 / 114 Lisp Syntax

You could even redefine read to allow a different syntax to Lisp: see Rlisp

Some languages, e.g., ML and Lua, are fundamentally Lisp with an Algol syntax

The fact that most people don’t change Lisp is because the parenthesis syntax is actually quite useful

People do change eval to allow, say, the introduction of an OO system

Many ideas are first tried out in Lisp before being moved into a newly designed language

20 / 114 It’s a matter of context: if you ask eval to evaluate it, it’s code; else it’s a list

Lisp Syntax

So (+ 1 2) is a list of three objects, that when given to the function eval it returns the value 3

21 / 114 Lisp Syntax

So (+ 1 2) is a list of three objects, that when given to the function eval it returns the value 3

It’s a matter of context: if you ask eval to evaluate it, it’s code; else it’s a list

22 / 114 There are a large number of languages out there that could be called “Lisp”

Generally “Lisp” is thought of a family, rather than a single thing

With and Java you know pretty well what you are getting: there are standards definitions that implementations of these languages are supposed to follow

With Lisp there’s all kinds of variation

Lisp Syntax

Another consequence of the malleability of Lisp is that everybody goes and makes their own version

23 / 114 Generally “Lisp” is thought of a family, rather than a single thing

With C and Java you know pretty well what you are getting: there are standards definitions that implementations of these languages are supposed to follow

With Lisp there’s all kinds of variation

Lisp Syntax

Another consequence of the malleability of Lisp is that everybody goes and makes their own version

There are a large number of languages out there that could be called “Lisp”

24 / 114 With C and Java you know pretty well what you are getting: there are standards definitions that implementations of these languages are supposed to follow

With Lisp there’s all kinds of variation

Lisp Syntax

Another consequence of the malleability of Lisp is that everybody goes and makes their own version

There are a large number of languages out there that could be called “Lisp”

Generally “Lisp” is thought of a family, rather than a single thing

25 / 114 With Lisp there’s all kinds of variation

Lisp Syntax

Another consequence of the malleability of Lisp is that everybody goes and makes their own version

There are a large number of languages out there that could be called “Lisp”

Generally “Lisp” is thought of a family, rather than a single thing

With C and Java you know pretty well what you are getting: there are standards definitions that implementations of these languages are supposed to follow

26 / 114 Lisp Syntax

Another consequence of the malleability of Lisp is that everybody goes and makes their own version

There are a large number of languages out there that could be called “Lisp”

Generally “Lisp” is thought of a family, rather than a single thing

With C and Java you know pretty well what you are getting: there are standards definitions that implementations of these languages are supposed to follow

With Lisp there’s all kinds of variation

27 / 114 Lambda Calculus Church 1930s AI Symbolic Algebra Lisp 1 McCarthy 1959 Lisp 2 (disaster)

Lisp 1.5 (1960) Xerox IBM (speed) (semantic BBN purity) Lisp 1.8+0.3i MIT ~1970 (closures) BBN Lisp InterLisp Stanford Lisp YKT Lisp MacLisp DEC10 Standard Lisp IBM 1968 Lisp/VM UCI/Rutgers Franz Spice NIL ZetaLisp Scheme Cambridge Lisp (lex) new implementation VLisp of Lisp Standard Lisp 1976 Cambridge Lisp ( D A P A ) LeLisp (Bath/Cambridge) PSL n R Scheme CPSL Book 1 (lex, closures) (closures) (lex, closures) CSL etc. Lucid KCL Allegro EuLisp 1990 ISLisp CL, book 2, 1990 (lex, closures) 1997 (lex, closures)

28 / 114 In Cambridge Lisp the function to add numbers is called plus; in Common Lisp it is called +

(plus 1 2) vs. (+ 1 2)

These are superficial differences

Lisp Diaspora

Each Lisp does everything in its own special way

29 / 114 These are superficial differences

Lisp Diaspora

Each Lisp does everything in its own special way

In Cambridge Lisp the function to add numbers is called plus; in Common Lisp it is called +

(plus 1 2) vs. (+ 1 2)

30 / 114 Lisp Diaspora

Each Lisp does everything in its own special way

In Cambridge Lisp the function to add numbers is called plus; in Common Lisp it is called +

(plus 1 2) vs. (+ 1 2)

These are superficial differences

31 / 114 Or it might require it

(if (> x 1) (print "hello") (print "bye"))

and provide an alternative, single clause “if”

(when (> x 1) (print "hello"))

And so on

Lisp Diaspora

The “if” construct might have an optional “else” part:

(if (> x 1) (print "hello"))

32 / 114 And so on

Lisp Diaspora

The “if” construct might have an optional “else” part:

(if (> x 1) (print "hello"))

Or it might require it

(if (> x 1) (print "hello") (print "bye")) and provide an alternative, single clause “if”

(when (> x 1) (print "hello"))

33 / 114 Lisp Diaspora

The “if” construct might have an optional “else” part:

(if (> x 1) (print "hello"))

Or it might require it

(if (> x 1) (print "hello") (print "bye")) and provide an alternative, single clause “if”

(when (> x 1) (print "hello"))

And so on

34 / 114 Though they don’t have to. . .

This makes portability of programs an issue, but has helped immensely in the development of new ideas

Lisp has been called a “ball of mud”, meaning you can throw anything at it—and you just get a larger ball of mud

Lisps come in all kinds of shapes and sizes: but they are all Lisps

Lisp Diaspora

The of everything is roughly the same, so generally things do what you expect of them

35 / 114 This makes portability of programs an issue, but has helped immensely in the development of new ideas

Lisp has been called a “ball of mud”, meaning you can throw anything at it—and you just get a larger ball of mud

Lisps come in all kinds of shapes and sizes: but they are all Lisps

Lisp Diaspora

The semantics of everything is roughly the same, so generally things do what you expect of them

Though they don’t have to. . .

36 / 114 Lisp has been called a “ball of mud”, meaning you can throw anything at it—and you just get a larger ball of mud

Lisps come in all kinds of shapes and sizes: but they are all Lisps

Lisp Diaspora

The semantics of everything is roughly the same, so generally things do what you expect of them

Though they don’t have to. . .

This makes portability of programs an issue, but has helped immensely in the development of new ideas

37 / 114 Lisps come in all kinds of shapes and sizes: but they are all Lisps

Lisp Diaspora

The semantics of everything is roughly the same, so generally things do what you expect of them

Though they don’t have to. . .

This makes portability of programs an issue, but has helped immensely in the development of new ideas

Lisp has been called a “ball of mud”, meaning you can throw anything at it—and you just get a larger ball of mud

38 / 114 Lisp Diaspora

The semantics of everything is roughly the same, so generally things do what you expect of them

Though they don’t have to. . .

This makes portability of programs an issue, but has helped immensely in the development of new ideas

Lisp has been called a “ball of mud”, meaning you can throw anything at it—and you just get a larger ball of mud

Lisps come in all kinds of shapes and sizes: but they are all Lisps

39 / 114 The two widely used ones are

• Common Lisp • Scheme

Lisp Standards

There are in fact more than a few standards for Lisp

40 / 114 Lisp Standards

There are in fact more than a few standards for Lisp

The two widely used ones are

• Common Lisp • Scheme

41 / 114 It arose when the US defence research agency ARPA wanted a single Lisp it could use

At the time there were many Lisps floating about and ARPA wanted a single standard it could write programs for

Many Lisp implementors and vendors were called together to create a standard

After a huge amount of wrangling, Common Lisp emerged

Roughly speaking, Common Lisp is the union of all the features of all the Lisps: no vendor wanted their special features to be left out

Lisp Standards Common Lisp is a large standard describing a huge Lisp

42 / 114 At the time there were many Lisps floating about and ARPA wanted a single standard it could write programs for

Many Lisp implementors and vendors were called together to create a standard

After a huge amount of wrangling, Common Lisp emerged

Roughly speaking, Common Lisp is the union of all the features of all the Lisps: no vendor wanted their special features to be left out

Lisp Standards Common Lisp is a large standard describing a huge Lisp

It arose when the US defence research agency ARPA wanted a single Lisp it could use

43 / 114 Many Lisp implementors and vendors were called together to create a standard

After a huge amount of wrangling, Common Lisp emerged

Roughly speaking, Common Lisp is the union of all the features of all the Lisps: no vendor wanted their special features to be left out

Lisp Standards Common Lisp is a large standard describing a huge Lisp

It arose when the US defence research agency ARPA wanted a single Lisp it could use

At the time there were many Lisps floating about and ARPA wanted a single standard it could write programs for

44 / 114 After a huge amount of wrangling, Common Lisp emerged

Roughly speaking, Common Lisp is the union of all the features of all the Lisps: no vendor wanted their special features to be left out

Lisp Standards Common Lisp is a large standard describing a huge Lisp

It arose when the US defence research agency ARPA wanted a single Lisp it could use

At the time there were many Lisps floating about and ARPA wanted a single standard it could write programs for

Many Lisp implementors and vendors were called together to create a standard

45 / 114 Roughly speaking, Common Lisp is the union of all the features of all the Lisps: no vendor wanted their special features to be left out

Lisp Standards Common Lisp is a large standard describing a huge Lisp

It arose when the US defence research agency ARPA wanted a single Lisp it could use

At the time there were many Lisps floating about and ARPA wanted a single standard it could write programs for

Many Lisp implementors and vendors were called together to create a standard

After a huge amount of wrangling, Common Lisp emerged

46 / 114 Lisp Standards Common Lisp is a large standard describing a huge Lisp

It arose when the US defence research agency ARPA wanted a single Lisp it could use

At the time there were many Lisps floating about and ARPA wanted a single standard it could write programs for

Many Lisp implementors and vendors were called together to create a standard

After a huge amount of wrangling, Common Lisp emerged

Roughly speaking, Common Lisp is the union of all the features of all the Lisps: no vendor wanted their special features to be left out

47 / 114 They do different things to the list: one updates the list to remove the element; the other creates a new list that is a copy without the element

So Common Lisp provides a rich array of functionality

This was version 1, as documented in the book “Common Lisp: The Language” (CLtL1)

Lisp Standards

So, for example, there are two functions to remove an element from a list: delete and remove

48 / 114 So Common Lisp provides a rich array of functionality

This was version 1, as documented in the book “Common Lisp: The Language” (CLtL1)

Lisp Standards

So, for example, there are two functions to remove an element from a list: delete and remove

They do different things to the list: one updates the list to remove the element; the other creates a new list that is a copy without the element

49 / 114 This was version 1, as documented in the book “Common Lisp: The Language” (CLtL1)

Lisp Standards

So, for example, there are two functions to remove an element from a list: delete and remove

They do different things to the list: one updates the list to remove the element; the other creates a new list that is a copy without the element

So Common Lisp provides a rich array of functionality

50 / 114 Lisp Standards

So, for example, there are two functions to remove an element from a list: delete and remove

They do different things to the list: one updates the list to remove the element; the other creates a new list that is a copy without the element

So Common Lisp provides a rich array of functionality

This was version 1, as documented in the book “Common Lisp: The Language” (CLtL1)

51 / 114 This became an ANSI standard: X3.226-1994 (R1999)

This is reasonably decent as a standard, but is huge at over 1000 pages

A large chunk of this a list of functions and their required behaviours (like delete and remove)

But there is important stuff in there, too, such as the specification of the behaviour of functions over the Complex numbers

The Java standard is now larger. . .

Lisp Standards After more work, version 2 emerged, “Common Lisp: The Language, Second Edition” (CLtL2)

52 / 114 This is reasonably decent as a standard, but is huge at over 1000 pages

A large chunk of this a list of functions and their required behaviours (like delete and remove)

But there is important stuff in there, too, such as the specification of the behaviour of functions over the Complex numbers

The Java standard is now larger. . .

Lisp Standards After more work, version 2 emerged, “Common Lisp: The Language, Second Edition” (CLtL2)

This became an ANSI standard: X3.226-1994 (R1999)

53 / 114 A large chunk of this a list of functions and their required behaviours (like delete and remove)

But there is important stuff in there, too, such as the specification of the behaviour of functions over the Complex numbers

The Java standard is now larger. . .

Lisp Standards After more work, version 2 emerged, “Common Lisp: The Language, Second Edition” (CLtL2)

This became an ANSI standard: X3.226-1994 (R1999)

This is reasonably decent as a standard, but is huge at over 1000 pages

54 / 114 But there is important stuff in there, too, such as the specification of the behaviour of functions over the Complex numbers

The Java standard is now larger. . .

Lisp Standards After more work, version 2 emerged, “Common Lisp: The Language, Second Edition” (CLtL2)

This became an ANSI standard: X3.226-1994 (R1999)

This is reasonably decent as a standard, but is huge at over 1000 pages

A large chunk of this a list of functions and their required behaviours (like delete and remove)

55 / 114 The Java standard is now larger. . .

Lisp Standards After more work, version 2 emerged, “Common Lisp: The Language, Second Edition” (CLtL2)

This became an ANSI standard: X3.226-1994 (R1999)

This is reasonably decent as a standard, but is huge at over 1000 pages

A large chunk of this a list of functions and their required behaviours (like delete and remove)

But there is important stuff in there, too, such as the specification of the behaviour of functions over the Complex numbers

56 / 114 Lisp Standards After more work, version 2 emerged, “Common Lisp: The Language, Second Edition” (CLtL2)

This became an ANSI standard: X3.226-1994 (R1999)

This is reasonably decent as a standard, but is huge at over 1000 pages

A large chunk of this a list of functions and their required behaviours (like delete and remove)

But there is important stuff in there, too, such as the specification of the behaviour of functions over the Complex numbers

The Java standard is now larger. . .

57 / 114 They defined Scheme in a document called “The Report on Scheme”

Roughly, this was the intersection of all current Lisps

Schemers claim Scheme is not Lisp, but it is certainly of the family

To be included in Scheme, a feature must be essential and not implementable in terms of existing features

Lisp Standards

Meanwhile other people (mostly academics) were saying: this is too big, what we need is simplicity

58 / 114 Roughly, this was the intersection of all current Lisps

Schemers claim Scheme is not Lisp, but it is certainly of the family

To be included in Scheme, a feature must be essential and not implementable in terms of existing features

Lisp Standards

Meanwhile other people (mostly academics) were saying: this is too big, what we need is simplicity

They defined Scheme in a document called “The Report on Scheme”

59 / 114 Schemers claim Scheme is not Lisp, but it is certainly of the family

To be included in Scheme, a feature must be essential and not implementable in terms of existing features

Lisp Standards

Meanwhile other people (mostly academics) were saying: this is too big, what we need is simplicity

They defined Scheme in a document called “The Report on Scheme”

Roughly, this was the intersection of all current Lisps

60 / 114 To be included in Scheme, a feature must be essential and not implementable in terms of existing features

Lisp Standards

Meanwhile other people (mostly academics) were saying: this is too big, what we need is simplicity

They defined Scheme in a document called “The Report on Scheme”

Roughly, this was the intersection of all current Lisps

Schemers claim Scheme is not Lisp, but it is certainly of the family

61 / 114 Lisp Standards

Meanwhile other people (mostly academics) were saying: this is too big, what we need is simplicity

They defined Scheme in a document called “The Report on Scheme”

Roughly, this was the intersection of all current Lisps

Schemers claim Scheme is not Lisp, but it is certainly of the family

To be included in Scheme, a feature must be essential and not implementable in terms of existing features

62 / 114 Then to “The Revised Revised Report on Scheme”, or R2RS

And so on

R5RS is just 50 pages long

R6RS includes (not to universal acclaim) specifications of functions, so is longer, but the basic language part is just 90 pages long

Lisp Standards

The Scheme standard was revised: called “The Revised Report on Scheme”

63 / 114 And so on

R5RS is just 50 pages long

R6RS includes (not to universal acclaim) specifications of library functions, so is longer, but the basic language part is just 90 pages long

Lisp Standards

The Scheme standard was revised: called “The Revised Report on Scheme”

Then to “The Revised Revised Report on Scheme”, or R2RS

64 / 114 R5RS is just 50 pages long

R6RS includes (not to universal acclaim) specifications of library functions, so is longer, but the basic language part is just 90 pages long

Lisp Standards

The Scheme standard was revised: called “The Revised Report on Scheme”

Then to “The Revised Revised Report on Scheme”, or R2RS

And so on

65 / 114 R6RS includes (not to universal acclaim) specifications of library functions, so is longer, but the basic language part is just 90 pages long

Lisp Standards

The Scheme standard was revised: called “The Revised Report on Scheme”

Then to “The Revised Revised Report on Scheme”, or R2RS

And so on

R5RS is just 50 pages long

66 / 114 Lisp Standards

The Scheme standard was revised: called “The Revised Report on Scheme”

Then to “The Revised Revised Report on Scheme”, or R2RS

And so on

R5RS is just 50 pages long

R6RS includes (not to universal acclaim) specifications of library functions, so is longer, but the basic language part is just 90 pages long

67 / 114 The small part much closer to R5RS (88 pages)

The large is “focused on the practical needs of mainstream development”, and is closer to R6RS

Lisp Standards

R7RS (2013) has split the language into chunks, “large” and “small”

68 / 114 The large is “focused on the practical needs of mainstream ”, and is closer to R6RS

Lisp Standards

R7RS (2013) has split the language into chunks, “large” and “small”

The small part much closer to R5RS (88 pages)

69 / 114 Lisp Standards

R7RS (2013) has split the language into chunks, “large” and “small”

The small part much closer to R5RS (88 pages)

The large is “focused on the practical needs of mainstream software development”, and is closer to R6RS

70 / 114 For example,

A is a generalisation of the idea of “current execution position in the program”

In Scheme, a continuation is a first class object, meaning a program can manipulate its own flow of control programmatically

Lisp Standards

Scheme is characterised by having few, but powerful, constructs

71 / 114 A continuation is a generalisation of the idea of “current execution position in the program”

In Scheme, a continuation is a first class object, meaning a program can manipulate its own flow of control programmatically

Lisp Standards

Scheme is characterised by having few, but powerful, constructs

For example, continuations

72 / 114 In Scheme, a continuation is a first class object, meaning a program can manipulate its own flow of control programmatically

Lisp Standards

Scheme is characterised by having few, but powerful, constructs

For example, continuations

A continuation is a generalisation of the idea of “current execution position in the program”

73 / 114 Lisp Standards

Scheme is characterised by having few, but powerful, constructs

For example, continuations

A continuation is a generalisation of the idea of “current execution position in the program”

In Scheme, a continuation is a first class object, meaning a program can manipulate its own flow of control programmatically

74 / 114 But the idea is that continuations replace a collection of other concepts; and allow the implementation of new and different concepts

Lisp Standards

Continuations can be used to implement other, more understandable, things, like non-local jumps and parallel execution

75 / 114 Lisp Standards

Continuations can be used to implement other, more understandable, things, like non-local jumps and parallel execution

But the idea is that continuations replace a collection of other concepts; and allow the implementation of new and different concepts

76 / 114 It is also sophisticated enough to be used to explain some very difficult topics

The book “Structure and Interpretation of Computer Programs” by Abelson and Sussman should be read by all Computer Scientists

Lisp Standards

Scheme is simple enough to be used as an introductory language in some University courses

77 / 114 The book “Structure and Interpretation of Computer Programs” by Abelson and Sussman should be read by all Computer Scientists

Lisp Standards

Scheme is simple enough to be used as an introductory language in some University courses

It is also sophisticated enough to be used to explain some very difficult topics

78 / 114 Lisp Standards

Scheme is simple enough to be used as an introductory language in some University courses

It is also sophisticated enough to be used to explain some very difficult topics

The book “Structure and Interpretation of Computer Programs” by Abelson and Sussman should be read by all Computer Scientists

79 / 114 A standard is a document that describes how an implementation should behave

An implementation is a program, usually a or an interpreter

There can be several, differing, implementations of a standard

Just as there are many C compilers and a few Java compilers, there are many different implementations of Common Lisp and Scheme

Lisp Standards

At this point is it worthwhile making clear the difference between implementations and standards, as they are often confused for one another

80 / 114 An implementation is a program, usually a compiler or an interpreter

There can be several, differing, implementations of a standard

Just as there are many C compilers and a few Java compilers, there are many different implementations of Common Lisp and Scheme

Lisp Standards

At this point is it worthwhile making clear the difference between implementations and standards, as they are often confused for one another

A standard is a document that describes how an implementation should behave

81 / 114 There can be several, differing, implementations of a standard

Just as there are many C compilers and a few Java compilers, there are many different implementations of Common Lisp and Scheme

Lisp Standards

At this point is it worthwhile making clear the difference between implementations and standards, as they are often confused for one another

A standard is a document that describes how an implementation should behave

An implementation is a program, usually a compiler or an interpreter

82 / 114 Just as there are many C compilers and a few Java compilers, there are many different implementations of Common Lisp and Scheme

Lisp Standards

At this point is it worthwhile making clear the difference between implementations and standards, as they are often confused for one another

A standard is a document that describes how an implementation should behave

An implementation is a program, usually a compiler or an interpreter

There can be several, differing, implementations of a standard

83 / 114 Lisp Standards

At this point is it worthwhile making clear the difference between implementations and standards, as they are often confused for one another

A standard is a document that describes how an implementation should behave

An implementation is a program, usually a compiler or an interpreter

There can be several, differing, implementations of a standard

Just as there are many C compilers and a few Java compilers, there are many different implementations of Common Lisp and Scheme

84 / 114 Reality is never so neat

Lisp Standards

A program written to run in one implementation of, say, Common Lisp, ought to run on all other implementations of Common Lisp

85 / 114 Lisp Standards

A program written to run in one implementation of, say, Common Lisp, ought to run on all other implementations of Common Lisp

Reality is never so neat

86 / 114 • bugs in the implementation • bugs in the standard • things not defined or not clear in the standard • things deliberately left undefined in the standard (e.g., size of an int in C. A portable program will not make the assumption that an int is 4 bytes) • deliberate features in the implementation designed for lock-in by the vendor

Lisp Standards

There might be

87 / 114 • bugs in the standard • things not defined or not clear in the standard • things deliberately left undefined in the standard (e.g., size of an int in C. A portable program will not make the assumption that an int is 4 bytes) • deliberate features in the implementation designed for lock-in by the vendor

Lisp Standards

There might be

• bugs in the implementation

88 / 114 • things not defined or not clear in the standard • things deliberately left undefined in the standard (e.g., size of an int in C. A portable program will not make the assumption that an int is 4 bytes) • deliberate features in the implementation designed for lock-in by the vendor

Lisp Standards

There might be

• bugs in the implementation • bugs in the standard

89 / 114 • things deliberately left undefined in the standard (e.g., size of an int in C. A portable program will not make the assumption that an int is 4 bytes) • deliberate features in the implementation designed for lock-in by the vendor

Lisp Standards

There might be

• bugs in the implementation • bugs in the standard • things not defined or not clear in the standard

90 / 114 • deliberate features in the implementation designed for lock-in by the vendor

Lisp Standards

There might be

• bugs in the implementation • bugs in the standard • things not defined or not clear in the standard • things deliberately left undefined in the standard (e.g., size of an int in C. A portable program will not make the assumption that an int is 4 bytes)

91 / 114 Lisp Standards

There might be

• bugs in the implementation • bugs in the standard • things not defined or not clear in the standard • things deliberately left undefined in the standard (e.g., size of an int in C. A portable program will not make the assumption that an int is 4 bytes) • deliberate features in the implementation designed for lock-in by the vendor

92 / 114 And this applies to all languages, particularly C

Lisp Standards

All meaning that you have to be careful when porting a program to a new implementation

93 / 114 Lisp Standards

All meaning that you have to be careful when porting a program to a new implementation

And this applies to all languages, particularly C

94 / 114 Many day-to-day useful things are deliberately left out of Scheme, though R6 and R7 try to address this issue

In response, there is a middle-sized Lisp, EuLisp

In fact, EuLisp comes in three sizes

1. Small, Scheme sized 2. Medium 3. Large, but not as big as Common Lisp

Each Level is a subset of the next, so we can pick the size we need

Lisp Standards If Common Lisp is too large, Scheme is too small

95 / 114 In response, there is a middle-sized Lisp, EuLisp

In fact, EuLisp comes in three sizes

1. Small, Scheme sized 2. Medium 3. Large, but not as big as Common Lisp

Each Level is a subset of the next, so we can pick the size we need

Lisp Standards If Common Lisp is too large, Scheme is too small

Many day-to-day useful things are deliberately left out of Scheme, though R6 and R7 try to address this issue

96 / 114 In fact, EuLisp comes in three sizes

1. Small, Scheme sized 2. Medium 3. Large, but not as big as Common Lisp

Each Level is a subset of the next, so we can pick the size we need

Lisp Standards If Common Lisp is too large, Scheme is too small

Many day-to-day useful things are deliberately left out of Scheme, though R6 and R7 try to address this issue

In response, there is a middle-sized Lisp, EuLisp

97 / 114 1. Small, Scheme sized 2. Medium 3. Large, but not as big as Common Lisp

Each Level is a subset of the next, so we can pick the size we need

Lisp Standards If Common Lisp is too large, Scheme is too small

Many day-to-day useful things are deliberately left out of Scheme, though R6 and R7 try to address this issue

In response, there is a middle-sized Lisp, EuLisp

In fact, EuLisp comes in three sizes

98 / 114 2. Medium 3. Large, but not as big as Common Lisp

Each Level is a subset of the next, so we can pick the size we need

Lisp Standards If Common Lisp is too large, Scheme is too small

Many day-to-day useful things are deliberately left out of Scheme, though R6 and R7 try to address this issue

In response, there is a middle-sized Lisp, EuLisp

In fact, EuLisp comes in three sizes

1. Small, Scheme sized

99 / 114 3. Large, but not as big as Common Lisp

Each Level is a subset of the next, so we can pick the size we need

Lisp Standards If Common Lisp is too large, Scheme is too small

Many day-to-day useful things are deliberately left out of Scheme, though R6 and R7 try to address this issue

In response, there is a middle-sized Lisp, EuLisp

In fact, EuLisp comes in three sizes

1. Small, Scheme sized 2. Medium

100 / 114 Each Level is a subset of the next, so we can pick the size we need

Lisp Standards If Common Lisp is too large, Scheme is too small

Many day-to-day useful things are deliberately left out of Scheme, though R6 and R7 try to address this issue

In response, there is a middle-sized Lisp, EuLisp

In fact, EuLisp comes in three sizes

1. Small, Scheme sized 2. Medium 3. Large, but not as big as Common Lisp

101 / 114 Lisp Standards If Common Lisp is too large, Scheme is too small

Many day-to-day useful things are deliberately left out of Scheme, though R6 and R7 try to address this issue

In response, there is a middle-sized Lisp, EuLisp

In fact, EuLisp comes in three sizes

1. Small, Scheme sized 2. Medium 3. Large, but not as big as Common Lisp

Each Level is a subset of the next, so we can pick the size we need

102 / 114 We at Bath were strongly involved in this standard

The EU eventually lost interest, so the standard has not gained popularity

The standard lives in a modified form as ISLisp, ISO standard ISO/IEC 13816:1997(E)

Lisp Standards

It is called “Eu”Lisp as its design was sponsored by the EU

103 / 114 The EU eventually lost interest, so the standard has not gained popularity

The standard lives in a modified form as ISLisp, ISO standard ISO/IEC 13816:1997(E)

Lisp Standards

It is called “Eu”Lisp as its design was sponsored by the EU

We at Bath were strongly involved in this standard

104 / 114 The standard lives in a modified form as ISLisp, ISO standard ISO/IEC 13816:1997(E)

Lisp Standards

It is called “Eu”Lisp as its design was sponsored by the EU

We at Bath were strongly involved in this standard

The EU eventually lost interest, so the standard has not gained popularity

105 / 114 Lisp Standards

It is called “Eu”Lisp as its design was sponsored by the EU

We at Bath were strongly involved in this standard

The EU eventually lost interest, so the standard has not gained popularity

The standard lives in a modified form as ISLisp, ISO standard ISO/IEC 13816:1997(E)

106 / 114 Dylan was eventually dropped by Apple, but provided impetus to the development of a new language, called Java

Lisp Standards

EuLisp strongly influenced a language called Dylan, developed by Apple

107 / 114 Lisp Standards

EuLisp strongly influenced a language called Dylan, developed by Apple

Dylan was eventually dropped by Apple, but provided impetus to the development of a new language, called Java

108 / 114 This was a standard defined with the intention that applications sticking to this standard (e.g., Algebra Systems) could be ported easily between Lisps

This left contentious elements undefined, e.g., some specific properties of the empty list

This meant couldn’t rely on having such properties and so had to avoid using them

Thus making their programs more portable

Standard Lisp was eventually eclipsed by Common Lisp

Lisp Standards

You will also come across something called Standard Lisp

109 / 114 This left contentious elements undefined, e.g., some specific properties of the empty list

This meant programmers couldn’t rely on having such properties and so had to avoid using them

Thus making their programs more portable

Standard Lisp was eventually eclipsed by Common Lisp

Lisp Standards

You will also come across something called Standard Lisp

This was a standard defined with the intention that applications sticking to this standard (e.g., Algebra Systems) could be ported easily between Lisps

110 / 114 This meant programmers couldn’t rely on having such properties and so had to avoid using them

Thus making their programs more portable

Standard Lisp was eventually eclipsed by Common Lisp

Lisp Standards

You will also come across something called Standard Lisp

This was a standard defined with the intention that applications sticking to this standard (e.g., Algebra Systems) could be ported easily between Lisps

This left contentious elements undefined, e.g., some specific properties of the empty list

111 / 114 Thus making their programs more portable

Standard Lisp was eventually eclipsed by Common Lisp

Lisp Standards

You will also come across something called Standard Lisp

This was a standard defined with the intention that applications sticking to this standard (e.g., Algebra Systems) could be ported easily between Lisps

This left contentious elements undefined, e.g., some specific properties of the empty list

This meant programmers couldn’t rely on having such properties and so had to avoid using them

112 / 114 Standard Lisp was eventually eclipsed by Common Lisp

Lisp Standards

You will also come across something called Standard Lisp

This was a standard defined with the intention that applications sticking to this standard (e.g., Algebra Systems) could be ported easily between Lisps

This left contentious elements undefined, e.g., some specific properties of the empty list

This meant programmers couldn’t rely on having such properties and so had to avoid using them

Thus making their programs more portable

113 / 114 Lisp Standards

You will also come across something called Standard Lisp

This was a standard defined with the intention that applications sticking to this standard (e.g., Algebra Systems) could be ported easily between Lisps

This left contentious elements undefined, e.g., some specific properties of the empty list

This meant programmers couldn’t rely on having such properties and so had to avoid using them

Thus making their programs more portable

Standard Lisp was eventually eclipsed by Common Lisp

114 / 114