Re: To develop a system fit for Web-heroes.

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 12/05/2013 04:54 AM, Richard A. O'Keefe wrote:
> In both cases, the best thing the underlying language can do
> to support programmers is to*not change incompatibly*  so that
> a tool ecosystem can be built around it.  SWI Prolog has some
> of this stuff.  In all seriousness, starting from a language
> that's basically OK,*this*  is the level that needs the work.

That is one way of looking at it. In my opinion though, that requires a
language that is sufficiently rich to begin with. (ISO) Prolog does not
qualify here. Yes, it is Turing complete, so in theory you can do
anything. In practice, lots of things are missing to turn it into a
sensible language for any real world programming task. Some of this can
be added as libraries. Many of these libraries however depend on stuff I
don't see added to the ISO standard in any reasonable time frame. Just
take term/goal expansion as an example.

Just to support web-programming, I have added macro expansion,
conditional compilation, threads, Unicode support, unlimited length
atoms, the C interface including programmable Prolog streams and a
module system to ISO. Of course, I should be fair that I've copied most
of the specifications from others and luckily others copied some of my
solutions.

Note that nothing of the above can be implemented as a library on top of
ISO Prolog.  You must be a real optimist to believe that the ISO 
standard will advance enough to support the above before Prolog is 
forgotten.

So far, you can see all these things as quite pure extensions of the
Prolog language, but they effectively stop any Prolog system from using
SWI's web stuff, unless you take the radical position of YAP to simply
copy SWI's low-level interfaces to the outside world.  Same way, it is
hard for me to copy stuff from others except for e.g., library(rbtrees)
and similar clean Prolog libraries that do not talk to the outside world.

Due to lacking data types and syntactical expressiveness, the result was
still quite poor and hard to sell as something really useful. Quasi
quotations was the first more radical step to provide better support for
application programming in a hybrid world. Adding strings and dicts to
make the set of data types more or less match common data exchange
languages without compromises was the second. Some syntactical
extensions complete the picture (for now).

If these extensions prove useful people will start using them and ask
for support in other Prolog implementations. This is not a big deal; any
skilled Prolog implementor should be able to get this added to their
Prolog system in a month or less.

And yes, it breaks some compatibility, but very limited while
practically any construct from ISO Prolog can be written easily such
that it also works in SWI 7. We have seen some of the reports on this
list that support the backward compatibility claim.

	Cheers --- Jan

P.s.	This is *not* about web programming alone.  I have missed
	structured data with named fields as long as I program in
	Prolog, virtually regardless of the task at hand.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.