Page 1 of 8 123 ... LastLast
Results 1 to 10 of 72

Thread: Land of Lisp

  1. #1
    thinBasic MVPs danbaron's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    1,378
    Rep Power
    152

    Land of Lisp

    I just got this e-book. And, I just started it. It looks really good.

    http://www.nostarch.com/lisp.htm

    The book recommends using CLISP, as you replicate the book's examples. CLISP is easy to install.

    http://clisp.sourceforge.net/

    And, here is another free version of ANSI Common Lisp (also easy to install), which includes an IDE.

    http://www.franz.com/downloads.lhtml

    To me, Lisp seems substantially different. At first, the learning curve looks like a sheer wall. But, it seems that the people who understand it well, think it is the greatest thing in recorded history. Here is a quote from the book's introduction: -->



    Where Does Lisp Get Its Power?

    I’ve said that Lisp is a particularly powerful language. So what were the key insights that John McCarthy (and the
    other, later innovators of Lisp) had that made this power possible?

    To make a programming language powerful, you need to make it expressive. Having an expressive language means that you
    can do a lot of stuff with very little actual code. But what traits does a language need to make this possible? I think
    there are two that are most important.

    One trait is a lot of features built into the language. That way, for most things you need to get done, someone has
    already performed some of the work for you, and you can leverage that work to make your own code look pithy. Many modern
    languages have this trait. The Java language, for instance, is renowned for powerful libraries that, for example, let
    you acquire data from another PC over a socket with ease.

    The second trait that gives a language power is letting you muck around inside it as deeply as possible to make it do
    your bidding. That way, even if the designers of the language never conceived of what you’re trying to do, you can make
    your own changes to the language until it does exactly what you need to solve your problems elegantly. This trait is
    much more difficult to provide in a language. Suppose you wanted to add something like nested function definition
    support to Java. If you know Java well, thinking about how to add such support is in the realm of nightmares.

    The reason most languages aren’t good at supporting both of these traits simultaneously is that they conflict with each
    other. The richer a language is at the start, the more complicated it is. And the more complicated the language, the
    more painful it is to muck with that language. That’s why making your own changes to the most mature programming
    languages is close to impossible.

    Of course, if you try hard enough, you can always make fundamental changes to any language. For instance, when C++ was
    developed, it originally took the form of a C preprocessor. A special C program was written that could take code written
    in the new C++ dialect and convert it into plain-old C, which you could then just run through a standard C compiler.
    This is how Bjarne Stroustrup, the inventor of C++, was able to tweak the C language and add features to turn it into
    his own. However, writing a translator such as this is an extremely difficult and tedious process that you would
    consider only as a last resort.

    In contrast, Lisp languages make it extremely easy for an experienced Lisper to alter the compiler/interpreter that runs
    a program, while still supporting rich language features with extensive libraries. In fact, messing around with the
    language within Lisp is easier than in any other language ever created!

    For example, writing a function in Lisp to calculate the distance between two points would be simple, as in most other
    languages. But an experienced Lisper would find it equally easy to invent a new way to nest function definitions or
    devise a funky if-then command. Even writing your own object-oriented programming support inside Lisp is not complicated
    (and most Lispers have probably done so at some point). In Lisp, everyone gets to be a mini-Stroustrup!

    How does Lisp make this neat feat possible? One of Lisp’s core characteristics is that writing a Lisp directly in Lisp
    is, itself, unbelievably simple. It turns out that this is the key property that allows Lisp to break the paradox of the
    two traits. By starting out as a language that could perform a cool mathematical trick of elegantly writing itself, it
    ended up possessing the very property needed to be both feature-rich and tweakable. That, in turn, makes it the perfect
    tool for actually writing just about any kind of program at all!

    Think of it this way: Give a programmer a fish command in his programming language, and he will eat Chinese takeout and
    drink Jolt for a day. Give a programmer a programming language that allows him to write his own fish command, and he’ll
    eat Chinese takeout and drink Jolt for a lifetime (which, admittedly, would probably be cut short by nutritional
    deficiencies, and let’s not even discuss the probable heart arrhythmias).

    So, now you have an idea of why Lisp is a very cool and very unusual programming language. It has a long and atypical
    history compared with most programming languages. Most languages came from the world of engineering, whereas Lisp
    originated from a more mathematical background. It has a lot to offer to those willing to spend a little time learning
    something new.

    Last edited by danbaron; 11-01-2011 at 08:58.
    "You can't cheat an honest man. Never give a sucker an even break, or smarten up a chump." - W.C.Fields

  2. #2
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404
    Thanks Dan. LISP has been around a while and it is one of the few major languages that I never really tried out. Have you seen some of the LISP books, they are like NYC phone books

  3. #3
    Quote Originally Posted by danbaron View Post
    I just got this e-book. And, I just started it. It looks really good.

    http://www.nostarch.com/lisp.htm

    The book recommends using CLISP, as you replicate the book's examples. CLISP is easy to install.

    http://clisp.sourceforge.net/

    And, here is another free version of ANSI Common Lisp (also easy to install), which includes an IDE.

    http://www.franz.com/downloads.lhtml

    To me, Lisp seems substantially different. At first, the learning curve looks like a sheer wall. But, it seems that the people who understand it well, think it is the greatest thing in recorded history. Here is a quote from the book's introduction: -->

    Perhaps you might be interested in Factor, which has some similarities to Lisp and some to Forth. See

    http://factorcode.org/

    The Land of Lisp book does seem to be very well written...

    Lance

  4. #4
    thinBasic MVPs danbaron's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    1,378
    Rep Power
    152
    I agree. Most Lisp books seem designed to be opaque. I hope this one is different.

    I don't know how you found Factor. I looked at it for a minute. I have to admit, it looks good, a compiled stack language. I will look at it some more. (I should be content just investigating Lisp, with the new book. But, I'm not constructed that way. I'm always interested in the next language, whether I want to be or not.)

    I think a main thing that determines if a language gains popularity, is its documentation. Conversely, the more popular a language becomes, the more documentation it has. When I examine Factor, that is the first thing I will look at. It's hard to learn a newly existent language, because, initially, its documentation is usually lacking. A language seems to break out of obscurity, when books begin being written about it. A complex language seems to require a lot of books, to explain all of its aspects, its possibilities.



    "You can't cheat an honest man. Never give a sucker an even break, or smarten up a chump." - W.C.Fields

  5. #5
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404
    I guess this is why I never really tried Lisp and Perl.
    http://gnuvince.wordpress.com/2007/09/07/perl-vs-lisp/

    They seemed similar, but now in looking at this sample code, I could see that Perl perhaps is not as bad as I thought. But again, I have been looking at lots of c++ code the last year or so and that makes it less off putting looking at Perl now.

  6. #6
    I have been interested in Lisp for a long time but my procedural mindset keeps me away, not to mention all those parenthesis.
    just now I was looking at factor and example code, wound up at the rosetta site looking at different implementations of 99 bottles of beer, the one example that cought my attention was this kid's language scratch it looks cool.
    see it here http://rosettacode.org/wiki/99_Bottles_of_Beer#Scratch

  7. #7
    thinBasic MVPs danbaron's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    1,378
    Rep Power
    152
    I also have a procedural mindset.

    With non-procedural languages, the simplest things seem hard - maybe I am just ignorant.

    If you want to drive yourself crazy, try to figure out how to do I/O, in Haskell.

    Haskell web page:

    http://haskell.org/haskellwiki/Haskell

    Haskell I/O:

    http://www.haskell.org/haskellwiki/IO_inside

    More Haskell I/O:

    http://www.haskell.org/tutorial/io.html

    More Haskell I/O:

    http://en.wikibooks.org/wiki/Haskell/YAHT/Io

    More Haskell I/O:

    http://en.wikibooks.org/wiki/Haskell...ding_monads/IO

    So far, Haskell is my winner for the language which is closest to being the opposite of Basic.

    The "Scratch" version of 99 Bottles, looks good. "When", "set", "repeat", "say", "wait". And, the cat performs. That's the way to get kids interested. Learning that is fun, i.e., painless.

    -----------------------------------

    In Lisp and Perl (also, I think in Lua, Python, and Ruby), functions are referred to as, "first class objects". I think that means that anything you can do with any other object, you can do with them. For instance, like in your article, a function can build and return another function.

    You can download, "Higher Order Perl". I downloaded it a couple of weeks ago. I always get side-tracked. Anyway, if you are just starting with Perl, you probably should study, "lower order" Perl, first.

    -----------------------------------

    I hardly know anything about it, but, I'm downloading Factor.

    Whatever it is, there must be a lot there, because, the download is 29 MB.

    Last edited by danbaron; 13-01-2011 at 08:36.
    "You can't cheat an honest man. Never give a sucker an even break, or smarten up a chump." - W.C.Fields

  8. #8
    If you would like to see any Lisp functionality that would be useful in Basic, here is your opportunity

    Charles

  9. #9
    thinBasic MVPs danbaron's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    1,378
    Rep Power
    152
    Maybe Factor functionality too, Charles.

    I downloaded and installed Factor.

    So far, all I know is that inside the IDE, at the "Listener" prompt, you can use it like an RPN calculator.

    Here is the blog of Slava Pestov, Factor's creator.

    http://factor-language.blogspot.com/


    "You can't cheat an honest man. Never give a sucker an even break, or smarten up a chump." - W.C.Fields

  10. #10
    Maybe a high level PUSH and POP would be useful additions to Basic. I wrote an experimental interpretive language called R$ which used stacks and Reverse Polish Notation - It worked well for simple coding but then gets messy when you want to use mixed data types, structures, and multidimensional arrays. The Basic/C notation we are all familiar with, is highly optimised with over 40 years of evolution behind it.

    However Stack based languages are widely used to mediate between high level languages and native code. For instance: PostScript, Java Byte code and .Net's Common Intermediate Language. (You can include Assembly code itself in this category too).

    Charles

Page 1 of 8 123 ... LastLast

Similar Threads

  1. BEE Lisp
    By danbaron in forum Shout Box Area
    Replies: 0
    Last Post: 30-04-2010, 21:41

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •