[mercury-users] Mercury needs a Tutorial

Tyson Dowd trd at cs.mu.OZ.AU
Thu Feb 11 21:34:26 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.  The trouble with this approach is that it's probably too
> verbose for LP experts who want to learn Mercury.

I did some work on a tutorial a while ago.  It isn't easy, mainly
because it's easy to start talking about why rather than what.

I would assume a knowledge of a language such as C.

> 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?

This is a good idea for a tutorial. 

> 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?

Keep it plain to start with, those sorts of do-dahs are easy to add
later, but hard to maintain when the tutorial keeps changing.

> 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.  That said, Leon, scaling the learning cliff is
> well worth the effort!  My friends are sick of me evangelising about
> how cool Mercury is to program in.

Yes, this is what I found.  Perhaps it's best to leave some of the stuff
as magic that will be explained later.  For example "is det" is
meaningless until you need to write something that isn't det.  ":- pred"
is just syntax until you find out about functions.  Unique modes are
just syntax for a long time.

> 5. How far is the tutorial expected to take people?  Do we try to
> cover everything or merely enough to let people approach the reference
> manual with some confidence (as is obvious from this mailing list, the
> ref. manual has been carefully written, but it also requires careful
> interpretation)?

As far as it can.  There is quite a lot to cover, but I think you can
safely leave out typeclasses, nested modules, the foreign language
interface, that sort of thing.  Types, modes, modules, determinism,
predicates, functions, conjunction, disjunction and negation
are probably enough (I've probably forgotten something really important).

> 
> 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.

Yes, I'm happy to do that.

Thankyou for working on this.

-- 
The quantum sort: 
	while (!sorted) { do_nothing(); }
Tyson Dowd   <tyson at tyse.net>   http://tyse.net/



More information about the users mailing list