popular.txt 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. May 2001(This article was written as a kind of business plan for a
  2. new language.
  3. So it is missing (because it takes for granted) the most important
  4. feature of a good programming language: very powerful abstractions.)A friend of mine once told an eminent operating systems
  5. expert that he wanted to design a really good
  6. programming language. The expert told him that it would be a
  7. waste of time, that programming languages don't become popular
  8. or unpopular based on their merits, and so no matter how
  9. good his language was, no one would use it. At least, that
  10. was what had happened to the language he had designed.What does make a language popular? Do popular
  11. languages deserve their popularity? Is it worth trying to
  12. define a good programming language? How would you do it?I think the answers to these questions can be found by looking
  13. at hackers, and learning what they want. Programming
  14. languages are for hackers, and a programming language
  15. is good as a programming language (rather than, say, an
  16. exercise in denotational semantics or compiler design)
  17. if and only if hackers like it.1 The Mechanics of PopularityIt's true, certainly, that most people don't choose programming
  18. languages simply based on their merits. Most programmers are told
  19. what language to use by someone else. And yet I think the effect
  20. of such external factors on the popularity of programming languages
  21. is not as great as it's sometimes thought to be. I think a bigger
  22. problem is that a hacker's idea of a good programming language is
  23. not the same as most language designers'.Between the two, the hacker's opinion is the one that matters.
  24. Programming languages are not theorems. They're tools, designed
  25. for people, and they have to be designed to suit human strengths
  26. and weaknesses as much as shoes have to be designed for human feet.
  27. If a shoe pinches when you put it on, it's a bad shoe, however
  28. elegant it may be as a piece of sculpture.It may be that the majority of programmers can't tell a good language
  29. from a bad one. But that's no different with any other tool. It
  30. doesn't mean that it's a waste of time to try designing a good
  31. language. Expert hackers
  32. can tell a good language when they see
  33. one, and they'll use it. Expert hackers are a tiny minority,
  34. admittedly, but that tiny minority write all the good software,
  35. and their influence is such that the rest of the programmers will
  36. tend to use whatever language they use. Often, indeed, it is not
  37. merely influence but command: often the expert hackers are the very
  38. people who, as their bosses or faculty advisors, tell the other
  39. programmers what language to use.The opinion of expert hackers is not the only force that determines
  40. the relative popularity of programming languages — legacy software
  41. (Cobol) and hype (Ada, Java) also play a role — but I think it is
  42. the most powerful force over the long term. Given an initial critical
  43. mass and enough time, a programming language probably becomes about
  44. as popular as it deserves to be. And popularity further separates
  45. good languages from bad ones, because feedback from real live users
  46. always leads to improvements. Look at how much any popular language
  47. has changed during its life. Perl and Fortran are extreme cases,
  48. but even Lisp has changed a lot. Lisp 1.5 didn't have macros, for
  49. example; these evolved later, after hackers at MIT had spent a
  50. couple years using Lisp to write real programs. [1]So whether or not a language has to be good to be popular, I think
  51. a language has to be popular to be good. And it has to stay popular
  52. to stay good. The state of the art in programming languages doesn't
  53. stand still. And yet the Lisps we have today are still pretty much
  54. what they had at MIT in the mid-1980s, because that's the last time
  55. Lisp had a sufficiently large and demanding user base.Of course, hackers have to know about a language before they can
  56. use it. How are they to hear? From other hackers. But there has to
  57. be some initial group of hackers using the language for others even
  58. to hear about it. I wonder how large this group has to be; how many
  59. users make a critical mass? Off the top of my head, I'd say twenty.
  60. If a language had twenty separate users, meaning twenty users who
  61. decided on their own to use it, I'd consider it to be real.Getting there can't be easy. I would not be surprised if it is
  62. harder to get from zero to twenty than from twenty to a thousand.
  63. The best way to get those initial twenty users is probably to use
  64. a trojan horse: to give people an application they want, which
  65. happens to be written in the new language.2 External FactorsLet's start by acknowledging one external factor that does affect
  66. the popularity of a programming language. To become popular, a
  67. programming language has to be the scripting language of a popular
  68. system. Fortran and Cobol were the scripting languages of early
  69. IBM mainframes. C was the scripting language of Unix, and so, later,
  70. was Perl. Tcl is the scripting language of Tk. Java and Javascript
  71. are intended to be the scripting languages of web browsers.Lisp is not a massively popular language because it is not the
  72. scripting language of a massively popular system. What popularity
  73. it retains dates back to the 1960s and 1970s, when it was the
  74. scripting language of MIT. A lot of the great programmers of the
  75. day were associated with MIT at some point. And in the early 1970s,
  76. before C, MIT's dialect of Lisp, called MacLisp, was one of the
  77. only programming languages a serious hacker would want to use.Today Lisp is the scripting language of two moderately popular
  78. systems, Emacs and Autocad, and for that reason I suspect that most
  79. of the Lisp programming done today is done in Emacs Lisp or AutoLisp.Programming languages don't exist in isolation. To hack is a
  80. transitive verb — hackers are usually hacking something — and in
  81. practice languages are judged relative to whatever they're used to
  82. hack. So if you want to design a popular language, you either have
  83. to supply more than a language, or you have to design your language
  84. to replace the scripting language of some existing system.Common Lisp is unpopular partly because it's an orphan. It did
  85. originally come with a system to hack: the Lisp Machine. But Lisp
  86. Machines (along with parallel computers) were steamrollered by the
  87. increasing power of general purpose processors in the 1980s. Common
  88. Lisp might have remained popular if it had been a good scripting
  89. language for Unix. It is, alas, an atrociously bad one.One way to describe this situation is to say that a language isn't
  90. judged on its own merits. Another view is that a programming language
  91. really isn't a programming language unless it's also the scripting
  92. language of something. This only seems unfair if it comes as a
  93. surprise. I think it's no more unfair than expecting a programming
  94. language to have, say, an implementation. It's just part of what
  95. a programming language is.A programming language does need a good implementation, of course,
  96. and this must be free. Companies will pay for software, but individual
  97. hackers won't, and it's the hackers you need to attract.A language also needs to have a book about it. The book should be
  98. thin, well-written, and full of good examples. K&R is the ideal
  99. here. At the moment I'd almost say that a language has to have a
  100. book published by O'Reilly. That's becoming the test of mattering
  101. to hackers.There should be online documentation as well. In fact, the book
  102. can start as online documentation. But I don't think that physical
  103. books are outmoded yet. Their format is convenient, and the de
  104. facto censorship imposed by publishers is a useful if imperfect
  105. filter. Bookstores are one of the most important places for learning
  106. about new languages.3 BrevityGiven that you can supply the three things any language needs — a
  107. free implementation, a book, and something to hack — how do you
  108. make a language that hackers will like?One thing hackers like is brevity. Hackers are lazy, in the same
  109. way that mathematicians and modernist architects are lazy: they
  110. hate anything extraneous. It would not be far from the truth to
  111. say that a hacker about to write a program decides what language
  112. to use, at least subconsciously, based on the total number of
  113. characters he'll have to type. If this isn't precisely how hackers
  114. think, a language designer would do well to act as if it were.It is a mistake to try to baby the user with long-winded expressions
  115. that are meant to resemble English. Cobol is notorious for this
  116. flaw. A hacker would consider being asked to writeadd x to y giving zinstead ofz = x+yas something between an insult to his intelligence and a sin against
  117. God.It has sometimes been said that Lisp should use first and rest
  118. instead of car and cdr, because it would make programs easier to
  119. read. Maybe for the first couple hours. But a hacker can learn
  120. quickly enough that car means the first element of a list and cdr
  121. means the rest. Using first and rest means 50% more typing. And
  122. they are also different lengths, meaning that the arguments won't
  123. line up when they're called, as car and cdr often are, in successive
  124. lines. I've found that it matters a lot how code lines up on the
  125. page. I can barely read Lisp code when it is set in a variable-width
  126. font, and friends say this is true for other languages too.Brevity is one place where strongly typed languages lose. All other
  127. things being equal, no one wants to begin a program with a bunch
  128. of declarations. Anything that can be implicit, should be.The individual tokens should be short as well. Perl and Common Lisp
  129. occupy opposite poles on this question. Perl programs can be almost
  130. cryptically dense, while the names of built-in Common Lisp operators
  131. are comically long. The designers of Common Lisp probably expected
  132. users to have text editors that would type these long names for
  133. them. But the cost of a long name is not just the cost of typing
  134. it. There is also the cost of reading it, and the cost of the space
  135. it takes up on your screen.4 HackabilityThere is one thing more important than brevity to a hacker: being
  136. able to do what you want. In the history of programming languages
  137. a surprising amount of effort has gone into preventing programmers
  138. from doing things considered to be improper. This is a dangerously
  139. presumptuous plan. How can the language designer know what the
  140. programmer is going to need to do? I think language designers would
  141. do better to consider their target user to be a genius who will
  142. need to do things they never anticipated, rather than a bumbler
  143. who needs to be protected from himself. The bumbler will shoot
  144. himself in the foot anyway. You may save him from referring to
  145. variables in another package, but you can't save him from writing
  146. a badly designed program to solve the wrong problem, and taking
  147. forever to do it.Good programmers often want to do dangerous and unsavory things.
  148. By unsavory I mean things that go behind whatever semantic facade
  149. the language is trying to present: getting hold of the internal
  150. representation of some high-level abstraction, for example. Hackers
  151. like to hack, and hacking means getting inside things and second
  152. guessing the original designer.Let yourself be second guessed. When you make any tool, people use
  153. it in ways you didn't intend, and this is especially true of a
  154. highly articulated tool like a programming language. Many a hacker
  155. will want to tweak your semantic model in a way that you never
  156. imagined. I say, let them; give the programmer access to as much
  157. internal stuff as you can without endangering runtime systems like
  158. the garbage collector.In Common Lisp I have often wanted to iterate through the fields
  159. of a struct — to comb out references to a deleted object, for example,
  160. or find fields that are uninitialized. I know the structs are just
  161. vectors underneath. And yet I can't write a general purpose function
  162. that I can call on any struct. I can only access the fields by
  163. name, because that's what a struct is supposed to mean.A hacker may only want to subvert the intended model of things once
  164. or twice in a big program. But what a difference it makes to be
  165. able to. And it may be more than a question of just solving a
  166. problem. There is a kind of pleasure here too. Hackers share the
  167. surgeon's secret pleasure in poking about in gross innards, the
  168. teenager's secret pleasure in popping zits. [2] For boys, at least,
  169. certain kinds of horrors are fascinating. Maxim magazine publishes
  170. an annual volume of photographs, containing a mix of pin-ups and
  171. grisly accidents. They know their audience.Historically, Lisp has been good at letting hackers have their way.
  172. The political correctness of Common Lisp is an aberration. Early
  173. Lisps let you get your hands on everything. A good deal of that
  174. spirit is, fortunately, preserved in macros. What a wonderful thing,
  175. to be able to make arbitrary transformations on the source code.Classic macros are a real hacker's tool — simple, powerful, and
  176. dangerous. It's so easy to understand what they do: you call a
  177. function on the macro's arguments, and whatever it returns gets
  178. inserted in place of the macro call. Hygienic macros embody the
  179. opposite principle. They try to protect you from understanding what
  180. they're doing. I have never heard hygienic macros explained in one
  181. sentence. And they are a classic example of the dangers of deciding
  182. what programmers are allowed to want. Hygienic macros are intended
  183. to protect me from variable capture, among other things, but variable
  184. capture is exactly what I want in some macros.A really good language should be both clean and dirty: cleanly
  185. designed, with a small core of well understood and highly orthogonal
  186. operators, but dirty in the sense that it lets hackers have their
  187. way with it. C is like this. So were the early Lisps. A real hacker's
  188. language will always have a slightly raffish character.A good programming language should have features that make the kind
  189. of people who use the phrase "software engineering" shake their
  190. heads disapprovingly. At the other end of the continuum are languages
  191. like Ada and Pascal, models of propriety that are good for teaching
  192. and not much else.5 Throwaway ProgramsTo be attractive to hackers, a language must be good for writing
  193. the kinds of programs they want to write. And that means, perhaps
  194. surprisingly, that it has to be good for writing throwaway programs.A throwaway program is a program you write quickly for some limited
  195. task: a program to automate some system administration task, or
  196. generate test data for a simulation, or convert data from one format
  197. to another. The surprising thing about throwaway programs is that,
  198. like the "temporary" buildings built at so many American universities
  199. during World War II, they often don't get thrown away. Many evolve
  200. into real programs, with real features and real users.I have a hunch that the best big programs begin life this way,
  201. rather than being designed big from the start, like the Hoover Dam.
  202. It's terrifying to build something big from scratch. When people
  203. take on a project that's too big, they become overwhelmed. The
  204. project either gets bogged down, or the result is sterile and
  205. wooden: a shopping mall rather than a real downtown, Brasilia rather
  206. than Rome, Ada rather than C.Another way to get a big program is to start with a throwaway
  207. program and keep improving it. This approach is less daunting, and
  208. the design of the program benefits from evolution. I think, if one
  209. looked, that this would turn out to be the way most big programs
  210. were developed. And those that did evolve this way are probably
  211. still written in whatever language they were first written in,
  212. because it's rare for a program to be ported, except for political
  213. reasons. And so, paradoxically, if you want to make a language that
  214. is used for big systems, you have to make it good for writing
  215. throwaway programs, because that's where big systems come from.Perl is a striking example of this idea. It was not only designed
  216. for writing throwaway programs, but was pretty much a throwaway
  217. program itself. Perl began life as a collection of utilities for
  218. generating reports, and only evolved into a programming language
  219. as the throwaway programs people wrote in it grew larger. It was
  220. not until Perl 5 (if then) that the language was suitable for
  221. writing serious programs, and yet it was already massively popular.What makes a language good for throwaway programs? To start with,
  222. it must be readily available. A throwaway program is something that
  223. you expect to write in an hour. So the language probably must
  224. already be installed on the computer you're using. It can't be
  225. something you have to install before you use it. It has to be there.
  226. C was there because it came with the operating system. Perl was
  227. there because it was originally a tool for system administrators,
  228. and yours had already installed it.Being available means more than being installed, though. An
  229. interactive language, with a command-line interface, is more
  230. available than one that you have to compile and run separately. A
  231. popular programming language should be interactive, and start up
  232. fast.Another thing you want in a throwaway program is brevity. Brevity
  233. is always attractive to hackers, and never more so than in a program
  234. they expect to turn out in an hour.6 LibrariesOf course the ultimate in brevity is to have the program already
  235. written for you, and merely to call it. And this brings us to what
  236. I think will be an increasingly important feature of programming
  237. languages: library functions. Perl wins because it has large
  238. libraries for manipulating strings. This class of library functions
  239. are especially important for throwaway programs, which are often
  240. originally written for converting or extracting data. Many Perl
  241. programs probably begin as just a couple library calls stuck
  242. together.I think a lot of the advances that happen in programming languages
  243. in the next fifty years will have to do with library functions. I
  244. think future programming languages will have libraries that are as
  245. carefully designed as the core language. Programming language design
  246. will not be about whether to make your language strongly or weakly
  247. typed, or object oriented, or functional, or whatever, but about
  248. how to design great libraries. The kind of language designers who
  249. like to think about how to design type systems may shudder at this.
  250. It's almost like writing applications! Too bad. Languages are for
  251. programmers, and libraries are what programmers need.It's hard to design good libraries. It's not simply a matter of
  252. writing a lot of code. Once the libraries get too big, it can
  253. sometimes take longer to find the function you need than to write
  254. the code yourself. Libraries need to be designed using a small set
  255. of orthogonal operators, just like the core language. It ought to
  256. be possible for the programmer to guess what library call will do
  257. what he needs.Libraries are one place Common Lisp falls short. There are only
  258. rudimentary libraries for manipulating strings, and almost none
  259. for talking to the operating system. For historical reasons, Common
  260. Lisp tries to pretend that the OS doesn't exist. And because you
  261. can't talk to the OS, you're unlikely to be able to write a serious
  262. program using only the built-in operators in Common Lisp. You have
  263. to use some implementation-specific hacks as well, and in practice
  264. these tend not to give you everything you want. Hackers would think
  265. a lot more highly of Lisp if Common Lisp had powerful string
  266. libraries and good OS support.7 SyntaxCould a language with Lisp's syntax, or more precisely, lack of
  267. syntax, ever become popular? I don't know the answer to this
  268. question. I do think that syntax is not the main reason Lisp isn't
  269. currently popular. Common Lisp has worse problems than unfamiliar
  270. syntax. I know several programmers who are comfortable with prefix
  271. syntax and yet use Perl by default, because it has powerful string
  272. libraries and can talk to the os.There are two possible problems with prefix notation: that it is
  273. unfamiliar to programmers, and that it is not dense enough. The
  274. conventional wisdom in the Lisp world is that the first problem is
  275. the real one. I'm not so sure. Yes, prefix notation makes ordinary
  276. programmers panic. But I don't think ordinary programmers' opinions
  277. matter. Languages become popular or unpopular based on what expert
  278. hackers think of them, and I think expert hackers might be able to
  279. deal with prefix notation. Perl syntax can be pretty incomprehensible,
  280. but that has not stood in the way of Perl's popularity. If anything
  281. it may have helped foster a Perl cult.A more serious problem is the diffuseness of prefix notation. For
  282. expert hackers, that really is a problem. No one wants to write
  283. (aref a x y) when they could write a[x,y].In this particular case there is a way to finesse our way out of
  284. the problem. If we treat data structures as if they were functions
  285. on indexes, we could write (a x y) instead, which is even shorter
  286. than the Perl form. Similar tricks may shorten other types of
  287. expressions.We can get rid of (or make optional) a lot of parentheses by making
  288. indentation significant. That's how programmers read code anyway:
  289. when indentation says one thing and delimiters say another, we go
  290. by the indentation. Treating indentation as significant would
  291. eliminate this common source of bugs as well as making programs
  292. shorter.Sometimes infix syntax is easier to read. This is especially true
  293. for math expressions. I've used Lisp my whole programming life and
  294. I still don't find prefix math expressions natural. And yet it is
  295. convenient, especially when you're generating code, to have operators
  296. that take any number of arguments. So if we do have infix syntax,
  297. it should probably be implemented as some kind of read-macro.I don't think we should be religiously opposed to introducing syntax
  298. into Lisp, as long as it translates in a well-understood way into
  299. underlying s-expressions. There is already a good deal of syntax
  300. in Lisp. It's not necessarily bad to introduce more, as long as no
  301. one is forced to use it. In Common Lisp, some delimiters are reserved
  302. for the language, suggesting that at least some of the designers
  303. intended to have more syntax in the future.One of the most egregiously unlispy pieces of syntax in Common Lisp
  304. occurs in format strings; format is a language in its own right,
  305. and that language is not Lisp. If there were a plan for introducing
  306. more syntax into Lisp, format specifiers might be able to be included
  307. in it. It would be a good thing if macros could generate format
  308. specifiers the way they generate any other kind of code.An eminent Lisp hacker told me that his copy of CLTL falls open to
  309. the section format. Mine too. This probably indicates room for
  310. improvement. It may also mean that programs do a lot of I/O.8 EfficiencyA good language, as everyone knows, should generate fast code. But
  311. in practice I don't think fast code comes primarily from things
  312. you do in the design of the language. As Knuth pointed out long
  313. ago, speed only matters in certain critical bottlenecks. And as
  314. many programmers have observed since, one is very often mistaken
  315. about where these bottlenecks are.So, in practice, the way to get fast code is to have a very good
  316. profiler, rather than by, say, making the language strongly typed.
  317. You don't need to know the type of every argument in every call in
  318. the program. You do need to be able to declare the types of arguments
  319. in the bottlenecks. And even more, you need to be able to find out
  320. where the bottlenecks are.One complaint people have had with Lisp is that it's hard to tell
  321. what's expensive. This might be true. It might also be inevitable,
  322. if you want to have a very abstract language. And in any case I
  323. think good profiling would go a long way toward fixing the problem:
  324. you'd soon learn what was expensive.Part of the problem here is social. Language designers like to
  325. write fast compilers. That's how they measure their skill. They
  326. think of the profiler as an add-on, at best. But in practice a good
  327. profiler may do more to improve the speed of actual programs written
  328. in the language than a compiler that generates fast code. Here,
  329. again, language designers are somewhat out of touch with their
  330. users. They do a really good job of solving slightly the wrong
  331. problem.It might be a good idea to have an active profiler — to push
  332. performance data to the programmer instead of waiting for him to
  333. come asking for it. For example, the editor could display bottlenecks
  334. in red when the programmer edits the source code. Another approach
  335. would be to somehow represent what's happening in running programs.
  336. This would be an especially big win in server-based applications,
  337. where you have lots of running programs to look at. An active
  338. profiler could show graphically what's happening in memory as a
  339. program's running, or even make sounds that tell what's happening.Sound is a good cue to problems. In one place I worked, we had a
  340. big board of dials showing what was happening to our web servers.
  341. The hands were moved by little servomotors that made a slight noise
  342. when they turned. I couldn't see the board from my desk, but I
  343. found that I could tell immediately, by the sound, when there was
  344. a problem with a server.It might even be possible to write a profiler that would automatically
  345. detect inefficient algorithms. I would not be surprised if certain
  346. patterns of memory access turned out to be sure signs of bad
  347. algorithms. If there were a little guy running around inside the
  348. computer executing our programs, he would probably have as long
  349. and plaintive a tale to tell about his job as a federal government
  350. employee. I often have a feeling that I'm sending the processor on
  351. a lot of wild goose chases, but I've never had a good way to look
  352. at what it's doing.A number of Lisps now compile into byte code, which is then executed
  353. by an interpreter. This is usually done to make the implementation
  354. easier to port, but it could be a useful language feature. It might
  355. be a good idea to make the byte code an official part of the
  356. language, and to allow programmers to use inline byte code in
  357. bottlenecks. Then such optimizations would be portable too.The nature of speed, as perceived by the end-user, may be changing.
  358. With the rise of server-based applications, more and more programs
  359. may turn out to be i/o-bound. It will be worth making i/o fast.
  360. The language can help with straightforward measures like simple,
  361. fast, formatted output functions, and also with deep structural
  362. changes like caching and persistent objects.Users are interested in response time. But another kind of efficiency
  363. will be increasingly important: the number of simultaneous users
  364. you can support per processor. Many of the interesting applications
  365. written in the near future will be server-based, and the number of
  366. users per server is the critical question for anyone hosting such
  367. applications. In the capital cost of a business offering a server-based
  368. application, this is the divisor.For years, efficiency hasn't mattered much in most end-user
  369. applications. Developers have been able to assume that each user
  370. would have an increasingly powerful processor sitting on their
  371. desk. And by Parkinson's Law, software has expanded to use the
  372. resources available. That will change with server-based applications.
  373. In that world, the hardware and software will be supplied together.
  374. For companies that offer server-based applications, it will make
  375. a very big difference to the bottom line how many users they can
  376. support per server.In some applications, the processor will be the limiting factor,
  377. and execution speed will be the most important thing to optimize.
  378. But often memory will be the limit; the number of simultaneous
  379. users will be determined by the amount of memory you need for each
  380. user's data. The language can help here too. Good support for
  381. threads will enable all the users to share a single heap. It may
  382. also help to have persistent objects and/or language level support
  383. for lazy loading.9 TimeThe last ingredient a popular language needs is time. No one wants
  384. to write programs in a language that might go away, as so many
  385. programming languages do. So most hackers will tend to wait until
  386. a language has been around for a couple years before even considering
  387. using it.Inventors of wonderful new things are often surprised to discover
  388. this, but you need time to get any message through to people. A
  389. friend of mine rarely does anything the first time someone asks
  390. him. He knows that people sometimes ask for things that they turn
  391. out not to want. To avoid wasting his time, he waits till the third
  392. or fourth time he's asked to do something; by then, whoever's asking
  393. him may be fairly annoyed, but at least they probably really do
  394. want whatever they're asking for.Most people have learned to do a similar sort of filtering on new
  395. things they hear about. They don't even start paying attention
  396. until they've heard about something ten times. They're perfectly
  397. justified: the majority of hot new whatevers do turn out to be a
  398. waste of time, and eventually go away. By delaying learning VRML,
  399. I avoided having to learn it at all.So anyone who invents something new has to expect to keep repeating
  400. their message for years before people will start to get it. We
  401. wrote what was, as far as I know, the first web-server based
  402. application, and it took us years to get it through to people that
  403. it didn't have to be downloaded. It wasn't that they were stupid.
  404. They just had us tuned out.The good news is, simple repetition solves the problem. All you
  405. have to do is keep telling your story, and eventually people will
  406. start to hear. It's not when people notice you're there that they
  407. pay attention; it's when they notice you're still there.It's just as well that it usually takes a while to gain momentum.
  408. Most technologies evolve a good deal even after they're first
  409. launched — programming languages especially. Nothing could be better,
  410. for a new techology, than a few years of being used only by a small
  411. number of early adopters. Early adopters are sophisticated and
  412. demanding, and quickly flush out whatever flaws remain in your
  413. technology. When you only have a few users you can be in close
  414. contact with all of them. And early adopters are forgiving when
  415. you improve your system, even if this causes some breakage.There are two ways new technology gets introduced: the organic
  416. growth method, and the big bang method. The organic growth method
  417. is exemplified by the classic seat-of-the-pants underfunded garage
  418. startup. A couple guys, working in obscurity, develop some new
  419. technology. They launch it with no marketing and initially have
  420. only a few (fanatically devoted) users. They continue to improve
  421. the technology, and meanwhile their user base grows by word of
  422. mouth. Before they know it, they're big.The other approach, the big bang method, is exemplified by the
  423. VC-backed, heavily marketed startup. They rush to develop a product,
  424. launch it with great publicity, and immediately (they hope) have
  425. a large user base.Generally, the garage guys envy the big bang guys. The big bang
  426. guys are smooth and confident and respected by the VCs. They can
  427. afford the best of everything, and the PR campaign surrounding the
  428. launch has the side effect of making them celebrities. The organic
  429. growth guys, sitting in their garage, feel poor and unloved. And
  430. yet I think they are often mistaken to feel sorry for themselves.
  431. Organic growth seems to yield better technology and richer founders
  432. than the big bang method. If you look at the dominant technologies
  433. today, you'll find that most of them grew organically.This pattern doesn't only apply to companies. You see it in sponsored
  434. research too. Multics and Common Lisp were big-bang projects, and
  435. Unix and MacLisp were organic growth projects.10 Redesign"The best writing is rewriting," wrote E. B. White. Every good
  436. writer knows this, and it's true for software too. The most important
  437. part of design is redesign. Programming languages, especially,
  438. don't get redesigned enough.To write good software you must simultaneously keep two opposing
  439. ideas in your head. You need the young hacker's naive faith in
  440. his abilities, and at the same time the veteran's skepticism. You
  441. have to be able to think
  442. how hard can it be? with one half of
  443. your brain while thinking
  444. it will never work with the other.The trick is to realize that there's no real contradiction here.
  445. You want to be optimistic and skeptical about two different things.
  446. You have to be optimistic about the possibility of solving the
  447. problem, but skeptical about the value of whatever solution you've
  448. got so far.People who do good work often think that whatever they're working
  449. on is no good. Others see what they've done and are full of wonder,
  450. but the creator is full of worry. This pattern is no coincidence:
  451. it is the worry that made the work good.If you can keep hope and worry balanced, they will drive a project
  452. forward the same way your two legs drive a bicycle forward. In the
  453. first phase of the two-cycle innovation engine, you work furiously
  454. on some problem, inspired by your confidence that you'll be able
  455. to solve it. In the second phase, you look at what you've done in
  456. the cold light of morning, and see all its flaws very clearly. But
  457. as long as your critical spirit doesn't outweigh your hope, you'll
  458. be able to look at your admittedly incomplete system, and think,
  459. how hard can it be to get the rest of the way?, thereby continuing
  460. the cycle.It's tricky to keep the two forces balanced. In young hackers,
  461. optimism predominates. They produce something, are convinced it's
  462. great, and never improve it. In old hackers, skepticism predominates,
  463. and they won't even dare to take on ambitious projects.Anything you can do to keep the redesign cycle going is good. Prose
  464. can be rewritten over and over until you're happy with it. But
  465. software, as a rule, doesn't get redesigned enough. Prose has
  466. readers, but software has users. If a writer rewrites an essay,
  467. people who read the old version are unlikely to complain that their
  468. thoughts have been broken by some newly introduced incompatibility.Users are a double-edged sword. They can help you improve your
  469. language, but they can also deter you from improving it. So choose
  470. your users carefully, and be slow to grow their number. Having
  471. users is like optimization: the wise course is to delay it. Also,
  472. as a general rule, you can at any given time get away with changing
  473. more than you think. Introducing change is like pulling off a
  474. bandage: the pain is a memory almost as soon as you feel it.Everyone knows that it's not a good idea to have a language designed
  475. by a committee. Committees yield bad design. But I think the worst
  476. danger of committees is that they interfere with redesign. It is
  477. so much work to introduce changes that no one wants to bother.
  478. Whatever a committee decides tends to stay that way, even if most
  479. of the members don't like it.Even a committee of two gets in the way of redesign. This happens
  480. particularly in the interfaces between pieces of software written
  481. by two different people. To change the interface both have to agree
  482. to change it at once. And so interfaces tend not to change at all,
  483. which is a problem because they tend to be one of the most ad hoc
  484. parts of any system.One solution here might be to design systems so that interfaces
  485. are horizontal instead of vertical — so that modules are always
  486. vertically stacked strata of abstraction. Then the interface will
  487. tend to be owned by one of them. The lower of two levels will either
  488. be a language in which the upper is written, in which case the
  489. lower level will own the interface, or it will be a slave, in which
  490. case the interface can be dictated by the upper level.11 LispWhat all this implies is that there is hope for a new Lisp. There
  491. is hope for any language that gives hackers what they want, including
  492. Lisp. I think we may have made a mistake in thinking that hackers
  493. are turned off by Lisp's strangeness. This comforting illusion may
  494. have prevented us from seeing the real problem with Lisp, or at
  495. least Common Lisp, which is that it sucks for doing what hackers
  496. want to do. A hacker's language needs powerful libraries and
  497. something to hack. Common Lisp has neither. A hacker's language is
  498. terse and hackable. Common Lisp is not.The good news is, it's not Lisp that sucks, but Common Lisp. If we
  499. can develop a new Lisp that is a real hacker's language, I think
  500. hackers will use it. They will use whatever language does the job.
  501. All we have to do is make sure this new Lisp does some important
  502. job better than other languages.History offers some encouragement. Over time, successive new
  503. programming languages have taken more and more features from Lisp.
  504. There is no longer much left to copy before the language you've
  505. made is Lisp. The latest hot language, Python, is a watered-down
  506. Lisp with infix syntax and no macros. A new Lisp would be a natural
  507. step in this progression.I sometimes think that it would be a good marketing trick to call
  508. it an improved version of Python. That sounds hipper than Lisp. To
  509. many people, Lisp is a slow AI language with a lot of parentheses.
  510. Fritz Kunze's official biography carefully avoids mentioning the
  511. L-word. But my guess is that we shouldn't be afraid to call the
  512. new Lisp Lisp. Lisp still has a lot of latent respect among the
  513. very best hackers — the ones who took 6.001 and understood it, for
  514. example. And those are the users you need to win.In "How to Become a Hacker," Eric Raymond describes Lisp as something
  515. like Latin or Greek — a language you should learn as an intellectual
  516. exercise, even though you won't actually use it:
  517. Lisp is worth learning for the profound enlightenment experience
  518. you will have when you finally get it; that experience will make
  519. you a better programmer for the rest of your days, even if you
  520. never actually use Lisp itself a lot.
  521. If I didn't know Lisp, reading this would set me asking questions.
  522. A language that would make me a better programmer, if it means
  523. anything at all, means a language that would be better for programming.
  524. And that is in fact the implication of what Eric is saying.As long as that idea is still floating around, I think hackers will
  525. be receptive enough to a new Lisp, even if it is called Lisp. But
  526. this Lisp must be a hacker's language, like the classic Lisps of
  527. the 1970s. It must be terse, simple, and hackable. And it must have
  528. powerful libraries for doing what hackers want to do now.In the matter of libraries I think there is room to beat languages
  529. like Perl and Python at their own game. A lot of the new applications
  530. that will need to be written in the coming years will be
  531. server-based
  532. applications. There's no reason a new Lisp shouldn't have string
  533. libraries as good as Perl, and if this new Lisp also had powerful
  534. libraries for server-based applications, it could be very popular.
  535. Real hackers won't turn up their noses at a new tool that will let
  536. them solve hard problems with a few library calls. Remember, hackers
  537. are lazy.It could be an even bigger win to have core language support for
  538. server-based applications. For example, explicit support for programs
  539. with multiple users, or data ownership at the level of type tags.Server-based applications also give us the answer to the question
  540. of what this new Lisp will be used to hack. It would not hurt to
  541. make Lisp better as a scripting language for Unix. (It would be
  542. hard to make it worse.) But I think there are areas where existing
  543. languages would be easier to beat. I think it might be better to
  544. follow the model of Tcl, and supply the Lisp together with a complete
  545. system for supporting server-based applications. Lisp is a natural
  546. fit for server-based applications. Lexical closures provide a way
  547. to get the effect of subroutines when the ui is just a series of
  548. web pages. S-expressions map nicely onto html, and macros are good
  549. at generating it. There need to be better tools for writing
  550. server-based applications, and there needs to be a new Lisp, and
  551. the two would work very well together.12 The Dream LanguageBy way of summary, let's try describing the hacker's dream language.
  552. The dream language is
  553. beautiful, clean, and terse. It has an
  554. interactive toplevel that starts up fast. You can write programs
  555. to solve common problems with very little code. Nearly all the
  556. code in any program you write is code that's specific to your
  557. application. Everything else has been done for you.The syntax of the language is brief to a fault. You never have to
  558. type an unnecessary character, or even to use the shift key much.Using big abstractions you can write the first version of a program
  559. very quickly. Later, when you want to optimize, there's a really
  560. good profiler that tells you where to focus your attention. You
  561. can make inner loops blindingly fast, even writing inline byte code
  562. if you need to.There are lots of good examples to learn from, and the language is
  563. intuitive enough that you can learn how to use it from examples in
  564. a couple minutes. You don't need to look in the manual much. The
  565. manual is thin, and has few warnings and qualifications.The language has a small core, and powerful, highly orthogonal
  566. libraries that are as carefully designed as the core language. The
  567. libraries all work well together; everything in the language fits
  568. together like the parts in a fine camera. Nothing is deprecated,
  569. or retained for compatibility. The source code of all the libraries
  570. is readily available. It's easy to talk to the operating system
  571. and to applications written in other languages.The language is built in layers. The higher-level abstractions are
  572. built in a very transparent way out of lower-level abstractions,
  573. which you can get hold of if you want.Nothing is hidden from you that doesn't absolutely have to be. The
  574. language offers abstractions only as a way of saving you work,
  575. rather than as a way of telling you what to do. In fact, the language
  576. encourages you to be an equal participant in its design. You can
  577. change everything about it, including even its syntax, and anything
  578. you write has, as much as possible, the same status as what comes
  579. predefined.Notes[1] Macros very close to the modern idea were proposed by Timothy
  580. Hart in 1964, two years after Lisp 1.5 was released. What was
  581. missing, initially, were ways to avoid variable capture and multiple
  582. evaluation; Hart's examples are subject to both.[2] In When the Air Hits Your Brain, neurosurgeon Frank Vertosick
  583. recounts a conversation in which his chief resident, Gary, talks
  584. about the difference between surgeons and internists ("fleas"):
  585. Gary and I ordered a large pizza and found an open booth. The
  586. chief lit a cigarette. "Look at those goddamn fleas, jabbering
  587. about some disease they'll see once in their lifetimes. That's
  588. the trouble with fleas, they only like the bizarre stuff. They
  589. hate their bread and butter cases. That's the difference between
  590. us and the fucking fleas. See, we love big juicy lumbar disc
  591. herniations, but they hate hypertension...."
  592. It's hard to think of a lumbar disc herniation as juicy (except
  593. literally). And yet I think I know what they mean. I've often had
  594. a juicy bug to track down. Someone who's not a programmer would
  595. find it hard to imagine that there could be pleasure in a bug.
  596. Surely it's better if everything just works. In one way, it is.
  597. And yet there is undeniably a grim satisfaction in hunting down
  598. certain sorts of bugs.