Fog Creek Software
Discussion Board




Prolog

I just rediscovered Prolog after using it at Uni a while back. What a brilliant language. Has anyone here used it much?

Matthew Lock
Monday, July 14, 2003

LISP and Prolog are academic programming languages praised by the academics. :)

They have very little practical applications, mostly in strange/unusual areas.

I used to like LISP, but I stopped using it once I understood that it's a nice programming language, but it's not very productive for my usual tasks.

Bay B.
Monday, July 14, 2003

I tried using Lisp and Prolog for college classes about ten years ago, but at the time I was very much a blinkers-on C guy with an attitude of "if it can't be done in pointers it ain't worth doing". So I gave up a bit too easily on them, failing to see the point.

What's changed my mind recently is some of the articles on www.paulgraham.com - some of them come off as too much of a pro-Lisp rant, but worth having a look at some the practical uses of it.

I'd say it's real value is in server side applications, where the user interface doesn't matter so much. I'm not sure how Prolog integrates with the outside world, maybe it has some equivalent of streams in Lisp.

Better Than Being Unemployed...
Monday, July 14, 2003

I also got my enthusiam for lisp and prolog from reading Paul Graham too actually!

Matthew Lock
Monday, July 14, 2003

If you remember WintNT 3.51, then you may also remember that when you rebinded the network adapters, it took a long time.

My boss (former Microsoftie), says that the id!0t who wrote that did it with Prolog, to make it easier, but also slower.

Could have been pulling my leg I guess.

--
ee

eclectic_echidna
Monday, July 14, 2003

> They have very little practical applications,
> mostly in strange/unusual areas.

This doesn't make any sense. How can you say that a general purpose programming language like Common Lisp doesn't have broad practical application? Would you say the same thing about C++? What language are you using for your "typical/usual areas?"

> I used to like LISP, but I stopped using it once
> I understood that it's a nice programming language,
> but it's not very productive for my usual tasks.

Again, I'm amazed. What are these usual tasks? I have programmed in many languages, and so far the only language I've used that proves more productive than Common Lisp is Perl. But that's for small programs, and I already know Perl better than Common Lisp, so the comparison is far from settled.

You can criticize Lisp not being well adopted in the marketplace, and hence perhaps more challenging to deploy today, but you cannot deny its astounding productivity. To do so is to admit that you never understood much about Lisp.

Steven E. Harris
Monday, July 14, 2003

I agree with Matt's "brilliant language" comment ... I said recently (in another thread) that Prolog makes me think in a completely different way than other languages, and to me, that's exhilirating. I haven't used it in a while but I'd love to get back to it.

Zahid
Monday, July 14, 2003

I suspect "Bay B" is trolling. If not, BB, why don't you tell us a bit about your experience using Lisp and how it proved unsuitable for "practical applications"?

Gareth McCaughan
Monday, July 14, 2003

99% of my daily work consists of:

- programs with a rich GUI

- custom controls that display a nice user interface

- programs that call Windows API and different COM objects

- programs that work with a database, and sometimes several different databases (Interbase, Oracle, Access)

- ISAPI plugins for the web server

- other TCP/IP programs

Now, in one corner, stands LISP, with, let's say, Franz Allegro CL as the most advanced LISP IDE.

In the other corner, stand Delphi, Visual C++, Visual Basic.

Which is more productive?

I assure you that the second group is WAY more productive than the first group. There is simply no comparison.

LISP is a beautiful language, but I am more interested in productivity.

So, I think my original comment is 100% true and supported by facts.

Bay B.
Tuesday, July 15, 2003

Somebody may argue that if we compare "just the language", and not the various libraries, components, and support functions, then LISP may win over Visual C++, Delphi and VB.

This may well be true.

But, it so happens that I never use "just the language". I'm a practical guy.

So, by "language" I mean the language, the libraries of the language, the IDEs available, and even - why not - the available documentation.

This is something I liked about Python, and an important point I would like to make: the Python documentation seemed to be written is such a way that I understand how the library works very quickly (by reading very little text), and so I can move on to the implementation rapidly.

Good documentation can increase productivity.

Also, good components, libraries, IDEs can give a huge productivity boost.

A practical developer will very rarely work with "just the language", so these things must be taken into account when evaluating productivity.

Bay B.
Tuesday, July 15, 2003

Bay B., thanks for elaborating. I see where you're coming from and, given your requirements, can understand why using some Lisp would not be an easy choice. There are Lisp libraries to address most of your needs, but some, particularly for GUIs, may not be as up-to-date as those in other host languages. I don't work on anything requiring the Windows API or COM services, so I can't comment on support for those. The database, networking, and Web server interfaces are definitely available. Integrating with ISAPI would likely require some work similar to the Apache mod_lisp module.

While I commend your pragmatic choices, I still disagree about productivity. Perhaps we're thinking of differing definitions. I read your "productivity" to mean "can't get my job done unless I use these tools." Getting the job done is undeniably important. But I meant "productivity" as in "get more done in less time with less cruft, fewer errors, clearer thinking, and more pleasure." If using Lisp won't allow you to build the right program, though, the latter productivity will never get you to the former.

I am advocating Lisp here but will admit, like you, that I can't use it for all of my work. My current project requires us to use C++ and VxWorks. Switching tools isn't an option, and we have to build the program, so, yes, I am only "productive" if I use C++ and VxWorks well. But I am constantly aware of how much more quickly and easily I could build the program if we could Lisp instead. That longing, or resentment, encourages me to study Lisp more to see if it really can't be used, and if so how to go about overcoming any limitations.

You mention Python. You can find frequent mention of Python's "batteries included" library distribution on the comp.lang.lisp newsgroup. Many similar libraries exist for Common Lisp, but they don't arrive with a centrally-provided Common Lisp implementation. Either a CPAN-style repository or a Python-style "batteries included" attitude toward packaging would help people get started more quickly.

You also mentioned documentation and IDEs. Those are two areas in which working with Lisp excels. Documentation is built into the language, and most editors or IDEs can also make rich use of the reflective nature of the language to help you understand and manipulate code. The IDE and the basic Lisp interaction model provide a whole different approach to programming. It's not a typical write-compile-run-debug cycle. The main boost in productivity I allude to above emerges from the distinctive interaction and system construction model offered by Lisp.

Steven E. Harris
Tuesday, July 15, 2003

To get back to the initial topic:
I used to consider myself a Prolog programmer, back in the nineties. I could not understand why my friends found it so difficult. On the contrary, it was so easy... (OK, you had to know where to put the 'cut").
I remember writing a program solving complex resource-allocation problems in a few pages of Prolog.
But I am ready to admit that I do not know how it could fit into the programming tasks of today.

GP
Tuesday, July 15, 2003

*  Recent Topics

*  Fog Creek Home