您的当前位置:首页正文

Worse Is Better

2023-09-17 来源:客趣旅游网
Worse Is Betterhttp://dreamsongs.com/WIB.html

Lisp: Good News, Bad News, How to Win

Big

Richard P. Gabriel

Lucid, Inc

This article was originally published in 1991.

Abstract

Lisp has done quite well over the last ten years: becoming nearly standardized, forming the basis ofa commercial sector, achieving excellent performance, having good environments, able to deliverapplications. Yet the Lisp community has failed to do as well as it could have. In this paper I look atthe successes, the failures, and what to do next.

The Lisp world is in great shape: Ten years ago there was no standard Lisp; the most standard Lispwas InterLisp, which ran on PDP-10s and Xerox Lisp machines (some said it ran on Vaxes, but Ithink they exaggerated); the second most standard Lisp was MacLisp, which ran only on PDP-10s,but under the three most popular operating systems for that machine; the third most standard Lispwas Portable Standard Lisp, which ran on many machines, but very few people wanted to use it; thefourth most standard Lisp was Zetalisp, which ran on two varieties of Lisp machine; and the fifthmost standard Lisp was Scheme, which ran on a few different kinds of machine, but very fewpeople wanted to use it. By today’s standards, each of these had poor or just barely acceptableperformance, nonexistent or just barely satisfactory environments, nonexistent or poor integrationwith other languages and software, poor portability, poor acceptance, and poor commercialprospects.

Today there is Common Lisp (CL), which runs on all major machines, all major operating systems,and virtually in every country. Common Lisp is about to be standardized by ANSI, has goodperformance, is surrounded with good environments, and has good integration with otherlanguages and software.

But, as a business, Lisp is considered to be in ill health. There are persistent and sometimes truerumors about the abandonment of Lisp as a vehicle for delivery of practical applications.

To some extent the problem is one of perception -- there are simply better Lisp delivery solutionsthan are generally believed to exist and to a disturbing extent the problem is one of unplaced ormisplaced resources, of projects not undertaken, and of implementation strategies not activated.Part of the problem stems from our very dear friends in the artificial intelligence (AI) business. AIhas a number of good approaches to formalizing human knowledge and problem solving behavior.However, AI does not provide a panacea in any area of its applicability. Some early promoters of AIto the commercial world raised expectation levels too high. These expectations had to do with theeffectiveness and deliverability of expert-system-based applications.

When these expectations were not met, some looked for scapegoats, which frequently were the Lispcompanies, particularly when it came to deliverability. Of course, if the AI companies had anynotion about what the market would eventually expect from delivered AI software, they nevershared it with any Lisp companies I know about. I believe the attitude of the AI companies was thatthe Lisp companies will do what they need to survive, so why share customer lists and informationwith them?

Another part of the problem is the relatively bad press Lisp got, sometimes from very respectablepublications. I saw an article in Forbes (October 16, 1989) entitled Where Lisp Slipped by JuliePitta. However, the article was about Symbolics and its fortunes. The largest criticisms ofSymbolics in the article are that Symbolics believed AI would take off and that Symbolics

1 of 122011/3/2 0:53

Worse Is Betterhttp://dreamsongs.com/WIB.html

mistakenly pushed its view that proprietary hardware was the way to go for AI. There was nothingabout Lisp in the article except the statement that it is a somewhat obscure programminglanguage used extensively in artificial intelligence.

It seems a pity for the Lisp business to take a bump partly because Julie thought she could make acute title for her article out of the name Lisp.

But, there are some real successes for Lisp, some problems, and some ways out of those problems.

1 Lisp’s Successes

As I mentioned, Lisp is in better shape today than it ever has been. I want to review some Lispsuccess stories.

1.1 Standardization

A major success is that there is a standard Lisp -- Common Lisp. Many observers today wish therewere a simpler, smaller, cleaner Lisp that could be standardized, but the Lisp that we have todaythat is ready for standardization is Common Lisp. This isn’t to say that a better Lisp could not bestandardized later, and certainly there should be. Furthermore, like any language, Common Lispshould be improved and changed as needs change.

Common Lisp started as a grassroots effort in 1981 after an ARPA-sponsored meeting held at SRIto determine the future of Lisp. At that time there were a number of Lisps in the US being definedand implemented by former MIT folks: Greenblatt (LMI), Moon and Weinreb (Symbolics),Fahlman and Steele (CMU), White (MIT), and Gabriel and Steele (LLNL). The core of the CommonLisp committee came from this group. That core was Fahlman, Gabriel, Moon, Steele, andWeinreb, and Common Lisp was a coalescence of the Lisps these people cared about.

There were other Lisps that could have blended into Common Lisp, but they were not so clearly inthe MacLisp tradition, and their proponents declined to actively participate in the effort becausethey predicted success for their own dialects over any common lisp that was defined by thegrassroots effort. Among these Lisps were Scheme, Interlisp, Franz Lisp, Portable Standard Lisp,and Lisp370.

And outside the US there were major Lisp efforts, including Cambridge Lisp and Le-Lisp. Thehumble US grassroots effort did not seek membership from outside the US, and one can safelyregard that as a mistake. Frankly, it never occurred to the Common Lisp group that this purelyAmerican effort would be of interest outside the US, because very few of the group saw a future inAI that would extend the needs for a standard Lisp beyond North America.

Common Lisp was defined and a book published in 1984 called /Common Lisp: the Language/(CLtL). And several companies sprang up to put Common Lisp on stock hardware to competeagainst the Lisp machine companies. Within four years, virtually every major computer companyhad a Common Lisp that it had either implemented itself or private-labeled from a Common Lispcompany.

In 1986, X3J13 was formed to produce an ANSI version of Common Lisp. By then it was apparentthat there were significant changes required to Common Lisp to clean up ambiguities andomissions, to add a condition system, and to define object-oriented extensions.

After several years it became clear that the process of standardization was not simple, even given amature language with a good definition. The specification of the Common Lisp Object System(CLOS) alone took nearly two years and seven of the most talented members of X3J13.

It also became apparent that the interest in international Lisp standardization was growing. Butthere was no heir apparent to Common Lisp. Critics of Common Lisp, especially those outside theUS, focused on Common Lisp’s failures as a practical delivery vehicle.

In 1988, an international working group for the standardization of Lisp was formed. That group iscalled WG16. Two things are absolutely clear: The near-term standard Lisp is Common Lisp; alonger-term standard that goes beyond Common Lisp is desirable.

In 1988, the IEEE Scheme working group was formed to produce an IEEE and possibly an ANSIstandard for Scheme. This group completed its work in 1990, and the relatively small and cleanScheme is a standard.

2 of 122011/3/2 0:53

Worse Is Betterhttp://dreamsongs.com/WIB.html

Currently, X3J13 is less than a year away from a draft standard for ANSI Common Lisp; WG16 isstalled because of international bickering; Scheme has been standardized by IEEE, but it is oflimited commercial interest.

Common Lisp is in use internationally, and serves at least as a de facto standard until the alwayscontentious Lisp community agrees to work together.

1.2 Good Performance

Common Lisp performs well. Most current implementations use modern compiler technology, incontrast to older Lisps, which used very primitive compiler techniques, even for the time. In termsof performance, anyone using a Common Lisp today on almost any computer can expect betterperformance than could be obtained on single-user PDP-10s or on single-user Lisp machines ofmid-1980s vintage. Many Common Lisp implementations have multitasking and non-intrusivegarbage collection -- both regarded as impossible features on stock hardware ten years ago.In fact, Common Lisp performs well on benchmarks compared to C. The following table shows theratio of Lisp time and code size to C time and code size for three benchmarks.

CPU TimeCode SizeTak0.901.21Traverse0.981.35Lexer

1.071.48

Tak is a Gabriel benchmark that measures function calling and fixnum arithmetic. Traverse is aGabriel benchmark that measures structure creation and access. Lexer is the tokenizer of a Ccompiler and measures dispatching and character manipulation.

These benchmarks were run on a Sun 3 in 1987 using the standard Sun C compiler using fulloptimization. The Lisp was not running a non-intrusive garbage collector.

1.3 Good Environments

It is arguable that modern programming environments come from the Lisp and AI tradition. Thefirst bit-mapped terminals (Stanford/MIT), the mouse pointing device (SRI), full-screen texteditors (Stanford/MIT), and windowed environments (Xerox PARC) all came from laboratoriesengaged in AI research. Even today one can argue that the Symbolics programming environmentrepresents the state of the art.

It is also arguable that the following development environment features originated in the Lispworld:

Incremental compilation and loadingSymbolic debuggersData inspectors

Source code level single steppingHelp on builtin operatorsWindow-based debuggingSymbolic stack backtracesStructure editors

Today’s Lisp environments are equal to the very best Lisp machine environments in the 1970s.Windowing, fancy editing, and good debugging are all commonplace. In some Lisp systems,significant attention has been paid to the software lifecycle through the use of source controlfacilities, automatic cross-referencing, and automatic testing.

1.4 Good Integration

Today Lisp code can coexist with C, Pascal, Fortran, etc. These languages can be invoked from Lispand in general, these languages can then re-invoke Lisp. Such interfaces allow the programmer topass Lisp data to foreign code, to pass foreign data to Lisp code, to manipulate foreign data fromLisp code, to manipulate Lisp data from foreign code, to dynamically load foreign programs, and tofreely mix foreign and Lisp functions.

The facilities for this functionality are quite extensive and provide a means for mixing several

3 of 122011/3/2 0:53

Worse Is Better

http://dreamsongs.com/WIB.html

different languages at once.

1.5 Object-oriented Programming

Lisp has the most powerful, comprehensive, and pervasively object-oriented extensions of anylanguage. CLOS embodies features not found in any other object-oriented language. These includethe following:

Multiple inheritance

Generic functions including multi-methodsFirst-class classes

First-class generic functionsMetaclasses

Method combinationInitialization protocolsMetaobject protocol

Integration with Lisp types

It is likely that Common Lisp (with CLOS) will be the first standardized object-orientedprogramming language.

1.6 Delivery

It is possible to deliver applications written in Lisp. The currently available tools are good but arenot yet ideal. These solutions include from removing unused code and data from application,building up applications using only the code and data needed, and producing .o files from Lispcode.

Delivery tools are commercially provided by Lucid, Franz, and Ibuki.

2 Lisp’s Apparent Failures

Too many teardrops for one heart to be crying.Too many teardrops for one heart to carry on.You’re way on top now, since you left me,Always laughing, way down at me.? & The Mysterians

This happy story, though, has a sad interlude, an interlude that might be attributed to the failure ofAI to soar, but which probably has some other grains of truth that we must heed. The key problemwith Lisp today stems from the tension between two opposing software philosophies. The twophilosophies are called The Right Thing and Worse is Better.

2.1 The Rise of Worse is Better

I and just about every designer of Common Lisp and CLOS has had extreme exposure to theMIT/Stanford style of design. The essence of this style can be captured by the phrase the rightthing. To such a designer it is important to get all of the following characteristics right:

Simplicity -- the design must be simple, both in implementation and interface. It is moreimportant for the interface to be simple than the implementation.

Correctness -- the design must be correct in all observable aspects. Incorrectness is simplynot allowed.

Consistency -- the design must not be inconsistent. A design is allowed to be slightly lesssimple and less complete to avoid inconsistency. Consistency is as important ascorrectness.

Completeness -- the design must cover as many important situations as is practical. Allreasonably expected cases must be covered. Simplicity is not allowed to overly reducecompleteness.

I believe most people would agree that these are good characteristics. I will call the use of thisphilosophy of design the MIT approach Common Lisp (with CLOS) and Scheme represent the MITapproach to design and implementation.

4 of 122011/3/2 0:53

Worse Is Better

http://dreamsongs.com/WIB.html

The worse-is-better philosophy is only slightly different:

Simplicity -- the design must be simple, both in implementation and interface. It is moreimportant for the implementation to be simple than the interface. Simplicity is the mostimportant consideration in a design.

Correctness -- the design must be correct in all observable aspects. It is slightly better tobe simple than correct.

Consistency -- the design must not be overly inconsistent. Consistency can be sacrificed forsimplicity in some cases, but it is better to drop those parts of the design that deal with lesscommon circumstances than to introduce either implementational complexity orinconsistency.

Completeness -- the design must cover as many important situations as is practical. Allreasonably expected cases should be covered. Completeness can be sacrificed in favor ofany other quality. In fact, completeness must sacrificed whenever implementationsimplicity is jeopardized. Consistency can be sacrificed to achieve completeness ifsimplicity is retained; especially worthless is consistency of interface.

Early Unix and C are examples of the use of this school of design, and I will call the use of thisdesign strategy the New Jersey approach I have intentionally caricatured the worse-is-betterphilosophy to convince you that it is obviously a bad philosophy and that the New Jersey approachis a bad approach.

However, I believe that worse-is-better, even in its strawman form, has better survivalcharacteristics than the-right-thing, and that the New Jersey approach when used for software is abetter approach than the MIT approach.

Let me start out by retelling a story that shows that the MIT/New-Jersey distinction is valid andthat proponents of each philosophy actually believe their philosophy is better.

Two famous people, one from MIT and another from Berkeley (but working on Unix) once met todiscuss operating system issues. The person from MIT was knowledgeable about ITS (the MIT AILab operating system) and had been reading the Unix sources. He was interested in how Unixsolved the PC loser-ing problem. The PC loser-ing problem occurs when a user program invokes asystem routine to perform a lengthy operation that might have significant state, such as IO buffers.If an interrupt occurs during the operation, the state of the user program must be saved. Becausethe invocation of the system routine is usually a single instruction, the PC of the user program doesnot adequately capture the state of the process. The system routine must either back out or pressforward. The right thing is to back out and restore the user program PC to the instruction thatinvoked the system routine so that resumption of the user program after the interrupt, for example,re-enters the system routine. It is called PC loser-ing because the PC is being coerced into losermode, where loser is the affectionate name for user at MIT.

The MIT guy did not see any code that handled this case and asked the New Jersey guy how theproblem was handled. The New Jersey guy said that the Unix folks were aware of the problem, butthe solution was for the system routine to always finish, but sometimes an error code would bereturned that signaled that the system routine had failed to complete its action. A correct userprogram, then, had to check the error code to determine whether to simply try the system routineagain. The MIT guy did not like this solution because it was not the right thing.

The New Jersey guy said that the Unix solution was right because the design philosophy of Unixwas simplicity and that the right thing was too complex. Besides, programmers could easily insertthis extra test and loop. The MIT guy pointed out that the implementation was simple but theinterface to the functionality was complex. The New Jersey guy said that the right tradeoff has beenselected in Unix -- namely, implementation simplicity was more important than interfacesimplicity.

The MIT guy then muttered that sometimes it takes a tough man to make a tender chicken, but theNew Jersey guy didn’t understand (I’m not sure I do either).

Now I want to argue that worse-is-better is better. C is a programming language designed forwriting Unix, and it was designed using the New Jersey approach. C is therefore a language forwhich it is easy to write a decent compiler, and it requires the programmer to write text that is easyfor the compiler to interpret. Some have called C a fancy assembly language. Both early Unix and Ccompilers had simple structures, are easy to port, require few machine resources to run, andprovide about 50%-80% of what you want from an operating system and programming language.

2011/3/2 0:53

5 of 12Worse Is Betterhttp://dreamsongs.com/WIB.html

Half the computers that exist at any point are worse than median (smaller or slower). Unix and Cwork fine on them. The worse-is-better philosophy means that implementation simplicity hashighest priority, which means Unix and C are easy to port on such machines. Therefore, oneexpects that if the 50% functionality Unix and C support is satisfactory, they will start to appeareverywhere. And they have, haven’t they?Unix and C are the ultimate computer viruses.

A further benefit of the worse-is-better philosophy is that the programmer is conditioned tosacrifice some safety, convenience, and hassle to get good performance and modest resource use.Programs written using the New Jersey approach will work well both in small machines and largeones, and the code will be portable because it is written on top of a virus.

It is important to remember that the initial virus has to be basically good. If so, the viral spread isassured as long as it is portable. Once the virus has spread, there will be pressure to improve it,possibly by increasing its functionality closer to 90%, but users have already been conditioned toaccept worse than the right thing. Therefore, the worse-is-better software first will gain acceptance,second will condition its users to expect less, and third will be improved to a point that is almost theright thing. In concrete terms, even though Lisp compilers in 1987 were about as good as Ccompilers, there are many more compiler experts who want to make C compilers better than wantto make Lisp compilers better.

The good news is that in 1995 we will have a good operating system and programming language;the bad news is that they will be Unix and C++.

There is a final benefit to worse-is-better. Because a New Jersey language and system are not reallypowerful enough to build complex monolithic software, large systems must be designed to reusecomponents. Therefore, a tradition of integration springs up.

How does the right thing stack up? There are two basic scenarios: the big complex system scenarioand the diamond-like jewel scenario.

The big complex system scenario goes like this:

First, the right thing needs to be designed. Then its implementation needs to be designed. Finally itis implemented. Because it is the right thing, it has nearly 100% of desired functionality, andimplementation simplicity was never a concern so it takes a long time to implement. It is large andcomplex. It requires complex tools to use properly. The last 20% takes 80% of the effort, and so theright thing takes a long time to get out, and it only runs satisfactorily on the most sophisticatedhardware.

The diamond-like jewel scenario goes like this:

The right thing takes forever to design, but it is quite small at every point along the way. Toimplement it to run fast is either impossible or beyond the capabilities of most implementors.The two scenarios correspond to Common Lisp and Scheme.

The first scenario is also the scenario for classic artificial intelligence software.

The right thing is frequently a monolithic piece of software, but for no reason other than that theright thing is often designed monolithically. That is, this characteristic is a happenstance.

The lesson to be learned from this is that it is often undesirable to go for the right thing first. It isbetter to get half of the right thing available so that it spreads like a virus. Once people are hookedon it, take the time to improve it to 90% of the right thing.

A wrong lesson is to take the parable literally and to conclude that C is the right vehicle for AIsoftware. The 50% solution has to be basically right, and in this case it isn’t.

But, one can conclude only that the Lisp community needs to seriously rethink its position on Lispdesign. I will say more about this later.

2.2 Good Lisp Programming is Hard

Many Lisp enthusiasts believe that Lisp programming is easy. This is true up to a point. When realapplications need to be delivered, the code needs to perform well. With C, programming is always

6 of 122011/3/2 0:53

Worse Is Betterhttp://dreamsongs.com/WIB.html

difficult because the compiler requires so much description and there are so few data types. In Lispit is very easy to write programs that perform very poorly; in C it is almost impossible to do that.The following examples of badly performing Lisp programs were all written by competent Lispprogrammers while writing real applications that were intended for deployment. I find these quitesad.

2.2.1 Bad Declarations

This example is a mistake that is easy to make. The programmer here did not declare his arrays asfully as he could have. Therefore, each array access was about as slow as a function call when itshould have been a few instructions. The original declaration was as follows:

(proclaim '(type (array fixnum *) *ar1* *ar2* *ar3*))

The three arrays happen to be of fixed size, which is reflected in the following correct declaration:

(proclaim '(type (simple-array fixnum (4)) *ar1*)) (proclaim '(type (simple-array fixnum (4 4)) *ar2*)) (proclaim '(type (simple-array fixnum (4 4 4)) *ar3*))

Altering the faulty declaration improved the performance of the entire system by 20%.2.2.2 Poor Knowledge of the Implementation

The next example is where the implementation has not optimized a particular case of a generalfacility, and the programmer has used the general facility thinking it will be fast. Here five valuesare being returned in a situation where the order of side effects is critical:

(multiple-value-prog1 (values (f1 x) (f2 y) (f3 y) (f4 y) (f5 y))

(setf (aref ar1 i1) (f6 y)) (f7 x y))

The implementation happens to optimize multiple-value-prog1 for up to three return values, butthe case of five values CONSes. The correct code follows:

(let ((x1 (f1 x)) (x2 (f2 y)) (x3 (f3 y)) (x4 (f4 y)) (x5 (f5 y)))

(setf (aref ar1 i1) (f6 y)) (f7 x y)

(values x1 x2 x3 x4 x5))

There is no reason that a programmer should know that this rewrite is needed. On the other hand,finding that performance was not as expected should not have led the manager of the programmerin question to conclude, as he did, that Lisp was the wrong language.2.2.3 Use of FORTRAN Idioms

Some Common Lisp compilers do not optimize the same way as others. The following expression issometimes used:

(* -1

)

when compilers often produce better code for this variant:

(- )

Of course, the first is the Lisp analog of the FORTRAN idiom:

7 of 122011/3/2 0:53

Worse Is Betterhttp://dreamsongs.com/WIB.html

- -1*

2.2.4 Totally Inappropriate Data Structures

Some might find this example hard to believe. This really occurred in some code I’ve seen:

(defun make-matrix (n m) (let ((matrix ()))

(dotimes (i n matrix)

(push (make-list m) matrix))))

(defun add-matrix (m1 m2) (let ((l1 (length m1)) (l2 (length m2)))

(let ((matrix (make-matrix l1 l2))) (dotimes (i l1 matrix) (dotimes (j l2)

(setf (nth i (nth j matrix)) (+ (nth i (nth j m1))

(nth i (nth j m2)))))))))

What’s worse is that in the particular application, the matrices were all fixed size, and matrixarithmetic would have been just as fast in Lisp as in FORTRAN.

This example is bitterly sad: The code is absolutely beautiful, but it adds matrices slowly. Thereforeit is excellent prototype code and lousy production code. You know, you cannot write productioncode as bad as this in C.

2.3 Integration is God

In the worse-is-better world, integration is linking your .o files together, freely intercallingfunctions, and using the same basic data representations. You don’t have a foreign loader, you don’tcoerce types across function-call boundaries, you don’t make one language dominant, and youdon’t make the woes of your implementation technology impact the entire system.

The very best Lisp foreign functionality is simply a joke when faced with the above reality. Everyitem on the list can be addressed in a Lisp implementation. This is just not the way Lispimplementations have been done in the right thing world.

The virus lives while the complex organism is stillborn. Lisp must adapt, not the other way around.The right thing and 2 shillings will get you a cup of tea.

2.4 Non-Lisp Environments are Catching Up

This is hard to face up to. For example, most C environments -- initially imitative of Lispenvironments -- are now pretty good. Current best C environments have the following:

Symbolic debuggersData inspectors

Source code level single steppingHelp on builtin operatorsWindow-based debuggingSymbolic stack backtracesStructure editors

And soon they will have incremental compilation and loading. These environments are easilyextendible to other languages, with multi-lingual environments not far behind.

Though still the best, current Lisp environments have several prominent failures. First, they tend tobe window-based but not well integrated. That is, related information is not represented so as toconvey the relationship. A multitude of windows does not mean integration, and neither does beingimplemented in the same language and running in the same image. In fact, I believe no currentlyavailable Lisp environment has any serious amount of integration.

Second, they are not persistent. They seemed to be defined for a single login session. Files are usedto keep persistent data -- how 1960s.

8 of 122011/3/2 0:53

Worse Is Better

http://dreamsongs.com/WIB.html

Third, they are not multi-lingual even when foreign interfaces are available.

Fourth, they do not address the software lifecycle in any extensive way. Documentation,specifications, maintenance, testing, validation, modification, and customer support are allignored.

Fifth, information is not brought to bear at the right times. The compiler is able to provide someinformation, but the environment should be able to generally know what is fully defined and what ispartially defined. Performance monitoring should not be a chore.

Sixth, using the environment is difficult. There are too many things to know. It’s just too hard tomanage the mechanics.

Seventh, environments are not multi-user when almost all interesting software is now written ingroups.

The real problem has been that almost no progress in Lisp environments has been made in the last10 years.

3 How Lisp Can Win Big

When the sun comes up, I’ll be on top.You’re right down there looking up.On my way to come up here,I’m gonna see you waiting there.I’m on my way to get next to you.I know now that I’m gonna get there.? & The Mysterians

The gloomy interlude can have a happy ending.

3.1 Continue Standardization Progress

We need to bury our differences at the ISO level and realize that there is a short term need, whichmust be Common Lisp, and a long term need, which must address all the issues for practicalapplications.

We’ve seen that the right thing attitude has brought us a very large, complex-to-understand, andcomplex-to-implement Lisp -- Common Lisp that solves way too many problems. We need to movebeyond Common Lisp for the future, but that does not imply giving up on Common Lisp now. We’veseen it is possible to do delivery of applications, and I think it is possible to provide tools that makeit easier to write applications for deployment. A lot of work has gone into getting Common Lisp tothe point of a right thing in many ways, and there are viable commercial implementations. But weneed to solve the delivery and integration problems in spades.

Earlier I characterized the MIT approach as often yielding stillborn results. To stop Common Lispstandardization now is equivalent to abortion, and that is equivalent to the Lisp community givingup on Lisp. If we want to adopt the New Jersey approach, it is wrong to give up on Lisp, because Cjust isn’t the right language for AI.

It also simply is not possible to dump Common Lisp now, work on a new standard, and thenstandardize in a timely fashion. Common Lisp is all we have at the moment. No other dialect isready for standardization.

Scheme is a smaller Lisp, but it also suffers from the MIT approach. It is too tight and notappropriate for large-scale software. At least Common Lisp has some facilities for that.

I think there should be an internationally recognized standard for Common Lisp. I don’t see what isto be gained by aborting the Common Lisp effort today just because it happens to not be the bestsolution to a commercial problem. For those who believe Lisp is dead or dying, what does killing offCommon Lisp achieve but to convince people that the Lisp community kills its own kind? I wish lesseffort would go into preventing Common Lisp from becoming a standard when it cannot hurt tohave several Lisp standards.

On the other hand, there should be a strong effort towards the next generation of Lisp. The worst

9 of 122011/3/2 0:53

Worse Is Better

http://dreamsongs.com/WIB.html

10 of 12thing we can do is to stand still as a community, and that is what is happening.All interested parties must step forward for the longer-term effort.

3.2 Retain the High Ground in Environments

I think there is a mistake in following an environment path that creates monolithic environments. Itshould be possible to use a variety of tools in an environment, and it should be possible for thosewho create new tools to be able to integrate them into the environment.

I believe that it is possible to build a tightly integrated environment that is built on an openarchitecture in which all tools, including language processors, are protocol-driven. I believe it ispossible to create an environment that is multi-lingual and addresses the software lifecycleproblem without imposing a particular software methodology on its users.

Our environments should not discriminate against non-Lisp programmers the way existingenvironments do. Lisp is not the center of the world.

3.3 Implement Correctly

Even though Common Lisp is not structured as a kernel plus libraries, it can be implemented thatway. The kernel and library routines can be in the form of .o files for easy linking with other,possibly non-Lisp, modules; the implementation must make it possible to write, for example, smallutility programs. It is also possible to piggyback on existing compilers, especially those that usecommon back ends. It is also possible to implement Lisp so that standard debuggers, possibly withextensions, can be made to work on Lisp code.

It might take time for developers of standard tools to agree to extend their tools to Lisp, but itcertainly won’t happen until our (exceptional) language is implemented more like ordinary ones.

3.4 Achieve Total Integration

I believe it is possible to implement a Lisp and surrounding environment which has nodiscrimination for or against any other language. It is possible using multi-lingual environments,clever representations of Lisp data, conservative garbage collection, and conventional callingprotocols to make a completely integrated Lisp that has no demerits.

3.5 Make Lisp the Premier Prototyping Language

Lisp is still the best prototyping language. We need to push this forward. A multi-lingualenvironment could form the basis or infrastructure for a multi-lingual prototyping system. Thismeans doing more research to find new ways to exploit Lisp’s strengths and to introduce new ones.Prototyping is the act of producing an initial implementation of a complex system. A prototype canbe easily instrumented, monitored, and altered. Prototypes are often built from disparate parts thathave been adapted to a new purpose. Descriptions of the construction of a prototype often involvestatements about modifying the behavioral characteristics of an existing program. For example,suppose there exists a tree traversal program. The description of a prototype using this programmight start out by saying something like

let S1 be the sequence of leaf nodes visited by P on tree T1 and S2 the leaf nodes visited by P on tree T2. Let C be a correspondence between S1 and S2 where f: S1 ! S2 maps elements to corresponding elements.

Subsequent statements might manipulate the correspondence and use f. Once the definition of aleaf node is made explicit, this is a precise enough statement for a system to be able to modify thetraversal routine to support the correspondence and f.

A language that describes the modification and control of an existing program can be termed aprogram language. Program languages be built on one or several underlying programminglanguages, and in fact can be implemented as part of the functionality of the prototypingenvironment. This view is built on the insight that an environment is a mechanism to assist aprogrammer in creating a working program, including preparing the source text. There is nonecessary requirement that an environment be limited to working only with raw source text. Asanother example, some systems comprise several processes communicating through channels. Thecreation of this part of the system can be visual, with the final result produced by the environment

2011/3/2 0:53

Worse Is Betterhttp://dreamsongs.com/WIB.html

11 of 12being a set of source code in several languages, build scripts, link directives, and operating systemcalls. Because no single programming language encompasses the program language, one could callsuch a language an epi-language.

3.6 The Next Lisp

I think there will be a next Lisp. This Lisp must be carefully designed, using the principles forsuccess we saw in worse-is-better.

There should be a simple, easily implementable kernel to the Lisp. That kernel should be both morethan Scheme -- modules and macros -- and less than Scheme -- continuations remain an ugly stainon the otherwise clean manuscript of Scheme.

The kernel should emphasize implementational simplicity, but not at the expense of interfacesimplicity. Where one conflicts with the other, the capability should be left out of the kernel. Onereason is so that the kernel can serve as an extension language for other systems, much as GNUEmacs uses a version of Lisp for defining Emacs macros.

Some aspects of the extreme dynamism of Common Lisp should be reexamined, or at least thetradeoffs reconsidered. For example, how often does a real program do this?

(defun f ...)

(dotimes (...) ...

(setf (symbol-function 'f) #'(lambda ...)) ...)

Implementations of the next Lisp should not be influenced by previous implementations to makethis operation fast, especially at the expense of poor performance of all other function calls.The language should be segmented into at least four layers:

1.The kernel language, which is small and simple to implement. In all cases, the need fordynamic redefinition should be re-examined to determine that support at this level isnecessary. I believe nothing in the kernel need be dynamically redefinable.

2.A linguistic layer for fleshing out the language. This layer may have someimplementational difficulties, and it will probably have dynamic aspects that are tooexpensive for the kernel but too important to leave out.

3.A library. Most of what is in Common Lisp would be in this layer.4.Environmentally provided epilinguistic features.

In the first layer I include conditionals, function calling, all primitive data structures, macros,single values, and very basic object-oriented support.

In the second layer I include multiple values and more elaborate object-oriented support. Thesecond layer is for difficult programming constructs that are too important to leave toenvironments to provide, but which have sufficient semantic consequences to warrant precisedefinition. Some forms of redefinition capabilities might reside here.

In the third layer I include sequence functions, the elaborate IO functions, and anything else that issimply implemented in the first and possibly the second layers. These functions should be linkable.In the fourth layer I include those capabilities that an environment can and should provide, butwhich must be standardized. A typical example is defmethod from CLOS. In CLOS, genericfunctions are made of methods, each method applicable to certain classes. The first layer has adefinition form for a complete generic function -- that is, for a generic function along with all of itsmethods, defined in one place (which is how the layer 1 compiler wants to see it). There will also bemeans of associating a name with the generic function. However, while developing a system, classeswill be defined in various places, and it makes sense to be able to see relevant (applicable) methodsadjacent to these classes. defmethod is the construct to define methods, and defmethod forms canbe placed anywhere amongst other definitional forms.

But methods are relevant to each class on which the method is specialized, and also to eachsubclass of those classes. So, where should the unique defmethod form be placed? The environmentshould allow the programmer to see the method definition in any or all of these places, while the

2011/3/2 0:53

Worse Is Betterhttp://dreamsongs.com/WIB.html

12 of 12real definition should be in some particular place. That place might as well be in the single genericfunction definition form, and it is up to the environment to show the defmethod equivalent nearrelevant classes when required, and to accept as input the source in the form of a defmethod (whichit then places in the generic function definition).

We want to standardize the defmethod form, but it is a linguistic feature provided by theenvironment. Similarly, many uses of elaborate lambda-list syntax, such as keyword arguments,are examples of linguistic support that the environment can provide possibly by using color orother adjuncts to the text.

In fact, the area of function-function interfaces should be re-examined to see what sorts ofargument naming schemes are needed and in which layer they need to be placed.

Finally, note that it might be that every layer 2 capability could be provided in a layer 1implementation by an environment.

3.7 Help Application Writers Win

The Lisp community has too few application writers. The Lisp vendors need to make sure theseapplication writers win. To do this requires that the parties involved be open about their problemsand not adversarial. For example, when an expert system shell company finds problems, it shouldopen up its source code to the Lisp vendor so that both can work towards the common goal ofmaking a faster, smaller, more deliverable product. And the Lisp vendors should do the same.The business leadership of the AI community seems to have adopted the worst caricature-like traitsof business practice: secrecy, mistrust, run-up-the-score competitiveness. We are an industry thathas enough common competitors without searching for them among our own ranks.Sometimes the sun also rises.

References

[1] ? & the Mysterians, 96 Tears, Pa-go-go Records 1966, re-released on Cameo Records,September 1966.

2011/3/2 0:53

因篇幅问题不能全部显示,请点此查看更多更全内容