Jump to content

  • Log In with Google      Sign In   
  • Create Account


Why lisp?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
104 replies to this topic

#41 Predictor   Members   -  Reputation: 198

Like
Likes
Like

Posted 22 February 2004 - 07:14 AM

quote:
Original post by Anonymous Poster
quote:
Original post by Predictor
Why not use more than one language?
It won't suffice, not by far. When writing a single function, I might find it handy to use pattern matching, continuations and dynamic closure. You might be able to find many languages with the features you want but you wouldn't be able to interoperate between several languages so easily. If you have to change language after every few lines, you'd be writing more interfacing code than normal code. In fact, it'd be so hard that one would in most cases settle for a sub-par solution within a single language. The jumping between several unrelated languages becomes unbearable or practically impossible, if you really want to use many different features from several languages.

And those languages, even when combined, still wouldn't be able to give me all the features I can do with macros. There are lots of uses for macros that extend the language in such a way one would never expect to see in some "pre-written" language, because those features would be so highly dependent on a single problem field, or even just your particular application.



Who said anything about changing languages "every few lines"? I think people here are talking past each other.

The claim was made that Lisp provide some unspecified advantage over other languages. Knowing that Lisp cannot possibly be better than all other tools under every circumstance, my question is: Under what circumstances does Lisp provide a real advantage?

Most computing tasks which are in commercial demand are fairly well studied, hence the development of relatively specialized languages and related tools (macro languages, development environments, debuggers, etc.). My contention is that these tools (C/C++, SQL, Perl, Fortran, whatever) when used in combination, as they are in real work offer two important qualities: 1. sufficient syntactic elegance to adequately represent useful solutions to common problems and 2. efficient use of available system resources.

Is there some bizarre situation which could be dreamed up, under which Lisp would dominate other, more popular tools? Sure. What I wonder is: What fraction the actual programming effort that is undertaken on this planet is covered by such situations? It's obviously greater than zero, but I doubt its more than a few percent, if that.

Most of the examples given thus far of Lisp's presumed advantage are technically cool, but I don't see that they provide a general advantage. The thing about needing to be more intelligent to use Lisp seems completely backward to me: How is a tool being more difficult to use an advantage? Color me old-fashioned, but I think for most computing tasks, conventional tools will continue to dominate the field. I can't imagine someone simulating Fortran (or, insert any of a dozen other languages here...) in Lisp and getting any kind of run-time performance.

-Predictor
http://will.dwinnell.com




[edited by - Predictor on February 22, 2004 2:24:06 PM]

Sponsor:

#42 Predictor   Members   -  Reputation: 198

Like
Likes
Like

Posted 22 February 2004 - 07:22 AM

quote:
Original post by Anonymous Poster
quote:
Original post by Predictor
Why not use more than one language?
It won't suffice, not by far. When writing a single function, I might find it handy to use pattern matching, continuations and dynamic closure. You might be able to find many languages with the features you want but you wouldn't be able to interoperate between several languages so easily. If you have to change language after every few lines, you'd be writing more interfacing code than normal code. In fact, it'd be so hard that one would in most cases settle for a sub-par solution within a single language. The jumping between several unrelated languages becomes unbearable or practically impossible, if you really want to use many different features from several languages.

And those languages, even when combined, still wouldn't be able to give me all the features I can do with macros. There are lots of uses for macros that extend the language in such a way one would never expect to see in some "pre-written" language, because those features would be so highly dependent on a single problem field, or even just your particular application.



Since multiple, non-Lisp languages are used together for exactly this purpose everyday, on some of the largest systems in the world, I suppose the above needs to be qualified. Let me give an example. I work at a bank, where a substantial database of customers and their activities are stored in an Oracle database. The data in that database is regularly churned by SQL code. My department, which performs the analytic function of the bank uses SAS both: 1. to extract and process data from the relational database and 2. to store intermediate and final results (SAS is sort of both a language and a database). I write programs to perform all sorts of quantitative analysis (mainly predictive modeling), which I do in SAS and MATLAB. This, in my experience, is a typical collection of programming tools in the corporate world. My question is: Is anyone here seriously suggesting that any of these three components, or all of them, is a candidate for replacement by Lisp (let's ignore transition costs, legacy code issues and the skill set of current developers)?

Let's be clear about the real mix of programming situations: what you term "single problem fields" are, together, the bulk of the computing world, by any serious measure.

-Predictor
http://will.dwinnell.com





[edited by - Predictor on February 22, 2004 2:26:24 PM]

#43 Diodor   Members   -  Reputation: 517

Like
Likes
Like

Posted 22 February 2004 - 08:15 AM

quote:
Original post by Predictor
The thing about needing to be more intelligent to use Lisp seems completely backward to me: How is a tool being more difficult to use an advantage?


Lisp _allows_ you to be more creative - the extra intelligence you spend on writing code pays up because the resulting code is that more compact, elegant and maintainable.

quote:

Color me old-fashioned, but I think for most computing tasks, conventional tools will continue to dominate the field. I can''t imagine someone simulating Fortran (or, insert any of a dozen other languages here...) in Lisp and getting any kind of run-time performance.



Whether Lisp will dominate anything or not is not necessarily relevant. The embedded languages, built on Lisp using Lisp macros, transform the code from the embedded language to Lisp code, which is then compiled. The run-time performance doesn''t suffer in any way.

quote:
Who said anything about changing languages "every few lines"? I think people here are talking past each other.


You understand the need for specialized languages for special problems, yet you aren''t thrilled at the thought of freely using several different languages together in a single function. I find this thought quite amazing.

#44 Predictor   Members   -  Reputation: 198

Like
Likes
Like

Posted 22 February 2004 - 08:26 AM

quote:
Original post by Diodor
You understand the need for specialized languages for special problems, yet you aren''t thrilled at the thought of freely using several different languages together in a single function. I find this thought quite amazing.


Whether Lisp can usefully recreate the functionality of those other languages is the issue. Are you saying that it would be possible to re-create, for example, the performance of a large corporate relational database (Oracle, let''s say) in Lisp?

-Predictor
http://will.dwinnell.com



#45 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 22 February 2004 - 08:30 AM

quote:
Original post by Diodor
Lisp _allows_ you to be more creative - the extra intelligence you spend on writing code pays up because the resulting code is that more compact, elegant and maintainable.


Would being more intelligent be an advantage in any language? Why is this an advantage specific to Lisp?

-Predictor
http://will.dwinnell.com





#46 HairyTroll   Members   -  Reputation: 192

Like
Likes
Like

Posted 22 February 2004 - 11:10 AM

quote:
Original post by Predictor
Are you saying that it would be possible to re-create, for example, the performance of a large corporate relational database (Oracle, let's say) in Lisp?



I'm not sure why one would want to rewrite a database such as Oracle in Lisp. Rather use Lisp to perform analysis of the data retrieved from the database, such as in the following case:

Lisp & C/C++ are used to run the back-end for Orbitz.

Here is an email from one of the guys that implemented the system.

quote:

Occasionally we've had to move code from Lisp to C++, usually because of data loading issues (Lisp garbage collectors just can't deal with gigs of data, and there's no way to rapidly load gigs of data into a Lisp). Our experience has been a 10 to 1 code expansion; I don't think there are any programmers in our company that regret the choice of Common Lisp.



If you read the article in its entirety, you will see that the strengths of both C++/C and Lisp are used to full advantage. They didn't do the entire system C/C++, neither did they attempt to write everything in Lisp.


[edited by - HairyTroll on February 22, 2004 6:12:52 PM]

#47 Predictor   Members   -  Reputation: 198

Like
Likes
Like

Posted 22 February 2004 - 11:56 AM

quote:
Original post by HairyTroll
quote:
Original post by Predictor
Are you saying that it would be possible to re-create, for example, the performance of a large corporate relational database (Oracle, let''s say) in Lisp?



I''m not sure why one would want to rewrite a database such as Oracle in Lisp.



I am not arguing that one would want to. What I wrote, which you quote above was in response to the following from Diodor:


quote:
Original post by Diodor
You understand the need for specialized languages for special problems, yet you aren''t thrilled at the thought of freely using several different languages together in a single function. I find this thought quite amazing.



I fully appreciate the benefits of mixing programming languages (whether Lisp is included or not)- in fact, that''s what I''ve been arguing for. Others here, though, seem to be aserting that Lisp can take over the function of all other languages due to its extensibility.


-Predictor
http://will.dwinnell.com




#48 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 22 February 2004 - 01:03 PM

quote:
Original post by Predictor
Who said anything about changing languages "every few lines"? I think people here are talking past each other.
No, you''re missing the point. I *want* to have a set of features X,Y,Z in a single function. If language 1 gives me X, some other gives me Y and some other gives Z, I''ll *have* to change the language every few lines or as the realistic case is, use one language that best suits the situation and use sub par solutions for the features it lacks. Or I can use Lisp, which gives me X,Y,Z within one language, thanks to macros (and possibly other features).
quote:
Knowing that Lisp cannot possibly be better than all other tools under every circumstance
What do you know? Lisp can be pretty close under every circumstance, if not better. It all depends on the team''s ability to create (or find someone else''s implementation) the most useful abstractions they''ll need. Just the fact that a prolog compiler can be written in Lisp with a few hundred lines should give you some feel about Lisp''s ability to adapt to highly different domains.
quote:
Under what circumstances does Lisp provide a real advantage?
If the project is large enough and the team is skillful enough. Or if the team has already built all kinds of useful abstractions in their previous projects, Lisp has an advantage on small projects also.
quote:
but I don''t see that they provide a general advantage.
You''re just unwilling to accept it. It sounds as credible as a C programmer saying "I don''t see how OO would provide a general advantage".
quote:
The thing about needing to be more intelligent to use Lisp seems completely backward to me: How is a tool being more difficult to use an advantage?
C++ is more difficult to use than Basic. C++ has an advantage for dedicated programmers because it offers more power -- power that takes more time to master. Lisp has an advantage for the same reason. A person who uses C++ and Prolog need not understand how Prolog really works. A person who implements something like Prolog into Lisp, must be a pretty good programmer. You can''t get power out of Lisp if you''re not able to think liberally. You could just be using CLOS and some other pre-made features, but that wouldn''t make Lisp worth using.
quote:
I can''t imagine someone simulating Fortran (or, insert any of a dozen other languages here...) in Lisp and getting any kind of run-time performance.
Believe it or not, the performance of Lisp, also when used to compile some other language, is not bad. The needed features/sub-languages wouldn''t be "simulated", but compiled.

#49 Kylotan   Moderators   -  Reputation: 3329

Like
Likes
Like

Posted 22 February 2004 - 01:13 PM

quote:
Original post by Diodor
You understand the need for specialized languages for special problems, yet you aren''t thrilled at the thought of freely using several different languages together in a single function. I find this thought quite amazing.


The thing is, with Lisp you''d have to write these mini-languages, right? Whereas with 2 existing languages, they are already designed to fit the different needs. It''s like the difference between a factory that makes tools, and a well-stocked toolbox; Lisp is more powerful but does that make it immediately more convenient?

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]


#50 Diodor   Members   -  Reputation: 517

Like
Likes
Like

Posted 22 February 2004 - 07:29 PM

quote:
Original post by Kylotan
The thing is, with Lisp you'd have to write these mini-languages, right? Whereas with 2 existing languages, they are already designed to fit the different needs. It's like the difference between a factory that makes tools, and a well-stocked toolbox; Lisp is more powerful but does that make it immediately more convenient?


Of course, you're right. You have the choice of interfacing with the other (external) languages in the usual multi-language ways (also available in Lisp). (the Oracle example before should fit here I suppose)

It should be noted that usually only a few features of another language are needed at a time.

[edited by - Diodor on February 23, 2004 2:43:53 AM]

#51 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 22 February 2004 - 07:31 PM

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.

#52 CoffeeMug   Members   -  Reputation: 852

Like
Likes
Like

Posted 22 February 2004 - 09:01 PM

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?

#53 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 22 February 2004 - 09:36 PM

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)

#54 Predictor   Members   -  Reputation: 198

Like
Likes
Like

Posted 22 February 2004 - 09:55 PM

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]

#55 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 22 February 2004 - 10:58 PM

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.

#56 flangazor   Members   -  Reputation: 516

Like
Likes
Like

Posted 23 February 2004 - 12:48 AM

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]

#57 SabreMan   Members   -  Reputation: 504

Like
Likes
Like

Posted 23 February 2004 - 02:07 AM

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]

#58 Krippy2k   Members   -  Reputation: 134

Like
Likes
Like

Posted 23 February 2004 - 02:29 AM

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

#59 flangazor   Members   -  Reputation: 516

Like
Likes
Like

Posted 23 February 2004 - 02:30 AM

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.

quote:
SabreMan also said:
In a reasonable debate, you should not expect your co-debaters to go digging around for `evidence' that you insist exists. If you want to communicate your ideas to people, then you will find people are more willing to listen if you make it easy for them. Without doing that, you appear very much like a zealot.



Is this a discrepency?

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

#60 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 23 February 2004 - 03:01 AM

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>




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS