Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Roots of Lisp (paulgraham.com)
47 points by prakash on Jan 1, 2010 | hide | past | favorite | 9 comments


One note of interest about pg's source code is that the dot functions (and., pair., etc...) are based in the host Lisp and not `eval.`. The implications are that pg's functions can take advantage of lexical scope, whereas McCarthy's original Lisp was dynamically scoped. This will make a huge difference if you are so inclined to use pg's code to do some hardcore Lisp anthropology. I did so a few years back using pg's code and it was a blast. I then wrote a small Lisp runtime with dynamic scope (http://github.com/fogus/lithp) to do the same exercise and it turned out to be a very different experience. It's worth trying it out to gain a full appreciation for the tools the Lisp pioneer's had to work with.

Thanks for linking this article -- it's one of my favorites.


"The Roots of LISP" include Herbert Simon and Allen Newell too. They co-invented the linked list (once called "NSS memory") in the mid 1950s, setting the stage for LISP and earning them a Turing award (McCarthy got his own). They were founders of AI and implemented some really neat software like the General Problem Solver. See Simon's "The Sciences of the Artificial" or his Nobel prize lecture, and "Unified Theories of Cognition" by Newell.


link to complete article in ps: http://lib.store.yahoo.net/lib/paulgraham/jmc.ps


Typo/error on page 4 (of postscript version)?

((lambda (f) (f '(b c))) '(lambda (x) (cons 'a x)))

afaics, the 2nd lambda shouldn't be quoted.



He states that Python sort-of has a symbol type like Lisp, but that there isn't a syntax for it. Could someone help me understand what he's talking about?


Short strings in Python are interned, i.e. 'foo' always returns the same string, not just an identical one.

There's some noise but the important part is that both x and y have the same address (0x37e300) and point to the same str object.

    Python 2.6.4 (r264:75706, Nov 25 2009, 21:38:24) 
    [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> x='foo'
    >>> y='foo'
    >>> x.__add__
    <method-wrapper '__add__' of str object at 0x37e300>
    >>> y.__add__
    <method-wrapper '__add__' of str object at 0x37e300>
    >>> x is y
    True
and a counter-example just for fun:

    >>> x='this is a longer string. i wonder what the limit is?!'
    >>> y='this is a longer string. i wonder what the limit is?!'
    >>> x.__add__
    <method-wrapper '__add__' of str object at 0x35a840>
    >>> y.__add__
    <method-wrapper '__add__' of str object at 0x35a890>
    >>> x is y
    False


Strings. Python allows you to manipulate an object's structure through the __dict__ field (as far as I can remember), and dir() also returns strings. They are ad hoc symbols.


I know that, but there already exists a syntax for strings. I thought he was implying something more.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: