5 ms·
PG: "It seems to me that there have been two really clean, consistent models of programming so far: the C model and the Lisp model. These two seem points of hig
by charlieok 15y ago
PG: "It seems to me that there have been two really clean, consistent models of programming so far: the C model and the Lisp model. These two seem points of high ground, with swampy lowlands between them."
We lost founders of both in the last couple weeks. Ritchie for C, McCarthy for Lisp.
What's cool about the paper Paul is talking about here: if you start with car, cdr, cons, quote, cond, atom, eq, and a notation for functions expressed as lists, you can write an "eval" function reimplementing the language. The rest can be built on top of it.
Graham calls this an "axiomatization of computation". The notion of a Turing machine was already well known before McCarthy's paper, and is its own fundamental description of computation. Then came this high-level language which constitues a new one. It isn't "THE axiomatization of computation", just "AN axiomatization of computation".
PG continues the story in a later essay, "Revenge of the Nerds":
"What happened next was that, some time in late 1958, Steve Russell, one of McCarthy's grad students, looked at this definition of eval and realized that if he translated it into machine language, the result would be a Lisp interpreter."
"This was a big surprise at the time. Here is what McCarthy said about it later in an interview:"
"'Steve Russell said, look, why don't I program this eval..., and I said to him, ho, ho, you're confusing theory with practice, this eval is intended for reading, not for computing. But he went ahead and did it. That is, he compiled the eval in my paper into [IBM] 704 machine code, fixing bugs, and then advertised this as a Lisp interpreter, which it certainly was. So at that point Lisp had essentially the form that it has today....'"
"Suddenly, in a matter of weeks I think, McCarthy found his theoretical exercise transformed into an actual programming language-- and a more powerful one than he had intended."
http://www.paulgraham.com/icad.html http://www.paulgraham.com/icad.html
Pretty cool story :)
- Peaker 15y agoThere are more clean, consistent and interesting models of programming besides the C and Lisp models. The Ml/Haskell family of languages. Logic languages (though these are somewhat subsumed by the former). Dependent-type languages.
- 0x12 15y agoTILs such as forth. Smalltalk. What family does APL belong to?
- gruseom 15y agoCertainly its own family, along with its successors J and K.
- Peaker 15y agoYou could argue those languages are not very clean, at least syntactic-wise.
- silentbicycle 15y agoDon't confuse having lots of operators with being unclean. They're syntactically more internally consistent than Common Lisp, for example.
- gtani 15y agohttp://www.info.ucl.ac.be/~pvr/paradigmsDIAGRAMeng101.pdf http://www.info.ucl.ac.be/~pvr/paradigmsDIAGRAMeng101.pdf http://news.ycombinator.com/item?id=3150277 http://news.ycombinator.com/item?id=3150277
- swannodette 15y agoThe Lisp system is a meta model. Thus you can implement a Lisp that works like ML/Haskell/Prolog if you like. ML/Haskell don't seem to provide that kind of meta power as cleanly or consistently IME. Prolog has a good meta model, but it doesn't seem to subsume other models as cleanly, consistently, or efficiently as Lisp.
- Peaker 15y agoImplementing a Lisp that works like ML/Haskell will be as much work as implementing a compiler/interpreter of these languages outside of Lisp. The macro system is not a great compiler toolkit for languages with semantics radically different from Lisp. Lisp thus does not really subsume these languages.
- erichocean 15y agoForth is the third model -- very clean and consistent, and still widely used. (Forth is usually the first HLL to get working on a new chip due to its simplicity.) If you're looking for a modern stack-language implementation, give Factor a try: http://factorcode.org/ http://factorcode.org/
- RodgerTheGreat 15y agoI think Forth is particularly notable for providing metaprogramming facilities which are arguably on par with Lisp while taking a completely different approach. Lisp represents code and data the same way and can manipulate both with ease. Forth has what might be described as an "interactive compiler" which can be easily extended during the compilation process. Since an immediate word can hijack the parser, you could theoretically build Forth out into a reasonable facsimilie of any other language if you so desired. These capabilities are already used in most Forth distributions to provide things like flow control, comments and string literals.
- gruseom 15y ago"Steve Russell said, look, why don't I program this eval..., and I said to him, ho, ho, you're confusing theory with practice, this eval is intended for reading, not for computing. But he went ahead and did it." Here is the point in the story where we need Norvig's annotation from PAIP (p. 777): "So the first Lisp interpreter was the result of a programmer ignoring his boss's advice." I like to think that the "ho, ho" in the original quote means that McCarthy appreciated this.
- vorg 15y agoIn a meeting, the person who suggests a good idea and the person who recognizes a good idea are usually two different people.