Re: Announcement: Homage to SWI-Prolog
"Richard A. O'Keefe" <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 24/07/2013, at 4:00 PM, Ceyhun Ciper wrote:
> That's nowhere near JSFIDDLE, so please don't use this reference as a
> marketing ploy.
I had never heard of JSFIDDLE before, so I googled it, and visited the
web site. I then spent the next 10 minutes trying to get a straight
answer to the question "What the hell IS jsfiddle?"
Not a good thing to imitate.
*Complete* trustworthy documentation is really important if you want to
produce something other people can use. I've been working on a Smalltalk
compiler for years, and am just getting around to writing the documentation,
and it's _harder_ than writing the code, and getting the documentation right
has forced me to fix an embarrassing number of issues that didn't bother _me_
any more because I knew about them...
Personally, I am increasingly !FED! !UP! with monstrous web applications
that make writing code in vi look attractive.
Why am I making more and more use of Xcode?
Because I can forgive it its crippled editor, bizarre colouring,
and obfuscated routes to configuration -- last year's documention
is never much help with this year's Xcode -- for the sake of ONE thing.
That's Product|Analyze. It just keeps getting better and better at
finding syntactically legal code that's broken and making it easy for
me to find and fix it.
Heck, I can _almost_ bring myself to forgive its crippled navigation
features. (From use to definition is very helpful, but from definition
to uses is essential, and missing. cscope is better!)
Do take care that using the Back button, or losing your connection
because you've walked out of the scope of your Wifi connection,
won't lose recent work. And make sure that the editor remains snappy
when the i n t e r m i t t e n t ne t slows
to a crawl like it has for me several times recently.
Oh, and the current version of the browser I use has switched to
creating tabs where it used to create windows. I have no idea why.
The result is that I get rid of the stuff I'm looking at by typing
Cmd-W and all the other tabs in the window go away as well. Not nice.
Right now I am staring at a window with SWISH in it.
And I'm, like, "what the **** am I supposed to *do*?"
The red "Error: /storage/technology does not exist" is
enough to scare me off.
SWISH is this much like JSFIDDLE: they both fail the beginner test.
Someone arrives at one of these things for the first time?
They need to see a paragraph of explanation and a paragraph of
instructions.
Since I know something about Prolog, I see a box with "?-" and
figure I can type a query there. Pressing Return, shift-Return,
Option-Return, Command-Return, none of these makes the query
happen like I expect. Finally despairingly I click on "Solve":
in 34 happy Prolog years I've never heard "Solve" used for this
before. And I'm told
% No permission to call sandboxed `fd1a-1094-4247-0f9a.li147-229:current_predicate/1'
except that until I pasted that into Mail I couldn't actually
*see* the bit that said 'current_predicate/1' so I had no idea
what it was about. It doesn't make sense that I can't call
current_predicate/1. That means I can't try some meta-circular
interpreters.
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.)
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.
The syntax colouring is weird.
In
prove((B, Bs)) :-
prove(B),
prove(Bs).
"prove" is bluish", then "(" is black, then the next "(" is
!red!, then B is lichen green, then "," is black, then "Bs"
is lichen green, then )) :- " is black, then "!" is blue,
then "," is black, then "prove" is !red!, then "(" is black,
then "B" is lichen green, &c &c. So I think maybe definitions
are bluish and calls are red, but
writeln(Question),
read(Answer),
Answer = yes.
has a red "writeln" but a black "read" and a black "=".
Then in prove(true), true is blue (just like "yes" is
true in "Answer = yes"), but then in yellow(tweety),
tweety is red.
And then comments are the same lichen green as variables,
or close enough that I can't tell them apart.
As for the expert system example itself, try the query
?- prove(cuddly(X)).
I am in awe of the web-fu demonstrated by this project,
but I cannot imagine wanting to share code this way instead
of using github or putting stuff on my own page.
The thing I dream of for Prolog is something like PLT Scheme
(now Racket) or clang --analyze, something that helps me
write *working* code.