Advertisement

Why lisp?

Started by January 31, 2004 10:00 PM
103 comments, last by Vlion 20 years, 11 months ago
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]
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]
Advertisement
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.
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

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



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]
Advertisement
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


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.
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]
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]

This topic is closed to new replies.

Advertisement