For Programmers: Free Programming Magazines  


Home > Archive > Lisp > October 2004 > Re: Lisp benefits against other functional programming languages









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Lisp benefits against other functional programming languages
Philip Haddad

2004-10-12, 8:56 pm

michielborkent@gmail.com (Michiel Borkent) wrote in message news:<a58e8f47.0409250141.728adfac@posting.google.com>...
> Hello folks,
>
> I am asking for some help with Lisp propaganda.
>
> Why should a programmer choose for Lisp, while there are also very
> much other functional languages, like Clean, Haskell, of which the
> syntax is very much more elegant (according to their users).
>
> So: why Lisp and not another functional language?
>
> I am asking this because I am in kind of a discussion about Lisp, what
> it can do and express, with a teacher who uses preferably other
> functional languages.


Lisp is the first functional language I have used, however, I love the
fact that there are no strong typed types in Lisp (int double etc),
and that there is a GC. Also, Lisp operates on as few side effects as
possible. For example, I wrote a forward-chaining algorithm with no
side effects (it just returned lists as values), and showed it to my
math teacher who uses C++. Even she admited that my code looked
elegent. I think that is the most important thing about Lisp that you
will never really find implemented as beautifully in other languages.
The choice of being able to program without side effects.

> Example:
>
> Lisp:
>
> (defun twice (fun)
> (lambda (&rest args)
> (apply fun
> (apply fun args)
> )))
>
> Amanda:
>
> double f = args -> f (f args)


I've never heard of Amanda, it looks similar to Perl.... (lambda) also
looks a lot better than ->.

> Lisp:
>
> (funcall (twice #'(lambda(x y) (list (* x y)(+ x y)))) 1 3)
>
> Amanda:
>
> double ((x,y) -> (x*y,x+y)) (1,3)
>
> Please help me out :).
>
> Michiel


--
May the Source be with you.
Philip Haddad (neo88)
Matthew Danish

2004-10-12, 8:56 pm

philip.haddad@gmail.com (Philip Haddad) writes:
> Lisp is the first functional language I have used, however, I love the
> fact that there are no strong typed types in Lisp (int double etc),


Sorry to disappoint you, then, because there is strong typing in Lisp,
and there is an integer type, along with a few floating-point types, a
rational type, a complex type, and many more.

> and that there is a GC. Also, Lisp operates on as few side effects as
> possible. For example, I wrote a forward-chaining algorithm with no
> side effects (it just returned lists as values), and showed it to my
> math teacher who uses C++. Even she admited that my code looked
> elegent. I think that is the most important thing about Lisp that you
> will never really find implemented as beautifully in other languages.
> The choice of being able to program without side effects.


Sounds pretty inefficient though. The real beauty is that you can
write code like this, and yet also implement it efficiently;
oftentimes while hiding the cruft.

--
;; Matthew Danish -- user: mrd domain: cmu.edu
;; OpenPGP public key: C24B6010 on keyring.debian.org
Philip Haddad

2004-10-13, 8:57 pm

Matthew Danish <mrd+nospam@cmu.edu> wrote in message news:<87sm8jzhgn.fsf@mapcar.org>...
> philip.haddad@gmail.com (Philip Haddad) writes:
>
> Sorry to disappoint you, then, because there is strong typing in Lisp,
> and there is an integer type, along with a few floating-point types, a
> rational type, a complex type, and many more.


I know that. What I said didn't come out right. I meant to say that
Lisp will automatically allocate space (in the form of cons cells) for
any new data object. You don't HAVE to actually type in the type if
you don't want to.

--
May the Source be with you.
Philip Haddad
Jon Boone

2004-10-13, 8:57 pm

philip.haddad@gmail.com (Philip Haddad) writes:

> I know that. What I said didn't come out right. I meant to say that
> Lisp will automatically allocate space (in the form of cons cells) for
> any new data object. You don't HAVE to actually type in the type if
> you don't want to.


You mean "dynamic typing" as opposed to "static typing".

--jon
Kenny Tilton

2004-10-14, 3:59 pm



Philip Haddad wrote:
> Matthew Danish <mrd+nospam@cmu.edu> wrote in message news:<87sm8jzhgn.fsf@mapcar.org>...
>
>
>
> I know that.


We knew you knew that. c.l.l is, as Rodney would have said, a tough
crowd. you can count on anything less than rigorously perfect being
hammered unmercilessly. The upside being that reading c.l.l is a
continuing education program in a deep language which really requires
continuing education.

kt

--
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Vassil Nikolov

2004-10-14, 3:59 pm

Kenny Tilton <ktilton@nyc.rr.com> writes:

> [...]
> c.l.l is, as Rodney would have said, a tough
> crowd. you can count on anything less than rigorously perfect being
> hammered unmercilessly.


Hmmm, in the spirit of the pursuit of perfection, you can't actually
_count_ on that, but you ought to be prepared for it.

(Shamelessly paraphrasing and twisting words, "this is similar to
``should be hammered'' except that it does not imply that `extra
effort' has to be taken on the part of an poster to discover an
imperfect posting...")

---Vassil.

--
Vassil Nikolov <vnikolov@poboxes.com>

Hollerith's Law of Docstrings: Everything can be summarized in 72 bytes.
Kenny Tilton

2004-10-14, 3:59 pm



Vassil Nikolov wrote:
> Kenny Tilton <ktilton@nyc.rr.com> writes:
>
>
>
>
> Hmmm, in the spirit of the pursuit of perfection, you can't actually
> _count_ on that, but you ought to be prepared for it.


Not bad, but I was hoping for "is there a merciful way to hammer someone?".

:)

kenny

--
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Pascal Bourguignon

2004-10-14, 3:59 pm

Kenny Tilton <ktilton@nyc.rr.com> writes:

> Philip Haddad wrote:
>
> We knew you knew that. c.l.l is, as Rodney would have said, a tough
> crowd. you can count on anything less than rigorously perfect being
> hammered unmercilessly. The upside being that reading c.l.l is a
> continuing education program in a deep language which really requires
> continuing education.


Which strangely does not have continuations...

--
__Pascal Bourguignon__ http://www.informatimago.com/

Voting Democrat or Republican is like choosing a cabin in the Titanic.
Duane Rettig

2004-10-14, 3:59 pm

Kenny Tilton <ktilton@nyc.rr.com> writes:

> Vassil Nikolov wrote:
>
>
>
> Not bad, but I was hoping for "is there a merciful way to hammer someone?".


Perhaps, but since "mercy" is not in the glossary, it would
be an extension - implementation dependent.

--
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
Marco Antoniotti

2004-10-14, 3:59 pm



Pascal Bourguignon wrote:
> Kenny Tilton <ktilton@nyc.rr.com> writes:
>

....
>
>
> Which strangely does not have continuations...
>


Yes, but we handle that case pretty well :)

Cheers
--
Marco

Kenny Tilton

2004-10-14, 3:59 pm



Duane Rettig wrote:
> Kenny Tilton <ktilton@nyc.rr.com> writes:
>
>
>
>
> Perhaps, but since "mercy" is not in the glossary, it would
> be an extension - implementation dependent.
>


Isn't anyone going to pick up on "unmercilessly"?

You guys are losing your edge.

:)

kenny



--
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Joe Marshall

2004-10-14, 3:59 pm

Marco Antoniotti <marcoxa@cs.nyu.edu> writes:

> Pascal Bourguignon wrote:
> ....
>
> Yes, but we handle that case pretty well :)


Somebody catch me before this entire thread is thrown into confusion.
Pascal Bourguignon

2004-10-14, 3:59 pm

Joe Marshall <jrm@ccs.neu.edu> writes:

> Marco Antoniotti <marcoxa@cs.nyu.edu> writes:
>
(catch me[color=darkred]
> Somebody catch me before this entire thread is thrown into confusion.

)

--
__Pascal Bourguignon__ http://www.informatimago.com/

Voting Democrat or Republican is like choosing a cabin in the Titanic.
Cesar Rabak

2004-10-14, 8:56 pm

Joe Marshall escreveu:
> Marco Antoniotti <marcoxa@cs.nyu.edu> writes:
>
>
>
>
> Somebody catch me before this entire thread is thrown into confusion.


Why? Do you think it still did not happen?

Jon Boone

2004-10-14, 8:56 pm

Joe Marshall <jrm@ccs.neu.edu> writes:

> Marco Antoniotti <marcoxa@cs.nyu.edu> writes:
>
>
> Somebody catch me before this entire thread is thrown into confusion.


well, we can TRY
Duane Rettig

2004-10-14, 8:56 pm

Jon Boone <ipmonger@delamancha.org> writes:

> Joe Marshall <jrm@ccs.neu.edu> writes:
>
>
> well, we can TRY


EXCEPT ... Oh, never mind.

--
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
Joe Marshall

2004-10-14, 8:56 pm

Duane Rettig <duane@franz.com> writes:

> Jon Boone <ipmonger@delamancha.org> writes:
>
>
> EXCEPT ... Oh, never mind.


FINALLY, someone gets the joke....
Gareth McCaughan

2004-10-14, 8:56 pm

Kenny Tilton <ktilton@nyc.rr.com> writes:

> Vassil Nikolov wrote:
>
> Not bad, but I was hoping for "is there a merciful way to hammer someone?".


Yes. Doctors do it sometimes when testing your reflexes.

--
Gareth McCaughan
..sig under construc
Pascal Costanza

2004-10-14, 8:56 pm


Joe Marshall wrote:
> Duane Rettig <duane@franz.com> writes:
>
>
>
>
> FINALLY, someone gets the joke....


Before, you say this, after, you say that? I have thunk this dynamic
wind is over?!?


Pascal

--
Tyler: "How's that working out for you?"
Jack: "Great."
Tyler: "Keep it up, then."
Kenny Tilton

2004-10-14, 8:56 pm



Pascal Costanza wrote:
>
> Joe Marshall wrote:
>
>
>
> Before, you say this, after, you say that? I have thunk this dynamic
> wind is over?!?


some continuation will always be around. and that brings us full loop.

kt

--
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Matthew Danish

2004-10-14, 8:56 pm

philip.haddad@gmail.com (Philip Haddad) writes:
> Lisp is the first functional language I have used, however, I love the
> fact that there are no strong typed types in Lisp (int double etc),


Sorry to disappoint you, then, because there is strong typing in Lisp,
and there is an integer type, along with a few floating-point types, a
rational type, a complex type, and many more.

> and that there is a GC. Also, Lisp operates on as few side effects as
> possible. For example, I wrote a forward-chaining algorithm with no
> side effects (it just returned lists as values), and showed it to my
> math teacher who uses C++. Even she admited that my code looked
> elegent. I think that is the most important thing about Lisp that you
> will never really find implemented as beautifully in other languages.
> The choice of being able to program without side effects.


Sounds pretty inefficient though. The real beauty is that you can
write code like this, and yet also implement it efficiently;
oftentimes while hiding the cruft.

--
;; Matthew Danish -- user: mrd domain: cmu.edu
;; OpenPGP public key: C24B6010 on keyring.debian.org
Duane Rettig

2004-10-14, 8:56 pm

Kenny Tilton <ktilton@nyc.rr.com> writes:

> Pascal Costanza wrote:
>
>
>
>
>
> some continuation will always be around. and that brings us full loop.


Just quit.

--
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
Pascal Bourguignon

2004-10-15, 3:56 am

Duane Rettig <duane@franz.com> writes:

> Kenny Tilton <ktilton@nyc.rr.com> writes:
>
>
> Just quit.


Which you can only do in an implementation dependant way, if at all.

--
__Pascal Bourguignon__ http://www.informatimago.com/

Voting Democrat or Republican is like choosing a cabin in the Titanic.
Vassil Nikolov

2004-10-15, 3:56 am

Duane Rettig <duane@franz.com> writes:

> Kenny Tilton <ktilton@nyc.rr.com> writes:
>
>
> Perhaps, but since "mercy" is not in the glossary, it would
> be an extension - implementation dependent.


... dropping gently
Upon the user beneath.

---Vassil.

--
Vassil Nikolov <vnikolov@poboxes.com>

Hollerith's Law of Docstrings: Everything can be summarized in 72 bytes.
Joe Marshall

2004-10-15, 3:58 pm

Kenny Tilton <ktilton@nyc.rr.com> writes:

> Pascal Costanza wrote:
>
> some continuation will always be around. and that brings us full loop.


Some might consider that a moral imperative.

Philip Haddad

2004-10-15, 3:58 pm

Jon Boone <ipmonger@delamancha.org> wrote in message news:<m3pt3m5fyl.fsf@spiritus.delamancha.org>...
> philip.haddad@gmail.com (Philip Haddad) writes:
>
>
> You mean "dynamic typing" as opposed to "static typing".


Yeah those are the correct terms I suppose ;-)

> --jon


--
May the Source be with you.
Philip Haddad
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com