Re: Announcement: Homage to SWI-Prolog

"Richard A. O'Keefe" <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 25/07/2013, at 5:17 AM, Torbjörn Lager wrote:
> Richard> In deleting the query I had typed, I was dismayed to see that
> the "?-" went too.  Had I completely broken the thing?  Would any
> query ever work again.  (_Serious_ question.  I genuinely believed it
> possible that the interface would not work again.)
> 
> It is hard to do much about that. That is why I provide the Clear
> button underneath the query field instead.

(a) Would it work to put the "?-" and "|:" prompts *outside* the
    edit boxes?  I've used a Prolog on the old Mac that did something
    like that.

(b) I am sorry, but while "Clear" is a good reminder for people who
    _already_ know what the button does, it doesn't clue in people
    who don't.  I thought it would probably erase the transcript window
    above.
> 
> Richard> Finally despairingly I click on "Solve": in 34 happy Prolog
> years I've never heard "Solve" used for this
> before.
> 
> Must say I find it a bit odd you haven't heard "solve" in the context
> of "solve a goal".

Yes, but "solving a goal" is a repeated step in "executing a query".
I've seen "Run", "Query", "Ask", "Do it!" and some others.

> Richard> Typing a query in one box (so that my eyes have to be
> pointing down there) and then having the answers appear way up
> somewhere else reminds me of the old Apollo interface, which I
> couldn't get away from fast enough.
> 
> I contemplated implementing a more conventional command line interface
> but it somehow felt weird to have that in a browser.

Weird schmeird.  It's a basic user interface issue: all the stuff the
user has to concentrate on should be happening where the user is looking,
if that's practical.   I didn't say "I want a conventional command line
interface".  What I want is the query and answer to be _close_.  For
example, the box could be _just above_ the place where the answers come out.
> Richard> The syntax colouring is weird.
> 
> Yes, I'm aware of that. It even says so in the Help section under
> Issues.

Yes BUT.  It is better to have *NO* colouring than to have crazy colouring.
There is a very simple fix: leave it doing whatever syntax processing it
wants, but make the default colour for _everything_ black.

There is actually a fundamental issue here, which is that I don't think
you _can_ colour Prolog usefully without integration with a Prolog
processor.  The ACE colouring seems to be *trying* to make a 3-way
distinction:
 d. this is where an executable item is defined
 u. this is where an executable item is used
 t. this thing that looks like an executable item is data
That is a far more useful distinction than a distinction between
variables and constants -- if you can't tell the difference between a
capital letter and a small letter colouring isn't going to help much.
But you can't tell the difference between u and t without processing
:- meta_predicate declarations.

> JSFIDDLE and JS BIN seem to be used a lot, so maybe others want to use
> SWISH.

I dare say they will.  However, there's a big distinction.
JSFIDDLE is about HTML/CSS/Javascript, so there is something for
the Javascript code to act on.
Many of the small Prolog programs I write are there to read and
write files.  I _can't_ use a system that doesn't offer file I/O
for such programs.

Of course, that doesn't mean that the "files" that an example _thinks_
it is reading and writing have to be _real_ files...
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.