• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Why lisp?

## Recommended Posts

quote:
Original post by Predictor
Would being more intelligent be an advantage in any language? Why is this an advantage specific to Lisp?
Because if an average programmer used Lisp, he wouldn''t get the benefits out of it and he''d be better off using some mainstream language with their set of well defined, pre-made features. The usage of Lisp isn''t justifiable unless one is capable of thinking differently than the norm.

Of course it''s sort of like in any language. An average C++/Lisp programmer writes average C++/Lisp code. A good C++/Lisp programmer writes good C++/Lisp code. Average C++/Lisp code are comparable: They just use some given features, probably not even close to their full extent. So Lisp wouldn''t be a good choice because C++ is better supported and more popular. But good C++/Lisp code aren''t comparable. In C++, the good programmer will hit the roof and be unable to formulate a better abstraction with the language. With Lisp, there''s no such roof, so the good programmer is set free, to explore whatever in her interest.

##### Share on other sites
quote:
Original post by Predictor
Others here, though, seem to be aserting that Lisp can take over the function of all other languages due to its extensibility.

Reminds me of the Java crowd who pretend (and some of them even seem to believe) that the whole world runs on 100% Java.
quote:
Original post by Anonymous Poster
It sounds as credible as a C programmer saying "I don''t see how OO would provide a general advantage".

But when OO proponents argue for OO they provide examples that show clear benefits over traditional approach. Lisp proponents provide a set of abstract arguments that are meaningless to a Lisp novice. Essentially I am offered to invest a few years of my time (since apparently it takes quite a while to actually *see* the advantages of Lisp) without seeing clear examples of how Lisp would be advantageous to *my* particular task. Now, if you were in my shoes, how would you respond?

##### Share on other sites
quote:
Original post by CoffeeMug
Essentially I am offered to invest a few years of my time (since apparently it takes quite a while to actually *see* the advantages of Lisp) without seeing clear examples of how Lisp would be advantageous to *my* particular task. Now, if you were in my shoes, how would you respond?
You don''t actually have to *do* it all first to *understand* why doing it would be good. Reading On Lisp[1], an effort that shouldn''t take too long even for a Lisp novice, will be enough to give you an idea of the possibilies that will be available to you when you use Lisp. It''s then up to you to evaluate whether you think you could use Lisp in such a way that it would be advantageous to you. If you believe that you can''t, then Lisp is probably not the language for you, and I have no reason to try to convince you. But getting to the point where it''s possible to understand the power of Lisp, and what it can give you, won''t take long.

[1] http://www.paulgraham.com/onlisp.html (it''s free)

##### Share on other sites
quote:
Original post by Predictor
Knowing that Lisp cannot possibly be better than all other tools under every circumstance

quote:
Original post by Anonymous Poster
What do you know? Lisp can be pretty close under every circumstance, if not better.

I want to make sure I understand the meaning of that statement perfectly: Are you suggesting that Lisp is better than any other tool, for every type of programming?

-Predictor
http://will.dwinnell.com

[edited by - Predictor on February 23, 2004 5:04:59 AM]

##### Share on other sites
quote:
Original post by Predictor
I want to make sure I understand the meaning of that statement perfectly: Are you suggesting that Lisp is better than any other tool, for every type of programming?
Ok, even though I didn''t say that, even what I said was too bold because I was only thinking of the task of writing the code, not so much the resources used or where Lisp compilers would even be available. I wouldn''t use Lisp for very low level code, on microcontrollers <wink> or tiny embedded systems (although some Lisp dialect could easily accompany Java on mobile phones) or on toy projects where I don''t plan to spend much time but which are well covered in other languages through existing libraries. But if I think of the domains where Java, C#, perhaps C++ (unless only used for low-level code), Prolog and many others are generally used in real work, Lisp would hold a definite advantage. My crude questimate is that 3/4 of programming tasks are best suited for Lisp, assuming good programmers.

Naughty Dog, the creators of Crash Bandicoot series and Jak and Daxter, even went so far to create their own Lisp compiler to best suit PlayStation 2 and to compile their own dialect. So they must''ve thought they can get a real advantage that way, considering how much work it must be to write the compiler. And considering how successful their games are, they must''ve really got those advantages they were dreaming of when they chose Lisp.

##### Share on other sites
Another book of interest is Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp[1] by Dr. Peter Norvig (Currently head of search quality at google).

Many of the possibilities discussed in this thread are described in this tome. e.g. Writing a prolog compiler (Chapter 12), compiling into other languages (usually asm or bytecode -but it doesn't have to be)(Chapter 23). The source code from the book is available here.

gl hf

[1] If you buy it from a link, maybe a webmaster at this site could hook you up with the link that gives them commission.

[edited by - flangazor on February 23, 2004 7:48:48 AM]

##### Share on other sites
quote:
Original post by CoffeeMug
But when OO proponents argue for OO they provide examples that show clear benefits over traditional approach.

There are many Lisp examples floating around the 'net (including these forums). The problem is that examples have to be verified first-hand through personal experience. Without that, all that can be gathered is a bunch of factoids disembodied from the actual experience which gave rise to the conclusion. This bunch of factoids may be of use to parrotts, but of little use of someone trying to understand the implications of the technology in question.
quote:

Lisp proponents provide a set of abstract arguments that are meaningless to a Lisp novice.

Of course. An abstraction is supposed to provide a memoisation which conjures up the full meaning of the abstraction. Without having been through the experience which imparts that full meaning, all that remains is, by definition, abstract.
quote:

Essentially I am offered to invest a few years of my time (since apparently it takes quite a while to actually *see* the advantages of Lisp)

How long it takes depends upon you and what knowledge you already have. Many programs written in languages other than Lisp actually end up simulating facilities of Lisp. It is quite possible that a non-Lisper is already thinking in Lisp' without realising it.
quote:

Now, if you were in my shoes, how would you respond?

I would seek to gain a body of experience which allows me to make the connections between disembodied factoids and the rationale which led to them. I would then evaluate the factoids for myself.

[edited by - SabreMan on February 23, 2004 9:10:09 AM]

##### Share on other sites
I''ll be putting this theory to the test here

Having read this thread, I recalled some moments during the development of a bot that I have been developing. I have started from scratch about 10 different times, in various languages, because no language seemed right for the job. C++ was obviously the more efficient of the bunch, but the extensibility of the project relied on robust runtime type information that is not so intuitive in C++. Java and C# appeared to be better suited in this regard, but the performance hits were too much when the information database grew beyond 100,000 or so entries. I was able to cut down on the performance problems in C# much better than in Java, but it posed a problem in portability, where it was desirable to run the application on Unix/Linux servers which are what is mostly available in academia. I understand there are some C# implementations cropping up in *nix, but the consensus seems to be that they are not ready for any serious dev yet.

So I guess I''ll see just how useful Lisp really is. This is a case where I would want to define my own object model, which many Lisp proponents seem to think is a major advantage of Lisp. The project data is entirely XML-based, which is another area that proponents have harped on. In fact, ideally, I would want tight integration of the object model and XML schema, as XML should be able to fully define the structure and interface of the objects. It would also be great to integrate scripting within the XML elements in an XML-friendly manner. This was done previously using javascript libraries, but javascript is not particularly well suited for the problem domain.

If Lisp is as useful for implementing these types of things as people make it out to be, I will join them in their Lispdom. Of course, I get the impression that if it doesn''t turn out to be so useful, I will merely be branded an incompetent. That is of little importance, however. So I shall let you know how it turns out

Peace

##### Share on other sites
quote:
SabreMan said:
There are many Lisp examples floating around the 'net (including these forums). The problem is that examples have to be verified first-hand through personal experience. Without that, all that can be gathered is a bunch of factoids disembodied from the actual experience which gave rise to the conclusion. This bunch of factoids may be of use to parrotts, but of little use of someone trying to understand the implications of the technology in question.

Is this a discrepency?

[edited by - flangazor on February 23, 2004 9:30:47 AM]

##### Share on other sites
quote:
Original post by Krippy2k
This is a case where I would want to define my own object model, which many Lisp proponents seem to think is a major advantage of Lisp.
I don''t really think of actually doing that as an especially important advantage. The fact that you can, and then use that power to do useful stuff, is the advantage. It''s good to stay with existing solutions if the existing solutions aren''t very lacking. I suggest you first take a look at CLOS. It''s a bit different from the object system you''re used to from a C++/Java background.

And read On Lisp before you start <wink>

##### Share on other sites
quote:
Original post by flangazor
Is this a discrepency?

No. Nowhere in this thread have I made direct reference to a specific example.

##### Share on other sites
quote:

I don''t really think of actually doing that as an especially important advantage. The fact that you can, and then use that power to do useful stuff, is the advantage.

This is the part of the assertions that I have a problem with. You CAN do it in any other language by writing a parser/compiler, or extending what is already there. Is it necessarily easier, or more productive to do it using Lisp macros? The prolog implementation in low-line-count is one thing. However, prolog is very well explored area of programming, and it is already possible to mix prolog within other languages by using libraries and compiler extensions.

One could extend the GNU C++ compiler to handle any language they want, really. Seeing how Lisp proponents seem to place great value on all programmers on a project being highly talented, it shouldn''t be much of an ordeal for them to compile a compiler before using it. You could create a XMSQVisualLisplog++#.ORG language in pure assembler if you wanted to. Being able to do so doesn''t make it particularly useful. Being able to do so in a productive manner, i.e. not taking 60 years to flesh out the compiler, could be useful.

What would make Lisp useful is if it would be significantly easier to create the object model that I need (even better if it already exists), with a more intuitive interface, without losing a lot of performance. Since ideally it would combine multiple languages in one: XML with embedded logic and scripting that has random access to other objects and elements that are defined in XML, in a way that doesn''t break the XML spec insofar as reading and analyzing XML with other third-party XML tools, while still allowing lower-level manipulation from non-XML codebases, it would seem to be a problem that Lisp should shine on given the abundance of bold assertions about being able to implement any language in Lisp being it''s strongpoint.

And that is the crux of my project. I need to be able to do what I want to do in a productive manner, in a way that can garner equal productivity to the other programmers who work with it (who are all generally academics expert in computer science theory and able to adapt to any language). None of the other languages seem well suited for the problem, but by reading the words of the Lispers in this thread (and most others), Lisp should be well suited for it. (And I talk with a lisp, so it would suit me in another area )

There is another similar project being worked on in Lisp, but it doesn''t appear to be going particularly well. However, I am not especially informed about their experience and talent, so I won''t make judgement based on that. I will give Lisp a run and see what it''s all about. I used lisp in college many years ago, but there was no Common Lisp then that I was aware of. We''ll see how it goes.

Peace

##### Share on other sites
quote:
Original post by Krippy2k
This is the part of the assertions that I have a problem with. You CAN do it in any other language by writing a parser/compiler, or extending what is already there. Is it necessarily easier, or more productive to do it using Lisp macros?
Well, take a look at existing macros for a measure. "On Lisp" features quite a bunch of them, and should give you some hint of how much code a useful macro takes.
quote:
The prolog implementation in low-line-count is one thing.
It''s quite a thing indeed. I wouldn''t believe it could be so (relatively) easy before I got to know Lisp.
quote:
One could extend the GNU C++ compiler to handle any language they want, really.
But it sure wouldn''t be easy. I''d say it would be total hell, knowing what a mess C++ is.
quote:
Seeing how Lisp proponents seem to place great value on all programmers on a project being highly talented, it shouldn''t be much of an ordeal for them to compile a compiler before using it.
Well, the main programmer at Naughty Dog did just that. But he didn''t do a compiler for a language that has only a set of features that the compiler defines. Instead, he did a Lisp compiler so that the other programmers could easily extend it with Lisp. He did it simply because extending a language through Lisp, versus by writing and extending a "traditional" compiler, aren''t really comparable tasks.
quote:
What would make Lisp useful is if it would be significantly easier to create the object model that I need (even better if it already exists), with a more intuitive interface, without losing a lot of performance.
Macros transform code to forms that you could''ve written by hand, so you won''t lose performance with them. Instead, since they can hide harder idioms in such a way that they''re nice to use, they encourage writing efficient code. Much like in C++ where STL provides a set of well made containers and algorithms so that people can just as easily use a heap as they could use a basic array, Lisp macros open up new ways to make efficient code as easy to write as sloppy/simple code.
quote:
XML with embedded logic and scripting that has random access to other objects and elements that are defined in XML, in a way that doesn''t break the XML spec insofar as reading and analyzing XML with other third-party XML tools, while still allowing lower-level manipulation from non-XML codebases
Sounds pretty reasonable to me.

##### Share on other sites
Cool. I got On Lisp and am printing it out now, don''t think i want to read 400 pages in acrobat, lol. I read the introductory material, and so far it sounds good. If it works out good, the next time somebody asks for an example, you can point to me It will be open sourced eventually.

Peace

##### Share on other sites
quote:
Original post by Krippy2k
Java and C# appeared to be better suited in this regard, but the performance hits were too much when the information database grew beyond 100,000 or so entries. I was able to cut down on the performance problems in C# much better than in Java, but it posed a problem in portability, where it was desirable to run the application on Unix/Linux servers which are what is mostly available in academia.

There are a couple of things to be aware of:

- It''s very easy to get something working in Lisp. It''s more work to get it running fast (by fast, think something on the order of a comparable C++ implementation).

- In C++, most of the work put in is just to get something working. Usually when it works it''s already fast enough.

quote:
Original post by Krippy2k
This is a case where I would want to define my own object model, which many Lisp proponents seem to think is a major advantage of Lisp.

I think the advantage is that Lisp allows one to add OO to an implementation of Lisp that doesn''t support OO: without having to rewrite the Lisp compiler (you have to do this in Java/C++ etc.) I wouldn''t consider rewriting CLOS just because. The Lisp object model is a superset of the C++ object model. Please have a look at what CLOS offers before you decide to write your own.

quote:
Original post by Krippy2k
The project data is entirely XML-based, which is another area that proponents have harped on. In fact, ideally, I would want tight integration of the object model and XML schema, as XML should be able to fully define the structure and interface of the objects.

Do you plan to exchange your object model described in XML with other implementations in C++/Java ? If not, just use Lisp forms (i.e. expressions). It gets you closer to Lisp, and you can read in all your descriptions from a file and execute then without having to build a parser. For example you can create a text file containing the form

(+ 1 1) ; Add 1 + 1 `

and then read it in and execute it in your program doing no additional work. In C/Java/C++ you would have to build a whole parser for a new language etc.

quote:
Original post by Krippy2k
If Lisp is as useful for implementing these types of things as people make it out to be, I will join them in their Lispdom.

Your first stop should be the newsgroup comp.lang.lisp on Usenet. In fact, if you want help with anything, go here.

A couple of things you should keep in mind when asking for help:
Don''t just say "I want to do this, how do I do it". Which tends to stir people up. Rather say, "I want to do this. I have tried *this*, is there a better way ?". Which shows them that you are making an effort.

The contributors in comp.lang.lisp are very good at not giving an answer directly, but providing enough information that you will be able to work it out for yourself. Which in my mind is more useful than having someone post their code.

##### Share on other sites
Of course I will thoroughly review the existing libraries and features, I''m not a big fan of reinventing the harmonica (the wheel is just too cliche to stomach anymore)

I am not real certain whether I will need to share the object model yet. At the least, I will need to be able to convert XML into the object model, and vice versa. The reason is that most of it will be created using third party XML tools, and there are several million lines of XML already in existence that would need to be imported.

However, it is possible that the best solution might be to use my existing C++ or C# codebase to create a converter. THe creative content doesn''t necessarily have to encompass all of the components. The content creators would be using a limited script set, and myself and other backend folks will both tweak what they present and analyze it to find new ways for them to present their creativity.

The overall idea (in case you are wondering) is to create a computerized entity that has a reasoning/logic model, a personality model, a learning model, and a human interface model. Eventually the personality should be derived from experience, reasoning, filtered randomness, observable input, and simulated experiences. But to get to that point we need an extensive set of existing human-identifiable personalities to start from unless we want to wait hundreds or thousands of years for it to come up with them on it''s own. A series of such entities can then interact and learn from each other, and the personality of one entity may affect the personality of others. Much as in the same way that people often take up the habits and personalities of others when they spend a lot of time with them.

Yet I digress... the main reason I am posting again was to ask which Common Lisp implementation would you recommend as a starting point

Peace

##### Share on other sites
From the few I''ve looked at, Corman Lisp seems to be a good compiler. The trial IDE expires (I prefer Emacs to all the other Lisp IDEs I''ve used anyways), but the command-line compiler does not. It is the most reasonably priced compiler I''ve found (there are a lot of free implementations, but they don''t seem very mature in some respects and they seem to be mostyly interpreters, at least the ones for windows)

##### Share on other sites
quote:
Original post by Extrarius
From the few I've looked at, Corman Lisp seems to be a good compiler. The trial IDE expires (I prefer Emacs to all the other Lisp IDEs I've used anyways), but the command-line compiler does not. It is the most reasonably priced compiler I've found

I agree. I've personally registered Corman Lisp, it's only \$250. The IDE still allows usage after it expires, it just pops up a reminder/nag every 30 minutes or so.

Corman Lisp compiles into native x86. It is fast (not CLOS although Roger is working on that.) It uses native OS threads, it can compile Lisp applications into DLLs. And there are bindings to OpenGL and SDL for it, which are available on Balooga.com

[edited by - HairyTroll on February 23, 2004 7:29:10 PM]

Oh, and someone has even managed to get Corman Lisp working under Linux in Wine. So I would say all the bases are covered.

[edited by - HairyTroll on February 23, 2004 7:31:53 PM]

The other Lisps are LispWorks and Allegro Common Lisp. These are both much more expensive than Corman Lisp. However their 'Personal Editions' do not expire although their heaps are limited to a maximum size - which limits the size of the Lisp application that they can run. Their IDE's are also similar to what you might expect, coming from a VisualC++/Eclipse type environment.

Naughty Dog use Allegro Common Lisp.

[edited by - HairyTroll on February 23, 2004 7:39:08 PM]

##### Share on other sites
The general opinion I get is that lisp can do anything, given sufficint code and effort.
We already know that from CS courses.
Lisp is well suited to certain applications; such as the ones it was written for while under devolopment.
Everything else seems to be a problem and headache, given the opinion of people in this thread.
I''m not surprised: C++ is a reasonably good systems language and a decent jack-of-all trades langauge at general fast computation.
By itself, it fails miserably at certain applications.

What I see is that C++''s(or arbitrary good OO langauge) capabilities for getting lots of different stuff done is better than lisp.

Before the flames restart, I''d like to mention a arcticles topic I read some time back.
Theres two kinds of programming styles:
Programming it perfect the first time, also called the MIT method.
Programming it working and so-so the first time. I forget this philosophys name.

My point is that lisp embodies the mit method: you get it perfect and right. Thats stinking hard and doesn''t always work.
C++ embodies the other one: its not great and is quite dirty, but gets the job done.

Good luck Krippy!

~V''lion

~V''lion

Bugle4d

##### Share on other sites
quote:
Original post by Vlion
Theres two kinds of programming styles:
Programming it perfect the first time, also called the MIT method.
Programming it working and so-so the first time. I forget this philosophys name.

My point is that lisp embodies the mit method: you get it perfect and right. Thats stinking hard and doesn''t always work.
C++ embodies the other one: its not great and is quite dirty, but gets the job done.

Actually, IMHO, it is exactly the opposite.

Lisp allows for a testing of little pieces of ones ideas with immediate feedback, with which errors can be corrected and assumptions verified or rejected immediately. C++, on the other hand, tends to force you to lay the whole project out from the start and often times even subtle changes require hacks, kludges or have large repercussions for your code base. Lisp absolutely does not require one to be brilliant and perfect, though some may like for you to be of that opinion. Cheers.

##### Share on other sites
quote:
Original post by Vlion
My point is that lisp embodies the mit method: you get it perfect and right. Thats stinking hard and doesn''t always work.
C++ embodies the other one: its not great and is quite dirty, but gets the job done.

I think that talk was about how they designed Lisp vs. how they designed C - it''s an argument of why C is popular, not whether Lisp is now better than the C family.

You can use the "worse is better" approach in Lisp quite easily - if you don''t care about performance and future maintaince you can write code that gets the job done pretty fast. Rapid prototyping is something Lisp is very good at due to its interactive development (no need to compile anything), its ability to use lists instead of more elaborate data structures (you don''t need to declare data structures - just fill out a test structure like ''((a 1) (b 25)) and pass it to your prototype function), its dynamic typing.

##### Share on other sites
quote:
Original post by Krippy2k
I was able to cut down on the performance problems in C# much better than in Java, but it posed a problem in portability, where it was desirable to run the application on Unix/Linux servers which are what is mostly available in academia. I understand there are some C# implementations cropping up in *nix, but the consensus seems to be that they are not ready for any serious dev yet.

The problem is with the *nix versions of the .NET framework is they dont have 100% compadibility with the Microsoft extensions, aka Window Forms.

I''ld try and see if it runs under Mono/DotGNU 1st before writing them off.

##### Share on other sites
quote:
Original post by SabreMan
quote:
Original post by flangazor
Is this a discrepency?

No. Nowhere in this thread have I made direct reference to a specific example.

You do realise thats even worse?

A debate without any type of example or proof offered by one side is normally a sign that the debate doesnt have any substance and is a waste of time.

##### Share on other sites
quote:
Original post by ggs
[...]A debate without any type of example or proof offered by one side is normally a sign that the debate doesnt have any substance and is a waste of time.
The problem is that explaining new features to somebody that lacks the experience or knowledge base to understand them is like trying explain what the color blue looks like to a person that has always been completely blind. You can tell the person its frequency, its relation to other colors, what things are blue, and all kinds of other information about it, but until he/she sees it for him/herself he/she will not have a full understanding of it. He/She might even argue that the color blue sounds rather useless, and since it doesn't help him/her, he/she might be right in relation to him/herself at the current time. For those with sight, not having blue would mean expression would be limited to 2/3 of what it could otherwise be.

[edited by - extrarius on February 23, 2004 12:15:50 AM]

##### Share on other sites
quote:
Original post by ggs
You do realise thats even worse?

No.
quote:

A debate without any type of example or proof offered by one side is normally a sign that the debate doesnt have any substance and is a waste of time.

Given that I''ve said next-to-nothing about Lisp in this thread, please explain what sorts of examples it would be appropriate for me to provide.

• ### Forum Statistics

• Total Topics
628277
• Total Posts
2981771

• 10
• 11
• 17
• 10
• 9