Paul Gauguin, 1898

26
Lisp Users Group - October 11, 1999 - Peter Nor Lisp: Where Do We Come From? What Are We? Where Are We Going? Peter Norvig NASA Ames Research Center Paul Gauguin, 1898

description

Lisp : Where Do We Come From? What Are We? Where Are We Going? Peter Norvig NASA Ames Research Center. Paul Gauguin, 1898. The answer is  (and the Y combinator). John McCarthy Notation, Functional Programming, Statements as Expressions, Incremental Compilation MIT/Stanford/CMU/Xerox - PowerPoint PPT Presentation

Transcript of Paul Gauguin, 1898

Page 1: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Lisp:Where Do We Come From?

What Are We? Where Are We Going?

Peter NorvigNASA Ames Research Center

Paul Gauguin, 1898

Page 2: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

The answer isThe answer is

(and the Y combinator)(and the Y combinator)

Page 3: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Where Do We Come From? Where Do We Come From? (1958-1989: the first 30 years)(1958-1989: the first 30 years)

• John McCarthy– Notation, Functional Programming, Statements as

Expressions, Incremental Compilation• MIT/Stanford/CMU/Xerox

– Language of choice for many elite programmers– Language of Artificial Intelligence

• Lisp Machines– Tool of choice; A religion?; Commercialization

• Lucid/Franz/Harlequin/Digitool/...– Many of benefits to stock HW (without religion)

Page 4: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

What Are We?What Are We?(1990s: the last ten years)(1990s: the last ten years)

Groups and Fields can be defined in terms of:

• Shared Community

• Shared Tools

• Shared Literature

• Ecological Niche

Page 5: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

We are a Shared CommunityWe are a Shared Community

But is the community healthy?• Defensive stance (like Apple or Linux)

– Minority, with some zealots, past-looking• Numbers holding steady(?)• But the world is consolidating on C++/Java

– See http://www.norvig.com/Lisp-retro.html– C++/Java way out in front– Lisp comparable to Perl on Books, Usenet, URLs– But Lisp far behind in Job postings

Page 6: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

We Have a Set of Shared ToolsWe Have a Set of Shared Tools

• Interactive RAD• Garbage Collection• Everything is an Object• Higher-order Functions• Emacs• Lisp Machines• Macros, Meta-Programming• Custom Small Languages• Generic Functions, Informal Interfaces• Mostly Functional Programming

Page 7: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Our Tools are “Under-Appreciated”Our Tools are “Under-Appreciated”

Six “Lasting Concepts” from tPoP:• Simplicity and Clarity L/J=2

• Generality L/J=1.5

• Evolution L/J=3

• Interfaces L/J=0.5

• Automation (under-appreciated) L/J=10

– (Programs writing other programs, tests, etc.)• Notation (under-appreciated) L/J=5

– (Little Languages)

Amazon.com rank: 2,481Mentions of Lisp: a few

Page 8: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

We Have a Shared LiteratureWe Have a Shared Literature

• Books, Web– Good choices

• Source Code– Lost LM code!!

• Journals and Magazines– Not influential

Page 9: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

We Inhabit an Ecological NicheWe Inhabit an Ecological Niche• Artificial Intelligence

– Recent competition from C++, Java, MATLAB, etc.

• “Solving the hard problems” – Very competitive niche

• RAD – Lisp is losing the high ground:

• CAD, Education• But …

– Lisp is the most adaptable language ever– The key to survival is to find a new niche– In 30 years Lisp will likely be ahead of C++/Java

(but behind something else) Amazon.com rank: 690Mentions of Lisp: 0

Page 10: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Where Are We Going?Where Are We Going?(the next 10 to 100 years)(the next 10 to 100 years)

• How to predict the future?– Look at published theories

• What niche can we inhabit?– Look at some new ones

Page 11: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Worse Is BetterWorse Is Better(Gabriel 1990)(Gabriel 1990)

• Simple is Better• First provide the right 50% capability• Users will grow it to 90%• Lisp: too “right thing,” CL too big,

Scheme too small, large entry barrier (50% of population below median)

• Prediction: Hard for Lisp to compete, even with “Win Big” strategy

Page 12: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Crossing the ChasmCrossing the Chasm(Moore 1991)(Moore 1991)

• Useful is Better• Early adopters don’t predict

mainstream adopters• Be useful in a vertical industry• Then move into the mainstream• Lisp as Tool: Too early-adopter• Prediction: Lisp can Help

companies cross (Viaweb)

Page 13: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Innovator’s DilemmaInnovator’s Dilemma(Christensen 1997)(Christensen 1997)

• Cheaper is Better• Innovation moves up from the

low end, often with new business model or manufacturing process

• The best companies can lead tech development, and still miss out

• Lisp Firms: overtaken by “inferior” C, etc.

Page 14: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Internet TimeInternet Time(eVeryone 1998)(eVeryone 1998)

• First is Better• Rush to market, get market share• Lisp: not keeping up• Prediction: need for premier

RAD tool; Lisp techniques could be part of solution

Page 15: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Where is Lisp Winning?Where is Lisp Winning?• NASA Remote Agent (and various rovers)• Yahoo Viaweb Shopping (Paul Graham)• Ascent Datamining Tool• Nichimen (nee Symbolics) Graphics Systems• AT&T, Lucent, other 24x7 telecom switches• NASA, Boeing, Airline planning/scheduling• Reasoning Systems Y2K program analysis tools• Prototyping by Wizards (many…)

Answer: Where There Are Lisp Programmers

Page 16: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Where Is Lisp Losing?Where Is Lisp Losing?• “ The worst thing we can do is to stand still as a community,

and that is what is happening.” - Richard Gabriel (in 1991, and since then?)

• “ Three strikes and you’re out” - Cordell Green (on Lisp+Unix+Category Theory)

• RAD development as good as Lisp– And better for traditional GUIs

• Standardization falling far behind– GUI, HTTP, TCP/IP, Threads, binaries

Answer: need a 10 or 100 breakthrough

Page 17: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

What Niche Can We Inhabit?What Niche Can We Inhabit?

The High Ground in 10 or 100 improvements

• Look at three possibilities

“We” means Lisp CommunityNot necessarily Lisp

Page 18: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

(1) First-class Design Patterns(1) First-class Design Patterns

• Design Patterns are hot– At least in bookstore; for actual production use???

• Design Patterns are:– Descriptions of what experienced designers know– Hints/reminders for choosing classes and methods– Higher-order abstractions for program organization– To discuss, weigh and record design tradeoffs – To avoid limitations of implementation language

• Lisp is the best host for first class patterns

Page 19: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

First-class Design Patterns:First-class Design Patterns:Levels of ImplementationLevels of Implementation

• InvisibleSo much a part of language that you don’t notice(e.g. when class replaced struct in C++, no more “Encapsulated Class” pattern)

• InformalDesign pattern in prose; refer to by name, butMust be implemented from scratch for each use

• FormalImplement pattern itself within the languageInstantiate/call it for each useUsually implemented with macros

Page 20: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Applying Lisp toApplying Lisp toDesign PatternsDesign Patterns

16 of 23 GOF patterns are either invisible or simpler:• First-class types (6): Abstract-Factory, Flyweight, Factory-Method, State, Proxy, Chain-Of-Responsibility

• First-class functions (4.5): Command, Strategy, Template-Method, Visitor, Iterator

• Macros (1.5): Interpreter, Iterator• Method Combination (2): Mediator, Observer• Multimethods (1): Builder • Modules (1): Facade

Page 21: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Constructing and DeconstructingConstructing and DeconstructingPrograms into PatternsPrograms into Patterns

Construction Grammar’s What’s X doing Y? construction

Page 22: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

(2) Adaptive, Teachable Systems(2) Adaptive, Teachable Systems

• Not enough programmers to go around– But many users, domain experts, critics

• Architect systems in which:– Programmers specify initial architecture, specs– Users say “good” or “bad” (reinforcement learning)

– Users can correct answers (supervised learning)

– Users can script new behavior, then improve– Program learns from many users (statistics)

– Programs have ontology of user goals, situations

Page 23: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Adaptable, Teachable Systems:Adaptable, Teachable Systems:Interfaces Interfaces vs.vs. Performance Performance

• Black Box:– Input/Output spec.– Can’t talk about performance

• Open Implementation:– Performance tweaking, T– Designer picks good tweaks

• Adaptive Software:– Performance feedback, F– Feedback informs tweaks

I O

T

F

I O

T

I O

Page 24: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

Adaptable, Teachable Systems:Adaptable, Teachable Systems:Decomposing Into the Right ComponentsDecomposing Into the Right Components

• Aspect-Oriented Programming– Deal with one aspect at a time (performance,

parallelism, replication, etc.)– http://www.parc.xerox.com/aop

• Subject-Oriented Programming– A subject is a collection of classes– http://www.research.ibm.com/sop

• Intentional Programming– Don’t bother with syntax; express intentions– http://www.research.microsoft.com/research/ip/

Page 25: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

(3) Self-verifying and Repairing Systems(3) Self-verifying and Repairing Systems

• Model Checking, other Formal Methods– Formally prove properties of program– Helps with concurrency, etc.

• Model-Based Reasoning– Say what there is, not how to do things with it– Separate reasoning engines for the what– Adaptive to changes in environment, system

Page 26: Paul Gauguin, 1898

Lisp Users Group - October 11, 1999 - Peter Norvig

ConclusionsConclusions

• Lisp has always allowed us to imagine the abstractions we want, and then build a program with them (see On Lisp)

• Now it is time to imagine the program development and use system we really want, and then evolve all our programs starting with it

• Even if the resulting system is not in Lisp, its users will essentially be Lisp Programmers