Is anything easier to do in java than in lisp?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oliver Plohmann

    #46
    Re: Is anything easier to do in java than in lisp?

    The major advantage of Java, C, C++, Pascal, etc. over Lisp is that
    solving anything that can be solved with an iterative solution easily
    is easy. To me that's the real advantage ...

    I once took a Lisp class when I was studying. I was quite curious
    about Lisp. Then a programming task was given that would have been a
    peace of cake when solving it with an iterative approach. Looking for
    a recursive stack-based solution for Lisp caused big headaches. Since
    that day I was not that interested in Lisp any more. Okay, with a
    recursive solution things are non-desctructive which is convenient
    when debugging. Things in Smalltalk are also non-desctructive (okay,
    not 100% as in Lisp - but in general it is true) since the respective
    methods in the Collection hierarchy only iterate over the receiver
    collection but work on copies. It makes probably more sense to compare
    Lisp and Smalltalk - they are more alike and both almost dead.

    Since several Lisp gurus have replied to this thread maybe one can
    tell me why recursiveness and non-destructiveness in Lisp is such a
    holy thing (this is a "real" question - not a rhetoric one). I never
    dared to ask the professor. He was such a Lisp fanatic he would have
    killed me on the spot ...

    I suggest to take Squeak Smalltalk (www.squeak.org) change the
    VM/compiler to have macros (Squeak has a liberal license that would
    allow for it). Add Lisp style lists with car and cdr and you have the
    best of the imperative and non-imperative world :-).

    Regards, Oliver Plohmann


    RobertMaas@Yaho oGroups.Com wrote in message news:<REM-2004jun14-001@Yahoo.Com>. ..[color=blue][color=green]
    > > From: Jan Gregor <gregor.jan@NOS PAMquick.cz>
    > > Problem with compilation of java programs is that compiler itself
    > > runs in jvm. Use jikes, it is very fast compared to javac. i think
    > > because is written in C or C++.[/color]
    >
    > It doesn't seem to be available on my ISP:
    > % man jikes
    > No manual entry for jikes
    > % whereis jikes
    > jikes:
    > %
    >
    > If I were to download it and install it on my personal shell account on
    > the FreeBSD Unix ISP, how much disk space would be used?[/color]

    Comment

    • hading@hading.dnsalias.com (Howard Ding

      #47
      Re: Is anything easier to do in java than in lisp?

      oliver@plohmann .com (Oliver Plohmann) writes:
      [color=blue]
      > Since several Lisp gurus have replied to this thread maybe one can
      > tell me why recursiveness and non-destructiveness in Lisp is such a
      > holy thing (this is a "real" question - not a rhetoric one). I never
      > dared to ask the professor. He was such a Lisp fanatic he would have
      > killed me on the spot ...
      >[/color]

      I'm not a Lisp guru, but your question is easily answered. They're
      not holy things. Imperative code is common in Common Lisp, and if
      it's a natural way to solve a particular problem, a Lisp programmer is
      in no way unlikely to use it.

      --
      Howard Ding
      <hading@hading. dnsalias.com>

      Comment

      • Christophe Rhodes

        #48
        Re: Is anything easier to do in java than in lisp?

        oliver@plohmann .com (Oliver Plohmann) writes:
        [color=blue]
        > Since several Lisp gurus have replied to this thread maybe one can
        > tell me why recursiveness and non-destructiveness in Lisp is such a
        > holy thing (this is a "real" question - not a rhetoric one).[/color]

        It's not. Perhaps your class was an attempt (apparently not a
        successful one) to teach recursion and functional programming using
        some dialect of Lisp as a vehicle. Try not to confuse the medium with
        the message.

        Christophe
        --
        http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757
        (set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
        (defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusColleg eCambridge)

        Comment

        • Marco Baringer

          #49
          Re: Is anything easier to do in java than in lisp?

          oliver@plohmann .com (Oliver Plohmann) writes:
          [color=blue]
          > The major advantage of Java, C, C++, Pascal, etc. over Lisp is that
          > solving anything that can be solved with an iterative solution easily
          > is easy. To me that's the real advantage ...[/color]

          really?

          (loop for name in parameters
          for value in values
          do (stuff name value))

          --
          -Marco
          Ring the bells that still can ring.
          Forget your perfect offering.
          There is a crack in everything.
          That's how the light gets in.
          -Leonard Cohen

          Comment

          • Mario S. Mommer

            #50
            Re: Is anything easier to do in java than in lisp?


            oliver@plohmann .com (Oliver Plohmann) writes:[color=blue]
            > I once took a Lisp class when I was studying. I was quite curious
            > about Lisp. Then a programming task was given that would have been a
            > peace of cake when solving it with an iterative approach. Looking for
            > a recursive stack-based solution for Lisp caused big headaches. Since
            > that day I was not that interested in Lisp any more.[/color]

            You probably mean Scheme here, or at least not Common Lisp. If
            something is a peace of cake iteratively, then in Common Lisp you will
            solve that iteratively (and it will be a peace of cake too).

            OTOH, if it is a peace of cake recursively/functionally, then again,
            you'll probably solve it recursively in Common Lisp.

            Modern Common Lisp is a multiparadigm language.

            Comment

            • Kenny Tilton

              #51
              Re: Is anything easier to do in java than in lisp?



              Oliver Plohmann wrote:
              [color=blue]
              > Since several Lisp gurus have replied to this thread maybe one can
              > tell me why recursiveness and non-destructiveness in Lisp is such a
              > holy thing (this is a "real" question - not a rhetoric one).[/color]

              How long ago was your Lisp class?

              The funny thing is that anyone posting on c.l.lisp a recursive solution
              where any of the many Lisp iteration mechanisms (various do's, various
              map's, loop) would suffice can reliably count on being flamed as a
              closet schemer.

              Me, I got a huge kick out of recursion when I started my Lisp family
              programming in Logo. It took a little mind-bending, but I grokked the
              power straight away. So I for one do not pounce on those who recur for
              recursion's sake, but then neither do I eschew iteration where it will,
              um, do.

              btw, sounds like you gave up on recursion and Lisp too fast, before you
              had mastered recursion. Recursion is worth understanding for those times
              when iteration is the wrong hammer.

              kenny

              --
              Home? http://tilton-technology.com
              Cells? http://www.common-lisp.net/project/cells/
              Cello? http://www.common-lisp.net/project/cello/
              Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
              Your Project Here! http://alu.cliki.net/Industry%20Application

              Comment

              • Paul Dietz

                #52
                Re: Is anything easier to do in java than in lisp?

                Oliver Plohmann wrote:
                [color=blue]
                > Since several Lisp gurus have replied to this thread maybe one can
                > tell me why recursiveness and non-destructiveness in Lisp is such a
                > holy thing (this is a "real" question - not a rhetoric one).[/color]

                It's not. It's a quasi-religious thing with some *Scheme*
                advocates, but (most?) Common Lisp programmers view the
                recursion fetish with something between dismay and disdain.

                Paul

                Comment

                • AndrĂ© Thieme

                  #53
                  Re: Is anything easier to do in java than in lisp?

                  Oliver Plohmann schrieb:[color=blue]
                  > The major advantage of Java, C, C++, Pascal, etc. over Lisp is that
                  > solving anything that can be solved with an iterative solution easily
                  > is easy. To me that's the real advantage ...
                  >
                  > I once took a Lisp class when I was studying. I was quite curious
                  > about Lisp. Then a programming task was given that would have been a
                  > peace of cake when solving it with an iterative approach. Looking for
                  > a recursive stack-based solution for Lisp caused big headaches. Since
                  > that day I was not that interested in Lisp any more. Okay, with a
                  > recursive solution things are non-desctructive which is convenient
                  > when debugging. Things in Smalltalk are also non-desctructive (okay,
                  > not 100% as in Lisp - but in general it is true) since the respective
                  > methods in the Collection hierarchy only iterate over the receiver
                  > collection but work on copies. It makes probably more sense to compare
                  > Lisp and Smalltalk - they are more alike and both almost dead.[/color]

                  As others already pointed out: Lisp /does support/ iteration.

                  Hmm, what do you do when you can apply iteration on a problem but your
                  language doesn't support it? While Lisp can be extended to support your
                  kind of iteration as if it always had been in the language before in
                  many other languages you often run into the problem to describe a good
                  iteration with basic mechanisms - all the time.
                  In Java for example you could not easily loop over collections until Sun
                  came up with 1.5. When a new paradigm of iterating is needed you would
                  have to ask again Sun to implement it and wait perhaps one or two years.
                  In that time tens of thousands of lines of code would have been written
                  with a not so powerfull iteration method.

                  In these situations it would have been nice to have macros like Lisp does.


                  No Oliver, I think when we look at language constructs we won't find big
                  advantages of Java over Lisp. We need to look at libraries. There we can
                  find many things which Java has and Lisp doesn't.
                  You want to integrate SAP? No problem with Java with original drivers
                  from SAP. In Lisp.. you would have to write them yourself.


                  André
                  --

                  Comment

                  • Joe Marshall

                    #54
                    Re: Is anything easier to do in java than in lisp?

                    oliver@plohmann .com (Oliver Plohmann) writes:
                    [color=blue]
                    > Since several Lisp gurus have replied to this thread maybe one can
                    > tell me why recursiveness and non-destructiveness in Lisp is such a
                    > holy thing (this is a "real" question - not a rhetoric one).[/color]

                    It isn't holy. There are some advantages to non-destructive
                    solutions. As you pointed out, it is easier to debug if your input
                    isn't getting smashed. Non-destructive solutions compose easier and
                    can maximize sharing. The results of pure functions can be cached.
                    The compiler can easily re-order computations if they do not
                    side-effect.

                    Comment

                    • Erann Gat

                      #55
                      Re: Is anything easier to do in java than in lisp?

                      In article <lliosl4a.fsf@c cs.neu.edu>, Joe Marshall <jrm@ccs.neu.ed u>
                      wrote:
                      [color=blue]
                      > oliver@plohmann .com (Oliver Plohmann) writes:
                      >[color=green]
                      > > Since several Lisp gurus have replied to this thread maybe one can
                      > > tell me why recursiveness and non-destructiveness in Lisp is such a
                      > > holy thing (this is a "real" question - not a rhetoric one).[/color]
                      >
                      > It isn't holy. There are some advantages to non-destructive
                      > solutions. As you pointed out, it is easier to debug if your input
                      > isn't getting smashed. Non-destructive solutions compose easier and
                      > can maximize sharing. The results of pure functions can be cached.
                      > The compiler can easily re-order computations if they do not
                      > side-effect.[/color]

                      GC is also potentially a lot faster for side-effect-free code.

                      E.

                      Comment

                      • Joe Marshall

                        #56
                        Re: Is anything easier to do in java than in lisp?

                        Erann Gat <gNOSPAMat@flow net.com> writes:
                        [color=blue]
                        > In article <lliosl4a.fsf@c cs.neu.edu>, Joe Marshall <jrm@ccs.neu.ed u>
                        > wrote:
                        >[color=green]
                        >> oliver@plohmann .com (Oliver Plohmann) writes:
                        >>[color=darkred]
                        >> > Since several Lisp gurus have replied to this thread maybe one can
                        >> > tell me why recursiveness and non-destructiveness in Lisp is such a
                        >> > holy thing (this is a "real" question - not a rhetoric one).[/color]
                        >>
                        >> It isn't holy. There are some advantages to non-destructive
                        >> solutions. As you pointed out, it is easier to debug if your input
                        >> isn't getting smashed. Non-destructive solutions compose easier and
                        >> can maximize sharing. The results of pure functions can be cached.
                        >> The compiler can easily re-order computations if they do not
                        >> side-effect.[/color]
                        >
                        > GC is also potentially a lot faster for side-effect-free code.[/color]

                        Yes! Thanks for mentioning that. The `write-barrier' for
                        generational GC does not need to apply to newly allocated storage, and
                        ephemeral garbage costs practically nothing.


                        --
                        ~jrm

                        Comment

                        • Espen Vestre

                          #57
                          Re: Is anything easier to do in java than in lisp?

                          André Thieme <address.good.u ntil.2004.aug.1 1@justmail.de> writes:
                          [color=blue]
                          > You want to integrate SAP? No problem with Java with original drivers
                          > from SAP. In Lisp.. you would have to write them yourself.[/color]

                          I think there's a bootstrapping problem here: Such interfaces
                          (don't know about SAP, but we're interfacing to a number of weird
                          protocols where I work) are easy to write in lisp, so every active
                          lisper who needs it writes his own and doesn't think of sharing
                          his little hack, so the next lisper writes it himself too... and
                          so on.
                          --
                          (espen)

                          Comment

                          • Hannah Schroeter

                            #58
                            Re: Is anything easier to do in java than in lisp?

                            Hello!

                            Joe Marshall <prunesquallor@ comcast.net> wrote:[color=blue]
                            >[...][/color]
                            [color=blue][color=green]
                            >> GC is also potentially a lot faster for side-effect-free code.[/color][/color]
                            [color=blue]
                            >Yes! Thanks for mentioning that. The `write-barrier' for
                            >generational GC does not need to apply to newly allocated storage, and
                            >ephemeral garbage costs practically nothing.[/color]

                            Of course, if you add non-strictness into the mix, you get hidden
                            side effects again (updating a deferred calculation with its result),
                            so you need write-barriers or so again.

                            You still gain the greater ease to reason about some aspects of the
                            code though.

                            Kind regards,

                            Hannah.

                            Comment

                            • Oliver Plohmann

                              #59
                              Re: Is anything easier to do in java than in lisp?

                              Mario S. Mommer <m_mommer@yahoo .com> wrote in message news:<fzacz495r l.fsf@germany.i gpm.rwth-aachen.de>...[color=blue]
                              > oliver@plohmann .com (Oliver Plohmann) writes:[color=green]
                              > > I once took a Lisp class when I was studying. I was quite curious
                              > > about Lisp. Then a programming task was given that would have been a
                              > > peace of cake when solving it with an iterative approach. Looking for
                              > > a recursive stack-based solution for Lisp caused big headaches. Since
                              > > that day I was not that interested in Lisp any more.[/color]
                              >
                              > You probably mean Scheme here, or at least not Common Lisp. If
                              > something is a peace of cake iteratively, then in Common Lisp you will
                              > solve that iteratively (and it will be a peace of cake too).[/color]

                              You were right. We were using Scheme back then ;-). Thanks for the
                              answers. Usually ppl just start to flame you and your question remain
                              unanswered. Okay then, maybe I have a look at Lisp again.

                              Regards, Oliver
                              [color=blue]
                              > OTOH, if it is a peace of cake recursively/functionally, then again,
                              > you'll probably solve it recursively in Common Lisp.
                              >
                              > Modern Common Lisp is a multiparadigm language.[/color]

                              Comment

                              • Kenny Tilton

                                #60
                                Re: Is anything easier to do in java than in lisp?



                                Oliver Plohmann wrote:
                                [color=blue]
                                > You were right. We were using Scheme back then ;-). Thanks for the
                                > answers. Usually ppl just start to flame you and your question remain
                                > unanswered. Okay then, maybe I have a look at Lisp again.[/color]

                                Hang on, what happened to?:
                                [color=blue]
                                > It makes probably more sense to compare
                                > Lisp and Smalltalk - they are more alike and both almost dead.[/color]

                                Why look at a near-dead language?

                                confusedly, kenny


                                --
                                Home? http://tilton-technology.com
                                Cells? http://www.common-lisp.net/project/cells/
                                Cello? http://www.common-lisp.net/project/cello/
                                Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
                                Your Project Here! http://alu.cliki.net/Industry%20Application

                                Comment

                                Working...