Subject: RE: UNDERSTANDING LISTS

From: "Richard A. O'Keefe" <[email-masked]>
Date: Fri, 5 May 2000 10:27:48 +1200 (NZST)

Andrew Gleibman <[email-masked]> wrote:
	I feel using built-in or private Prolog predicates or libraries 
	isn't objective comparison of the language bases.

I didn't use any *private* predicates.
I used things that have been public parts of Quintus Prolog for
about 12 years.  They are as much part of the Quintus Prolog language
as (\+)/1.  What's more, most of the things I used have been part of
the *freely available* DEC-10 Prolog library which was posted to the
net in about 1983.  They have been in Prolog longer than some of the
syntax has.

As for built-in predicates, built-in predicates are *PART OF THE LANGUAGE*.
(,)/2 is built-in, (;)/2 is built-in, (\+)/2 is built-in, setof/3 is
built in, phrase/3 is built-in.  Why is it unobjective to use
phrase/3 (also known as phrase//1) but not to use Sampletalk's ",,"?

If someone insists that *only* features which have specific syntactic
representation are used, then that unnaturally and unfairly cripples
the language so restricted.

Let's list the things I used:

    phrase/3	This has been part of Prolog since about 1980.
		It wasn't fully specified; Quintus (read: I) fixed
		it to handle arbitrary DCG bodies, not just nonterminals.
		A freely usable implementation of DCGs, including this
		behaviour of phrase/3, was posted to the net while I
		was working at Quintus (e.g. before 1989).  More shame
		to Prolog implementors who haven't picked it up.
		(Calypso Prolog uses home-brew code, thanks to Free
		Software Foundation queasiness about things that contain
		copyright notices, even when they say all uses are allowed.)
		DCG notation is not new either:  it's fair to say that
		definite clause grammars came first, and it's "normal" Prolog
		that was the innovation.  The patch I needed in SWI Prolog is
		','(NT1, NT2, S0, S) :- phrase(NT1, S0, S1), phrase(S1, S).

    lit/3	Here it is:
		lit([], S, S).
		lit([X|Xs], [X|S1], S) :- lit(Xs, S1, S).

That's *everything* I needed that wasn't already in SWI Prolog
for Problem 1.  Ok, so that raises the line count from 11 to 14.
Like BIG DEAL.

For Problem 2, I used two predicates that have been in the DEC-10 Prolog
library since the early 1980s, say about 18 years.  The availability of
the DEC-10 Prolog library is regularly advertised in comp.lang.prolog.
It cannot be fairly called "private" any more than the STL was "private"
before 1999 (when the C++ standard finally came out).  Here they are:

    maplist/3	maplist(P, [], []).
		maplist(P, [X|Xs], [Y|Ys]) :-
		    call(P, X, Y),
		    maplist(P, Xs, Ys).

    some/2	some(P, [X|Xs]) :- call(P, X) ; some(P, Xs).

SWI Prolog includes maplist/3, and so it should!
I have no idea why maplist/2 (universal quantification over list elements)
and some/2 (existential quantification over list elements) are missing.

    at_least/2	at_least(LB, LB).
		at_least(LB, X) :- LB1 is 1+LB, at_least(LB1, X).

Even with these publically described and readily available predicates
counted, the line count ratio for Prolog/SampleTalk is still rather
less than 2, nowhere *near* the 10 that was claimed.

	At least I still 
	hadn't time to develop built-in =samples= in SampleTalk.

But *everything* in SampleTalk at the moment counts as built-in
or private!  At least until there is a second source.

	I am inviting everybody to develop it, to apply it, to invest in
	it, to test and research in the technology, to help me finish
	unfinished book "Mind of Programmer" (about SampleTalk, 
	inductive synthesis of text processing programs, and patent-style
	formulations of programming ideas).
	
But why should they?  With the examples we've seen so far, SampleTalk
has offered minor syntactic convenience for toy problems, but does it
scale?  If I want SNOBOL, I know where to find it.  If I want something
with one-way parsing, I know where to find Icon.  If I want reliable
programs with good performance, I know where to find Mercury.  (All of
these are freely available.)  If someone works on SampleTalk, presumably
they have fun, but is there any _practical_ benefit?

	I'd like to make SampleTalk open source:

You make SampleTalk Open Source all by yourself.
Bung in a copy of the Squeak licence or the GPL, include references
to it in other files, and you're away laughing.