[mercury-users] Mercury needs a Tutorial

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Feb 11 21:47:53 AEDT 1999


On 11-Feb-1999, Ralph Becket <rwab1 at cam.sri.com> wrote:
> Funnily enough, I started work on a tutorial last night.  A number of
> questions raise their heads:
> 
> 1. What level should we pitch the tutorial at?  If we assume
> familiarity with (e.g.) Prolog then the tutorial will be of less use
> in an undergrad' teaching setting and no use at all in getting Mercury
> out to the non-LP masses.  I'm inclined (and this is the approach I
> started out with last night) to assume nothing other than a reasonably
> general computer science background and some past programming
> experience.

I think that is the right kind of background to assume.

> The trouble with this approach is that it's probably too
> verbose for LP experts who want to learn Mercury.

Most of those either (a) can easily skim over the bits they understand
(b) are capable of learning Mercury from the reference manual, or
(c) have learnt Mercury already! ;-), so I think that is OK.
And we already have a "Prolog to Mercury transition guide" for
those kind of people (though it could doubtless be improved).

> 2. To teach by example or not?  I've started out with "Hello, World!"
> as is the tradition.  I'm planning on starting with short new programs
> to illustrate each new concept.  Does anybody have any strong feelings
> that this is the wrong way to go?

I think teaching by example is a very good idea.

> 3. Traditional `flat' text vs hypertext.  I had a look at Chris
> Phoenix' Smalltalk tutorial a while back and was greatly impressed.
> The neat idea was that code is presented in a web page and the viewer
> can click on any token in the code to get a `pop-up' explanation.
> Take a peek at
> http://squeak.cs.uiuc.edu/cphoenix_tutorial/hrefcode.html
> I'm not at all sure whether this would work for a whole tutorial
> (Chris only uses it for one example, but I have to say I found it most
> enlightening).  An alternative is to stick with `plain' hypertext.
> Any thoughts?

That sounds like quite a lot of work.  
I suggest you start off with "plain" hypertext initially,
and then possibly extend it in this way later.
At this stage, it seems more important to get coverage
of as much of the language as possible rather than having
a super-duper explanation of "hello world".

> 4. One problem with teaching Mercury is that there are a number of
> subtle aspects to the language that you are usually forced to consider
> explicitly in your code (e.g. mode and determinism declarations).
> Teaching a non-Prolog type how "Hello, World!" works is non-trivial.
> The very first example introduces modules, interfaces, module use,
> implementations, unique modes and DCGs!  You should probably add the
> notion of `predicate' to that list as well.  In my first draft I've
> mentioned these with a few calming words to the effect that all will
> become clear in time.

Yes, I think that is the right approach.

One thing I have considered doing is extending the language to provide
special syntax for queries, as an alternative to defining main/2.
This would be reasonably easy to implement, reasonably easy to specify
semantics for, and it could make the language easier to teach.
Programmers might also find it quite convenient.

However, when I floated this idea past the other Mercury developers,
they weren't so keen...

Any comments on this idea?

> 5. How far is the tutorial expected to take people?

The further, the better.
But we could start off small and then gradually extend it.
Once we have a basic tutorial in place,
different people could work on different sections.

> This isn't going to work without feedback.  Are there people out there
> who can spare the odd ten minutes to look over what I've done and
> either recommend changes or improve it themselves? We'll need
> relative novices to say whether anything is getting through and
> experts to check that nothing too far from the truth is said.

I'd certainly be happy to give feedback.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the users mailing list