Re: Mainstreaming Prolog a Pragmatic Approach?

From: Benjamin Johnston (superhero_at_benjaminjohnston.com.au)
Date: 03/24/04


Date: Wed, 24 Mar 2004 21:46:05 +1000


Thanks, Matthew for a well written and well thought out posting. My personal
experience is that Prolog is an incredibly useful language for virtually all
of my "non-serious" programming. Parsing files, performing transformations,
processing text, generating websites and performing web-scraping are among
many tasks that I've been impressed with Prolog's practical usefulness. Even
though I know many of the mainstream scripting and web languages, I more
often than not end up using Prolog. That is why I believe it has a place as
a mainstream language.

I think your point about Prolog's support (government, academic) is a good
one. I think you're right when you question whether logic programming really
is a natural and easy to use programming language as it is claimed to be. I
know people who have excelled at learning Prolog (in a university course),
but when I ask them why they don't use it in "real life", they indicate that
they just can't see how Prolog would be used.

I think with languages like Java you can get away with writing
copy-and-paste code without actually understanding what it does. You can
have a fully functioning program immediately but then learn the exact
nuances of the language later. It's possible to write Java code with a
disengaged brain. Prolog, I think, is a lot more demanding -- the truth of
the matter is that Prolog is *executed* on a computer even though Prolog is
is said to be "declarative". I think this level of indirection is what makes
it difficult.

However, I also feel that Prolog isn't really taught in the right way. My
feeling is that way too many textbooks and courses devote too much time to
solving problems about mothers, grandmothers and ancestors. I think a more
practically oriented course or textbook might make some difference -- the
very first page should introduce some plausibly practical but simple program
(like, say, something that transforms lines from one set of codes to
another, or maybe a query language for a CSV-text or RDF based database). An
emphasis on actually getting things done would bridge the gap between
knowing Prolog and knowing how to apply Prolog.

I'm really beginning to think that Prolog Server Pages might be something
worthwhile for me to go ahead and properly implement. It is a simple idea,
it offers a natural transition from beginner to advanced programmer, it can
demonstrate practical database querying, it can demonstrate writing parsers
and interpreters, and it produces quite visual output that is rewarding for
beginners.

I also realize that you suggest that there may be deeper questions that also
need to be answered. I'm not sure that I have a response to those -- but I
will certainly spend some time considering them. Maybe you're right, and
maybe the language will never capture the imaginations of anybody but a
small minority who have for whatever reasons been exposed to just the right
conditions to enjoy and understand the language and not be put off by it.

-Benjamin Johnston

"Matthew Huntbach" <mmh@dcs.qmw.ac.uk> wrote in message
news:c3rmoq$f0g$1@beta.qmul.ac.uk...
> billh <sequitur@sonic.net> wrote:
> > Matthew Huntbach wrote:
>
> >> The thesis of this thread is that Prolog *could* become a "mainstream"
> >> language, and it's the fault of the Prolog community that it hasn't -
all
> >> that is required is for the right sort of textbook to be written, or
for
> >> people who teach Prolog to do it in a different way. I don't think this
is
> >> so, I think Prolog is a language whose limitations mean it will not
achieve
> >> any more widespread use than it has already.
> >>
> >> I'm not even sure that Prolog is a "splendidly useful" language. Even
though
> >> it's a language I've played with for a long time and am quite familiar
> >> with, I find it difficult to think of any circumstances where it's the
> >> language I would choose to use for any significant piece of
programming.
> >> Once again, when I say this I don't mean to condemn the whole of logic
> >> programming, since I distinguish Prolog as just one example of the
logic
> >> programming paradigm - I'm not using "Prolog" tomean "any logic
programming
> >> language".
>
> > You are playing games with the word "Prolog".
>
> No, I don't think so. If we are going to talk about Prolog, hadn't we
better
> make sure we agree what we mean by the word? Sometimes the word has been
> used rather sloppily to mean any logic programming language (which would
> incorporte things like Mercury), but I've always been keen that it should
> not be used in that way. The reason for this is that people who may have
> been put off Prolog by its limitations may not realise that there are
other
> logic programming languages which overcome those limitations. My
preference
> is to use the word "Prolog" for that subset of logic programming with
strict
> left-to-right execution of goals, depth-first search with backtracking,
and
> no types.
>
> > Is it the "thesis" of this thread "that Prolog *could* become a
> > "mainstream" language, and it's the fault of the Prolog community that
> > it hasn't"?
> >
> > No, this thread is asking the question: why hasn't Prolog met with
> > widespread acceptance and what might be done to bring that about?
>
> This discussion started off when someone made an accusation against the
> Prolog community that we deliberately teach our language in a way that
makes
> it seem hard in order to prevent it becoming mainstream, in order that we
> should remain some sort of exclusive clique. I thought this was a crazy
> accusation - I am sure the last thing any enthusiast for a programming
> language would want to do is stand in the way of it becoming mainstream,
and
> it is the dream of nearly every enthusiast of a programming language that
it
> will take off and become a standard language used in real-life
applications
> by large numbers of people. So, in a way, I'm defending the Prolog
community
> against what I thought was an unfair accusation.
>
> > Your answer? Because everthing that could have been done to make
> > Prolog acceptable was done, and done in the best of all possible ways,
> > if Prolog has not been widely accepted then, since as part of this, the
> > now "standard" ISO definition of Prolog is necessarily the best of all
> > possible definitions of "Prolog", the fault cannot lie with the ISO
> > definition of Prolog but, rather, must be inherent in the very concept
> > "Prolog".
>
> I don't think the fault lies with the ISO definition of Prolog, because
the
> ISO definition just cleans up the edges and subsidiary issues, the
> essentials of Prolog - left-to-right depth-first search with unification
> and backtracking - were around long before the ISO definition.
>
> In the course of this conversation, the languages Perl, PHP and Python
were
> mentioned as languages which had become mainstream. Now these are
languages
> which have had nothing like the support that Prolog has had. Prolog is
> taught in universities across the world, and has been for many years. A
lot
> of government money has been thrown into Prolog and other logic
programming
> languages - particularly when the Japanese government latched onto them
for
> use in its Fifth Generation project in the 1980s. Hundreds if not
thousands
> of academics have spent large amounts of time researching and developing
> logic programming languages, there have been major academic conferences on
> the subject. So why is it that Perl, PHP and Python, which spread with no
> sort of official or academic backing or the prestige that Prolog has long
> enjoyed amongst the academic community, have become mainstream, while
Prolog
> which has been around for decades longer hasn't?
>
> > I do not accept your premise and I find your conclusion repugnant on
> > its face.
>
> This is just throwing abuse. I'm a logic programmer, have been since I was
> an undergraduate taught Prolog by Bob Kowalski, have been employed on
grants
> to develop logic programming, have written a book on logic programming,
> continue to research, write on and play with logic programming. It's a
> matter of great concern to me that logic programming hasn't taken off. But
I
> think we need to be honest with ourselves when we ask why. Maybe it was
> over-hyped and suffered a backlash. Maybe it isn't such a natural and easy
> to use programming paradigm as we believed. Maybe there have been too many
> competing research teams which have created the impression of confusion.
> Maybe the dominance of one imperfect or problematical form of logic
> programming has stifled the development of a better one.
>
> What I do know is that if when someone asks these questions all he gets is
> abuse thrown back at him, it will not help the promotion of logic
> programming. It's something one often sees in life - a good idea or
> something worthwhile is killed by kindness because its supporters won't
> listen to criticism which is actually intended to be constructive and to
> bring out and correct its weak points.
>
> Matthew Huntbach



Relevant Pages

  • Re: Minsky still posting
    ... |>> I think the relatively simple control mechanism of Prolog is the ... |> The programming "market" obviously doesn't select tools on technical ... | a structured assembly language, and I use Java as a practical language ... | languages that academics have put so much work into - the functional ...
    (comp.lang.prolog)
  • Re: Sublists question
    ... I do not really get what the predicate means or does. ... >>helps just to write the predicate out clearly in natural language, ... >>then translate into Prolog. ... more as a functional programming language than as a logic ...
    (comp.lang.prolog)
  • Re: Mainstreaming Prolog a Pragmatic Approach?
    ... >> people who teach Prolog to do it in a different way. ... I think Prolog is a language whose limitations mean it will not achieve ... logic programming languages which overcome those limitations. ... should remain some sort of exclusive clique. ...
    (comp.lang.prolog)
  • Re: Discussion: Is prolog domain specific?
    ... The availability of exhaustive search lets you program things ... this cannot be the basis for a general purpose programming language. ... > solution for it in Prolog. ...
    (comp.lang.prolog)
  • Re: Mainstreaming Prolog a Pragmatic Approach?
    ... The main thing that Prolog has that other languages don't have is search ... backtracking is what you want. ... I mean a language that is small and demonstrates a principal, ... that hasn't been the case - why instead of the logic programming paradigm ...
    (comp.lang.prolog)