1. 4

  2. 6

    The Python lambda isn’t quite the same as lambda in Lisp, but as far as I can tell, but it’s pretty close. Anonymous functions are cool, and Python has that coolness.

    Scheme gets lexical scope mostly right. The way the top-level environment is handled in the REPL is slightly wrong (in spite of its name, define does not always define a new symbol), but it is not too wrong. Most importantly, it will not affect you if you are batch compiling your programs the good old-fashioned way, which is when correctness matters the most.

    The same cannot be said about Python. Environments are mutable dictionaries just like any other. There is a little bit of syntactic sugar for manipulating those dictionaries, because otherwise things would be too weird, and that is it.

    Unfortunately, without lexical scope, lambda is just another letter in the Greek alphabet.

    1. 5

      Python is like Lisp. Ruby is like Lisp. Julia is like Lisp. Lots of languages are like Lisp. But none of them is lisp.

      1. 1

        Sure, but Julia is much more like lisp than the others. It is a real lisp under the hood, it just has syntactic sugar (that can always be desugared to an s expression).

        The same cannot be said for many other supposedly lisp-like languages.

        Also, you can write Julia with s-expressions using a simple macro :)

        Check out LispSyntax.jl and LispRepl.jl

      2. 4
        1. 1

          Thank you! This was the kind of nuts and bolts comparison I’d hoped for given the article’s title :)

        2. 4

          …if you squint hard enough.

          1. 2

            I’ve started to ramble a bit, but my main point is this: Python is not a bad language, and has some similarities with Lisp languages. This is not to say that Python is really the same as a Lisp, just to point out to myself that judging people based on what language they are using is unpleasant and unnecessary.

            OK, slight issue with the article’s topic. The article starts out asserting that Python is like LISP but actually provides scant evidence to back up this assertion, and finishes with “Python is a good language for teaching”.

            I don’t necessarily agree with any of that, but I felt let down because as a regular Python user I find myself thinking its similarities with LISP are mostly conceptual.

            1. 2

              It’s been a trend for some time, Python has been taking over the introduction to CS courses because it makes some nice compromise that actually help when learning. I liked it a lot but I currently loathe it a little seeing some resources available to LISPers, I liked “the little schemer” a little too much and it beats any Python introduction I have been given by far.