merits of Lisp vs Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tayssir.john@googlemail.com

    #196
    Re: merits of Lisp vs Python

    mystilleef wrote:
    John Thingstad wrote:
    You might even find out if you ever learnt how to use it.
    >
    Donkeys have wings.
    Please stop misinforming your fellow Python users. Feel free to look up
    "CLOS" and the "metaobject protocol." Further, Lisp is not a functional
    language like Scheme; it has unusually powerful iteration and array
    facilities.

    Common Lisp's OOP has multiple inheritance, a metaobject protocol,
    method combinations, generic functions. I realize these sound like
    buzzwords to you; I vaguely recall this being a nice video intro:
    <http://www.archive.org/details/DanielGB1987>


    Alan Kay coined the term object oriented programming, and I think
    you'll enjoy his keynote "The computer revolution hasn't happened yet."
    At 54:30, he praised the book explaining Common Lisp's metobject
    protocol as being the "best book anybody's written in ten years", for
    containing "some of the most profound insights, and the most practical
    insights about OOP, that anybody has done about OOP in the last many
    years."
    <http://video.google.co m/videoplay?docid =-295094973005975 4521>

    And he offered a Limoge Balloon award to anyone who'd simply rewrite
    the book so that the general OOP community could understand it, for
    being "a great service to mankind."

    The concepts in that book underlie Lisp's modern OOP system.


    Further, you portray Lisp as a "functional " language. But it is a
    powerful iterative language. Check out LOOP, a powerful iteration
    facility. Check out its powerful multidimensiona l arrays, which are
    adjustable and have fill-pointers.


    There exist legitimate criticisms of Common Lisp, and I've even written
    a page with "gotchas." One should remain appropriately skeptical of
    Lisp users' claims, because they too can mislead. I wish we could
    critique thoughtfully. On the basis of facts, not invented claims.


    Tayssir

    Comment

    • tayssir.john@googlemail.com

      #197
      Re: merits of Lisp vs Python

      tayssir.j...@go oglemail.com wrote
      Further, Lisp is not a functional
      language like Scheme; it has unusually powerful iteration and array
      facilities.
      Excuse me, I mean to say it is not a pure functional language.

      Tayssir

      Comment

      • Ken Tilton

        #198
        Re: merits of Lisp vs Python



        Paul Rubin wrote:
        Ken Tilton <kentilton@gmai l.comwrites:
        >
        >>yeah, I think it is. Folks don't vary that much. If every Lisp
        >>programmer also reports parens disappearing at about thirty days, any
        >>given non-Lispnik can pretty much bet on the same experience.
        >
        >
        I think an editing program that balances parens automatically is near
        indispensible for writing Lisp code.
        I would say indispensible full stop.
        I can't stand writing Lisp
        without Emacs.
        Emacs or an Emacs-like editor (or at least Lisp-ware editor) provided by
        the Lisp environment.

        ken

        --
        Algebra: http://www.tilton-technology.com/LispNycAlgebra1.htm

        "Well, I've wrestled with reality for thirty-five
        years, Doctor, and I'm happy to state I finally
        won out over it." -- Elwood P. Dowd

        "I'll say I'm losing my grip, and it feels terrific."
        -- Smiling husband to scowling wife, New Yorker cartoon

        Comment

        • Paul Rubin

          #199
          Re: merits of Lisp vs Python

          Mathias Panzenboeck <e0427417@stude nt.tuwien.ac.at writes:
          I currently visit a course about functional programming at the
          university of technology vienna: python implements only a small
          subset of things needed to be called a functional language (list
          comprehension). but yes, for a imperativ oop language python is
          very close to functional.
          List comprehensions are just fairly trivial syntax sugar. The essence
          of functional programming is being able to construct new functions on
          the fly, and Python does that. See Hughes' paper "Why functional
          programming matters" and imagine doing the examples in Python vs. doing
          them in Java.

          Comment

          • Paul Rubin

            #200
            Re: merits of Lisp vs Python

            Bill Atkins <atkinw@rpi.edu writes:
            Lest anyone interpret that list as exhaustive: http://www.cl-user.net/
            What have you got for concurrency? How would you write a
            multi-threaded web server in Lisp?

            Comment

            • BJörn Lindqvist

              #201
              Re: merits of Lisp vs Python

              Maybe so. But I've only ever appreciated its functional aspects. I
              wouldn't choose Lisp or its derivatives for OO related tasks even if
              I'm high.
              >
              But CLOS is the best OO there is. The OMG said so. It can do anything
              any other OO can do. Why /specifically/ would you not use it? This type
              Specifically it does not have name spaces. Therefore it is
              fundamentally flawed and cannot be used as a serious object-oriented
              tool for developing complex applications. However, I'll give you that
              it is pretty nice for pet-projects and educational purposes (counting
              parenthesises). But for some, that is more than enough.

              --
              mvh Björn

              Comment

              • Bill Atkins

                #202
                Re: merits of Lisp vs Python

                Paul Rubin <http://phr.cx@NOSPAM.i nvalidwrites:
                Bill Atkins <atkinw@rpi.edu writes:
                >Lest anyone interpret that list as exhaustive: http://www.cl-user.net/
                >
                What have you got for concurrency? How would you write a
                multi-threaded web server in Lisp?
                Multithreading is not a standard part of ANSI CL, but in practice all
                Lisps (with the major exception of the CLISP implementation) support
                threading.

                Hunchentoot is, in fact, a multi-threaded web server written in Lisp.
                :) There are also others, like AllegroServe and Araneida.

                There are compatibility layers that smooth over some of these
                implementation-dependent areas of Common Lisp. Bordeaux-threads is
                the package that provides a common interface to the different
                threading implementations :


                Comment

                • Steven D'Aprano

                  #203
                  Re: merits of Lisp vs Python

                  On Sat, 09 Dec 2006 22:29:45 +0100, John Thingstad wrote:
                  >Maybe so. But I've only ever appreciated its functional aspects. I
                  >wouldn't choose Lisp or its derivatives for OO related tasks even if
                  >I'm high.
                  >>
                  >
                  You are just being silly.
                  Lisp's OO environment CLOS is vastly superior to Python classes.
                  Both in terms of expressive power and flexibility.
                  Oh, well, with evidence like that, I'm convinced!

                  Python is fine if you approach programming as Lego, simply gluing
                  together libraries.
                  But if you want to do some serious algorithmic's you may find that it is
                  just to slow.
                  Nobody ever said that Python was idea for serious number crunching
                  (although see numpy -- use the right tool for the job). If I knew what
                  sort of "serious algorithmics" you meant, I could comment.


                  --
                  Steven.

                  Comment

                  • Steven D'Aprano

                    #204
                    Re: merits of Lisp vs Python

                    On Sat, 09 Dec 2006 13:50:24 -0800, Kaz Kylheku wrote:
                    Steven D'Aprano wrote:
                    >But Lisp's syntax is so unlike most written natural languages that that it
                    >is a whole different story.
                    >
                    Bahaha!
                    >
                    >Yes, the human brain is amazingly flexible,
                    >and people can learn extremely complex syntax and grammars (especially if
                    >they start young enough) so I'm not surprised that there are thousands,
                    >maybe tens or even hundreds of thousands of Lisp developers who find the
                    >language perfectly readable.
                    >
                    1'(especially if they start young enough)
                    (ESPECIALLY IF THEY START YOUNG ENOUGH)
                    2(sixth *)
                    ENOUGH
                    >
                    ... said!
                    >
                    Yeah, so /unlike/ written natural languages!
                    >
                    What a fucking moron.

                    Oh my god! Lisp can echo STRINGS to the interpreter???? Why didn't
                    somebody somebody tell me that!!!! That *completely* changes my mind about
                    the language!

                    I'm especially impressed that it knew I wanted them printed in uppercase
                    without being told.



                    --
                    Steven.

                    Comment

                    • André Thieme

                      #205
                      Re: merits of Lisp vs Python

                      Ken Tilton schrieb:
                      The last time we went thru this a Pythonista finally said, Oh, I get it.
                      These five lines of code I have to write all the time (two setup, one
                      func call, two cleanup) can be collapsed into one or two. The thread
                      will be hard to miss in Google groups (two years back?) and the epiphany
                      appears right at the end of the thread. <hint>
                      Functional programming is the solution here, not Lisp.

                      You could make that with a new function (in Python), that takes a
                      function (and its args, don't remember the correct syntax).

                      def foo(function, args):
                      setup(1)
                      setup(2)
                      function(args)
                      cleanup(1)
                      cleanup(2)


                      The nice thing in Lisp would now be to save a lambda with the macro.
                      In Python one would fill the name space with throw away functions that
                      get called only one time.


                      André
                      --

                      Comment

                      • Aahz

                        #206
                        Re: merits of Lisp vs Python

                        In article <7xac1wr7t9.fsf @ruckus.brouhah a.com>,
                        Paul Rubin <http://phr.cx@NOSPAM.i nvalidwrote:
                        >
                        >I think an editing program that balances parens automatically is near
                        >indispensibl e for writing Lisp code. I can't stand writing Lisp
                        >without Emacs.
                        And that is why I will never write Lisp. I loathe Emacs.
                        --
                        Aahz (aahz@pythoncra ft.com) <* http://www.pythoncraft.com/

                        Member of the Groucho Marx Fan Club

                        Comment

                        • tac-tics

                          #207
                          Re: merits of Lisp vs Python

                          I think the lesson here is that LISP is the language you use when you
                          want mathematical elegance and perfection and Python is the language
                          you use if you want to actually program stuff.

                          Comment

                          • Ken Tilton

                            #208
                            Re: merits of Lisp vs Python



                            André Thieme wrote:
                            Ken Tilton schrieb:
                            >
                            >The last time we went thru this a Pythonista finally said, Oh, I get
                            >it. These five lines of code I have to write all the time (two setup,
                            >one func call, two cleanup) can be collapsed into one or two. The
                            >thread will be hard to miss in Google groups (two years back?) and the
                            >epiphany appears right at the end of the thread. <hint>
                            >
                            >
                            Functional programming is the solution here, not Lisp.
                            No, you do not understand. The Pythonista figured it out: a function
                            would not do.
                            >
                            You could make that with a new function (in Python), that takes a
                            function (and its args, don't remember the correct syntax).
                            >
                            def foo(function, args):
                            setup(1)
                            setup(2)
                            function(args)
                            cleanup(1)
                            cleanup(2)
                            >
                            >
                            The nice thing in Lisp would now be to save a lambda with the macro.
                            In Python one would fill the name space with throw away functions that
                            get called only one time.
                            Omigod. Is that what you meant? You think macros are unnecessary because
                            one could hard-code their expansions as separate functions? And that
                            would constitute hiding the boilerplate? What happens when the
                            boilerplate changes? <game over>

                            ken

                            --
                            Algebra: http://www.tilton-technology.com/LispNycAlgebra1.htm

                            "Well, I've wrestled with reality for thirty-five
                            years, Doctor, and I'm happy to state I finally
                            won out over it." -- Elwood P. Dowd

                            "I'll say I'm losing my grip, and it feels terrific."
                            -- Smiling husband to scowling wife, New Yorker cartoon

                            Comment

                            • André Thieme

                              #209
                              Re: merits of Lisp vs Python

                              Ken Tilton schrieb:
                              >
                              >
                              André Thieme wrote:
                              >Ken Tilton schrieb:
                              >>
                              >>The last time we went thru this a Pythonista finally said, Oh, I get
                              >>it. These five lines of code I have to write all the time (two setup,
                              >>one func call, two cleanup) can be collapsed into one or two. The
                              >>thread will be hard to miss in Google groups (two years back?) and
                              >>the epiphany appears right at the end of the thread. <hint>
                              >>
                              >>
                              >Functional programming is the solution here, not Lisp.
                              >
                              No, you do not understand. The Pythonista figured it out: a function
                              would not do.
                              What do you mean?


                              >You could make that with a new function (in Python), that takes a
                              >function (and its args, don't remember the correct syntax).
                              >>
                              >def foo(function, args):
                              > setup(1)
                              > setup(2)
                              > function(args)
                              > cleanup(1)
                              > cleanup(2)
                              >>
                              >>
                              >The nice thing in Lisp would now be to save a lambda with the macro.
                              >In Python one would fill the name space with throw away functions that
                              >get called only one time.
                              >
                              Omigod. Is that what you meant? You think macros are unnecessary because
                              one could hard-code their expansions as separate functions? And that
                              would constitute hiding the boilerplate? What happens when the
                              boilerplate changes? <game over>
                              Well, macros are unnecessary from a mathematical point of view: 0 and
                              1 are enough. But of course they have the potential to be a real time
                              saver. What I want to say is: the situation you gave as an example is
                              not the place where macros shine, because 1st class functions can take
                              over.

                              You could maybe give another example: how would one realize something
                              like (memoize function) in Python?
                              Or (defmethod name :after ..)?


                              André
                              --

                              Comment

                              • Ken Tilton

                                #210
                                Re: merits of Lisp vs Python



                                André Thieme wrote:
                                Ken Tilton schrieb:
                                >
                                >>
                                >>
                                >André Thieme wrote:
                                >>
                                >>Ken Tilton schrieb:
                                >>>
                                >>>The last time we went thru this a Pythonista finally said, Oh, I get
                                >>>it. These five lines of code I have to write all the time (two
                                >>>setup, one func call, two cleanup) can be collapsed into one or two.
                                >>>The thread will be hard to miss in Google groups (two years back?)
                                >>>and the epiphany appears right at the end of the thread. <hint>
                                >>>
                                >>>
                                >>>
                                >>Functional programming is the solution here, not Lisp.
                                >>
                                >>
                                >No, you do not understand. The Pythonista figured it out: a function
                                >would not do.
                                >
                                >
                                What do you mean?
                                I am saying use Google groups to find the thread and find out the use
                                case contributed by a Pythonista in the midddle of a similar thread that
                                conveyed to his satisfaction the value of macros.

                                ken

                                --
                                Algebra: http://www.tilton-technology.com/LispNycAlgebra1.htm

                                "Well, I've wrestled with reality for thirty-five
                                years, Doctor, and I'm happy to state I finally
                                won out over it." -- Elwood P. Dowd

                                "I'll say I'm losing my grip, and it feels terrific."
                                -- Smiling husband to scowling wife, New Yorker cartoon

                                Comment

                                Working...