Python syntax in Lisp and Scheme

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kenny Tilton

    #16
    Re: Python syntax in Lisp and Scheme



    Toni Nikkanen wrote:
    [color=blue]
    > kalath@lycos.co m (Mark Brady) writes:
    >
    >[color=green]
    >>just me, I prefer S-exps and there seems to be a rebirth in the Scheme
    >>and Common Lisp communities at the moment. Ironically this seems to
    >>have been helped by python. I learned python then got interested in
    >>it's functional side and ended up learning Scheme and Common Lisp.[/color]
    >
    >
    > It's be interesting to know where people got the idea of learning
    > Scheme/LISP from (apart from compulsory university courses)?[/color]

    <g> We wonder alike. That's why I started:



    That recently got repotted from another cliki and it's a little mangled,
    but until after ILC2003 I am a little too swamped to clean it up. But
    there is still a lot of good stuff in there. On this page I grouped
    folks according to different routes to Lisp (in the broadest sense of
    that term): http://alu.cliki.net/The%20RtLS%20by%20Road

    You will find some old-timers because I made the survey super-inclusive,
    but my real interest was the same as yours: where are the New Lispniks
    coming from?

    Speaking of which, Mark Brady cited Python as a stepping-stone, and I
    have been thinking that might happen, but the survey has yet to confirm.
    Here's one: http://alu.cliki.net/Robbie%20Sedgew ick's%20Road%20 to%20Lisp

    So Ping! Mark Brady, please hie ye (and all the others who followed the
    same road to Lisp) to the survey and correct the record.

    I think[color=blue]
    > that for me, it was the LPC language used in LPmuds. It had a
    > frightening feature called lambda closures, and useful functions such
    > as map and filter. Then one day I just decided to bite the bullet and
    > find out where the heck all that stuff came from (my background was
    > strongly in C-like languages at that point. LPC is like C with some
    > object-oriented and some FP features.)
    >
    > Yes, I know, there's nothing frightening in lambda closures. But the
    > way they were implemented in LPC (actually just the syntax) was
    > terrible :)[/color]

    You could cut and paste that into the survey as well. :)

    kenny

    Comment

    • Terry Reedy

      #17
      Re: Python syntax in Lisp and Scheme


      "Mark Brady" <kalath@lycos.c om> wrote in message
      news:e840346c.0 310030302.6be0c 378@posting.goo gle.com...[color=blue]
      > This whole thread is a bad idea.[/color]

      I could agree that the OP's suggestion is a bad idea but do you
      actually think that discussion and more publicity here for Lisp/Scheme
      is bad? You make a pretty good pitch below for more Python=>Lisp
      converts.
      [color=blue]
      > If you like python then use python.[/color]

      As I plan to do.
      [color=blue]
      > Personally I find Scheme and Common Lisp easier to read but that's
      > just me, I prefer S-exps and there seems to be a rebirth in the[/color]
      cheme[color=blue]
      > and Common Lisp communities at the moment. Ironically this seems to
      > have been helped by python. I learned python then got interested in
      > it's functional side and ended up learning Scheme and Common Lisp. A
      > lot of new Scheme and Common Lisp developers I talk to followed the
      > same route. Python is a great language and I still use it for some
      > things.[/color]

      Other Lispers posting here have gone to pains to state that Scheme is
      not a dialect of Lisp but a separate Lisp-like language. Could you
      give a short listing of the current main differences (S vs. CL)? If I
      were to decide to expand my knowledge be exploring the current
      versions of one(I've read the original SICP and LISP books), on what
      basis might I make a choice?

      Terry J. Reedy



      Comment

      • Toni Nikkanen

        #18
        Re: Python syntax in Lisp and Scheme

        Kenny Tilton <ktilton@nyc.rr .com> writes:
        [color=blue]
        > Speaking of which, Mark Brady cited Python as a stepping-stone, and I
        > have been thinking that might happen, but the survey has yet to
        > confirm.[/color]

        It usually happens that when I google for some scheme/lisp-isms,
        I get lots of Python mailing list messages as results. There's
        something going on with that.

        Comment

        • Kenny Tilton

          #19
          Re: Python syntax in Lisp and Scheme



          Kenny Tilton wrote:
          [color=blue]
          >
          >
          > Toni Nikkanen wrote:
          >[color=green]
          >> It's be interesting to know where people got the idea of learning
          >> Scheme/LISP from (apart from compulsory university courses)?[/color]
          >
          >
          > <g> We wonder alike. That's why I started:
          >
          > http://alu.cliki.net/The%20Road%20to%20Lisp%20Survey
          >
          > That recently got repotted from another cliki and it's a little mangled,
          > but until after ILC2003 I am a little too swamped to clean it up.[/color]

          Me and my big mouth. Now that I have adevrtised the survey far and wide,
          and revisited it and seen up close the storm damage, sh*t, there goes
          the morning. :) Well, I needed a break from RoboCells:

          Download RoboCells for free. A Common Lisp starter kit for developing RoboCup clients.


          I am going to do what I can to fix up at least the road categorization,
          and a quick glance revealed some great new entries, two that belong in
          my Top Ten (with apologies to those getting bumped).

          kenny

          Comment

          • Lothar Scholz

            #20
            Re: Python syntax in Lisp and Scheme

            Paul Rubin <http://phr.cx@NOSPAM.i nvalid> wrote in message news:<7xvfr6lvh 6.fsf@ruckus.br ouhaha.com>...[color=blue]
            > mike420@ziplip. com writes:[color=green]
            > > If the answer is yes, would many Python programmers switch to Lisp
            > > or Scheme if they were offered identation-based syntax?[/color]
            >
            > I don't think the syntax is that big a deal. But programming in lisp
            > or scheme has a creaky feeling these days, because the traditional
            > runtime libraries in those languages have fallen so far behind the
            > times.[/color]

            Funny. Yesterday i downloaded the trial version of Franz Lisp (Allegro
            CL).
            I can'T say if the runtime libraries are out of date because there is
            absolute no documentation for the runtime libraries - of course they
            also bundle the ANSI-Common Lisp book.

            I found that they still want to sell every fucking line of code in an
            extra library raising the price to an unexceptable high value.

            Comment

            • Jeremy H. Brown

              #21
              Re: Python syntax in Lisp and Scheme

              "Terry Reedy" <tjreedy@udel.e du> writes:[color=blue]
              > Other Lispers posting here have gone to pains to state that Scheme is
              > not a dialect of Lisp but a separate Lisp-like language. Could you
              > give a short listing of the current main differences (S vs. CL)?[/color]

              According to the "Revised(5) Report on the Algorithmic Language
              Scheme", "Scheme is a statically scoped and properly tail-recursive
              dialect of the Lisp programming language..." It's certainly not a
              dialect of Common Lisp, although it is one of CL's ancestors.

              I'm sure if you do some web-groveling, you can find some substantial
              comparisons of the two; I personally think they have more in common
              than not. Here are a few of the (arguably) notable differences:

              Scheme Common Lisp
              Philosophy minimalism comprehensivene ss
              Namespaces one two (functions, variables)
              Continuations yes no
              Object system no yes
              Exceptions no yes
              Macro system syntax-rules defmacro
              Implementations >10 ~4
              Performance "worse" "better"
              Standards IEEE ANSI
              Reference name R5RS CLTL2
              Reference length 50pp 1029pp
              Standard libraries "few" "more"
              Support Community Academic Applications writers

              The Scheme community has the SRFI process for developing additional
              almost-standards. I don't know if the CL community has something
              equivalent; I don't think they did a year ago.
              [color=blue]
              > If I were to decide to expand my knowledge be exploring the current
              > versions of one(I've read the original SICP and LISP books), on what
              > basis might I make a choice?[/color]

              Try them both, see which one works for you in what you're doing.

              Jeremy

              Comment

              • Paul Rubin

                #22
                Re: Python syntax in Lisp and Scheme

                Oren Tirosh <oren-py-l@hishome.net> writes:[color=blue]
                > Implementing Python-like syntax in LISP or even a full Python
                > implementation in LISP would be a worthwhile goal (LPython?). BTW, this
                > kind of implementation is one of the relatively few programming tasks
                > that can benefit greatly from macros. The Python semantics can be mostly
                > done using macros and a preprocessor would translated Python syntax to
                > s-expression code that uses those macros.[/color]

                If done straightforward ly, the language semantics would end up
                different from Python's in a few ways. For example, strings in most
                Lisp systems are mutable. Also, Python's class system doesn't map
                onto Lisp all that well; Python's variable-scoping rules are bizarre,
                and so forth. I think the result would still be worth doing but
                it would be a further departure from CPython than, say, Jython is.

                Comment

                • Duane Rettig

                  #23
                  Re: Python syntax in Lisp and Scheme

                  jhbrown@ai.mit. edu (Jeremy H. Brown) writes:
                  [color=blue]
                  > "Terry Reedy" <tjreedy@udel.e du> writes:[color=green]
                  > > Other Lispers posting here have gone to pains to state that Scheme is
                  > > not a dialect of Lisp but a separate Lisp-like language. Could you
                  > > give a short listing of the current main differences (S vs. CL)?[/color][/color]

                  [color=blue]
                  > I'm sure if you do some web-groveling, you can find some substantial
                  > comparisons of the two; I personally think they have more in common
                  > than not. Here are a few of the (arguably) notable differences:[/color]

                  This is actually a pretty good list. I'm not commenting on
                  completeness, but I do have a couple of corrections:
                  [color=blue]
                  > Scheme Common Lisp
                  > Philosophy minimalism comprehensivene ss
                  > Namespaces one two (functions, variables)
                  > Continuations yes no
                  > Object system no yes
                  > Exceptions no yes
                  > Macro system syntax-rules defmacro
                  > Implementations >10 ~4[/color]
                  =============== =============== =============^

                  See http://alu.cliki.net/Implementation - it lists 9 commercial
                  implementations , and 7 opensource implementations . There are
                  probably more.
                  [color=blue]
                  > Performance "worse" "better"
                  > Standards IEEE ANSI
                  > Reference name R5RS CLTL2[/color]
                  =============== =============== ==============^

                  No, CLtL2 is definitely _not_ a reference for ANSI Common Lisp.
                  It was a snapshot taken in the middle of the ANSI process, and
                  is out of date in several areas. References which are much closer
                  to the ANSI spec can be found online at



                  or


                  [color=blue]
                  > Reference length 50pp 1029pp
                  > Standard libraries "few" "more"
                  > Support Community Academic Applications writers
                  >
                  > The Scheme community has the SRFI process for developing additional
                  > almost-standards. I don't know if the CL community has something
                  > equivalent; I don't think they did a year ago.[/color]

                  There are many grassroots defacto standards efforts to extend CL in
                  several areas. Some of these are listed here:


                  [color=blue][color=green]
                  > > If I were to decide to expand my knowledge be exploring the current
                  > > versions of one(I've read the original SICP and LISP books), on what
                  > > basis might I make a choice?[/color]
                  >
                  > Try them both, see which one works for you in what you're doing.[/color]

                  Agreed, but of course, I'd recommend CL :-)

                  --
                  Duane Rettig duane@franz.com Franz Inc. http://www.franz.com/
                  555 12th St., Suite 1450 http://www.555citycenter.com/
                  Oakland, Ca. 94607 Phone: (510) 452-2000; Fax: (510) 452-0182

                  Comment

                  • Rayiner Hashem

                    #24
                    Re: Python syntax in Lisp and Scheme

                    > Object system no yes
                    To be fair, most Scheme implementations come with one, and you can always
                    download an external one if you want.
                    [color=blue]
                    > Macro system syntax-rules defmacro[/color]
                    Again, depends on the implementation. Gambit offers CL-style macros too.
                    [color=blue]
                    > Performance "worse" "better"[/color]
                    Depends on the implementation. Bigloo did a bit better on the Great Computer
                    Language Shootout than did CMUCL, though, there were complaints that the
                    CL-code was sub-par. In the few small benchmarks I've tried on my machine,
                    Bigloo is pretty competitive with CMUCL.

                    Comment

                    • Jeremy H. Brown

                      #25
                      Re: Python syntax in Lisp and Scheme

                      Duane Rettig <duane@franz.co m> writes:[color=blue]
                      > jhbrown@ai.mit. edu (Jeremy H. Brown) writes:
                      > This is actually a pretty good list. I'm not commenting on
                      > completeness, but I do have a couple of corrections:[/color]
                      ....[color=blue][color=green]
                      > > Implementations >10 ~4[/color]
                      > =============== =============== =============^
                      >
                      > See http://alu.cliki.net/Implementation - it lists 9 commercial
                      > implementations , and 7 opensource implementations . There are
                      > probably more.[/color]

                      Thanks. I hadn't realized the spread was that large.
                      [color=blue][color=green]
                      > > Performance "worse" "better"
                      > > Standards IEEE ANSI
                      > > Reference name R5RS CLTL2[/color]
                      > =============== =============== ==============^
                      >
                      > No, CLtL2 is definitely _not_ a reference for ANSI Common Lisp.
                      > It was a snapshot taken in the middle of the ANSI process, and
                      > is out of date in several areas. References which are much closer
                      > to the ANSI spec can be found online at
                      >
                      > http://www.franz.com/support/documen...icl/ansicl.htm
                      >
                      > or
                      >
                      > http://www.lispworks.com/reference/H...ront/index.htm[/color]

                      Thanks again.
                      [color=blue][color=green]
                      > >
                      > > Try them both, see which one works for you in what you're doing.[/color]
                      >
                      > Agreed, but of course, I'd recommend CL :-)[/color]

                      I've arrived at the conclusion that it depends both on your task/goal
                      and your personal inclinations.

                      Jeremy

                      Comment

                      • Marco Antoniotti

                        #26
                        Re: Python syntax in Lisp and Scheme



                        mike420@ziplip. com wrote:[color=blue]
                        > I think everyone who used Python will agree that its syntax is
                        > the best thing going for it. It is very readable and easy
                        > for everyone to learn. But, Python does not a have very good
                        > macro capabilities, unfortunately. I'd like to know if it may
                        > be possible to add a powerful macro system to Python, while
                        > keeping its amazing syntax, and if it could be possible to
                        > add Pythonistic syntax to Lisp or Scheme, while keeping all
                        > of the functionality and convenience. If the answer is yes,
                        > would many Python programmers switch to Lisp or Scheme if
                        > they were offered identation-based syntax?[/color]

                        Why do I feel like crying? :{

                        Cheers
                        --
                        Marco


                        Comment

                        • Alexander Schmolck

                          #27
                          Re: Python syntax in Lisp and Scheme

                          prunesquallor@c omcast.net writes:
                          [color=blue]
                          > mike420@ziplip. com writes:
                          >[color=green]
                          > > I think everyone who used Python will agree that its syntax is
                          > > the best thing going for it.[/color]
                          >
                          > I've used Python. I don't agree.[/color]

                          I'd be interested to hear your reasons. *If* you take the sharp distinction
                          that python draws between statements and expressions as a given, then python's
                          syntax, in particular the choice to use indentation for block structure, seems
                          to me to be the best choice among what's currently on offer (i.e. I'd claim
                          that python's syntax is objectively much better than that of the C and Pascal
                          descendants -- comparisons with smalltalk, prolog or lisp OTOH are an entirely
                          different matter).

                          'as

                          Comment

                          • Kenny Tilton

                            #28
                            Re: Python syntax in Lisp and Scheme



                            Kenny Tilton wrote:
                            [color=blue]
                            >
                            >
                            > Kenny Tilton wrote:
                            >[color=green]
                            >>
                            >>
                            >> Toni Nikkanen wrote:
                            >>[color=darkred]
                            >>> It's be interesting to know where people got the idea of learning
                            >>> Scheme/LISP from (apart from compulsory university courses)?[/color]
                            >>
                            >>
                            >>
                            >> <g> We wonder alike. That's why I started:
                            >>
                            >> http://alu.cliki.net/The%20Road%20to%20Lisp%20Survey
                            >>
                            >> That recently got repotted from another cliki and it's a little
                            >> mangled, but until after ILC2003 I am a little too swamped to clean it
                            >> up.[/color]
                            >
                            >
                            > Me and my big mouth. Now that I have adevrtised the survey far and wide,
                            > and revisited it and seen up close the storm damage, sh*t, there goes
                            > the morning. :)[/color]


                            OK, I copied over all the twenty-plus pages that got lost in the
                            repotting, fixed the survey questions, and even took the time to
                            annotate my Top Ten list:

                            http://alu.cliki.net/Kenny's%20RtLS% 20Top-Ten

                            Check it out. The Switch Date pages have been restored, but I do not
                            think the cross-indexing works until pages get edited and resaved. That
                            is not the most fascinating breakdown in the world, so it may be a while
                            before I fuss with that. But this breakdown is cool:



                            More responses always welcome.

                            kenny

                            Comment

                            • Terry Reedy

                              #29
                              Re: Python syntax in Lisp and Scheme


                              "Jeremy H. Brown" <jhbrown@ai.mit .edu> wrote in message
                              news:uv6brsygx7 8.fsf@tenebrae. ai.mit.edu...[color=blue]
                              > "Terry Reedy" <tjreedy@udel.e du> writes:[/color]
                              .....[color=blue][color=green]
                              > > give a short listing of the current main differences (S vs. CL)?[/color][/color]
                              ....[color=blue]
                              > than not. Here are a few of the (arguably) notable differences:[/color]
                              ....
                              Thank you. This is just the sort of preview I wanted.
                              [color=blue]
                              > Try them both, see which one works for you in what you're doing.[/color]

                              My present interest is intellectual broadening. I think I should
                              start with parts of the current version of SICP and then read a modern
                              CL chapter on macros.

                              Terry J. Reedy



                              Comment

                              • Joe Marshall

                                #30
                                Re: Python syntax in Lisp and Scheme

                                Alexander Schmolck <a.schmolck@gmx .net> writes:
                                [color=blue]
                                > prunesquallor@c omcast.net writes:
                                >[color=green]
                                >> mike420@ziplip. com writes:
                                >>[color=darkred]
                                >> > I think everyone who used Python will agree that its syntax is
                                >> > the best thing going for it.[/color]
                                >>
                                >> I've used Python. I don't agree.[/color]
                                >
                                > I'd be interested to hear your reasons. *If* you take the sharp distinction
                                > that python draws between statements and expressions as a given, then python's
                                > syntax, in particular the choice to use indentation for block structure, seems
                                > to me to be the best choice among what's currently on offer (i.e. I'd claim
                                > that python's syntax is objectively much better than that of the C and Pascal
                                > descendants -- comparisons with smalltalk, prolog or lisp OTOH are an entirely
                                > different matter).[/color]

                                (I'm ignoring the followup-to because I don't read comp.lang.pytho n)

                                Indentation-based grouping introduces a context-sensitive element into
                                the grammar at a very fundamental level. Although conceptually a
                                block is indented relative to the containing block, the reality of the
                                situation is that the lines in the file are indented relative to the
                                left margin. So every line in a block doesn't encode just its depth
                                relative to the immediately surrounding context, but its absolute
                                depth relative to the global context. Additionally, each line encodes
                                this information independently of the other lines that logically
                                belong with it, and we all know that when some data is encoded in one
                                place may be wrong, but it is never inconsistent.

                                There is yet one more problem. The various levels of indentation
                                encode different things: the first level might indicate that it is
                                part of a function definition, the second that it is part of a FOR
                                loop, etc. So on any line, the leading whitespace may indicate all
                                sorts of context-relevant information. Yet the visual representation
                                is not only identical between all of these, it cannot even be
                                displayed.

                                Is this worse than C, Pascal, etc.? I don't know.
                                Worse than Lisp, Forth, or Smalltalk? Yes.

                                Comment

                                Working...