[mercury-users] Mercury in academic teaching?

Jonathan Morgan jonmmorgan at gmail.com
Mon Oct 9 13:53:52 AEST 2006


On 08/10/06, Jörg Roman Rudnick <joerg.rudnick at t-online.de> wrote:
> Jonathan Morgan schrieb:
> > On 07/10/06, Kathryn Francis <francis at students.csse.unimelb.edu.au>
> > wrote:
> > I am unaware of any courses teaching Mercury as an introduction to
> > logic programming, so I would be interested in seeing how it worked.
> > My feeling is that it would work a lot better with students who have
> > already studied a strongly typed functional language, as far less time
> > would have to be spent explaining the type system.  Mercury would also
> > have the strong advantage that the lecturer wouldn't have to point out
> > all the problems with the non-logical features of Prolog, as seems to
> > happen frequently in our lectures.
> >
> Does this mean that there has never been such a course before?
>
> @Kathryn: At Melbourne university, has there ever been any thought or
> even trial to teach Mercury that way? This is a very exciting question
> to me.

At Melbourne it is only taught as part of a fourth-year honours
subject, along with Prolog.  The standard second-year subject, which I
am currently taking, focuses on Prolog and general logic.  As to
whether this will change, I have no knowledge, but I can't see it
changing in the near future.

> @ Jon: If you say with Philip Wadler Java is a 'functional language' -
> then our students certainly have studied one... ;-) (Ok, Java is a
> little more bureaucratic...)

I don't say that - at least not in the way it is generally taught.
Possibly it can be used like one, but it is not standard practise to
do so.

> Of course, a typeless language is a rather unfamiliar thing to our
> students (unless they do web scripting), as they come from Java (and
> C#). To my personal impression, the compiler is really quite verbose,
> and -- again -- programming in interpreted mode is not familiar to our
> students.

Hugs was the first interpreter I ever used - I didn't find it that
hard to adapt to (on the other hand, almost consistently avoiding
using I/O when teaching left me with the impression that Haskell was
only used for toy problems - we were never taught to build real
programs, just "write this function").

> Ralph Beckett recently gave me notice that type class are quite
> 'complete' now (what I could partially verify), what appears to me as a
> great progress for integrating the architectural concepts so popular in
> OO like design patterns - what I want to say is Mercury can be
> programmed in a whole lot of styles logic, functional, OO with only
> having to learn ONE programming environment.

I dislike the idea of teaching OO concepts from Mercury, as they
merely contain interface design and related concepts.  Students going
out to work in industry will need to understand both interface and
implementation inheritance, and will be expected to understand it in a
fairly standard syntax.  However, if you are interested in such a
thing, David Jeffrey's Ph.D. contains a very interesting chapter on
object-oriented programming in Mercury (available at
http://www.cs.mu.oz.au/research/mercury/information/papers/dgj-thesis-final.ps.gz)n

> Putting in question 'di' and 'uo' irritates me deeply: Aren't they the
> very heart of Mercury (see 'Strong modes can change the world'...)? This
> is the same as putting in question 'private' in OO, isnt't it? Lately, I
> began to deal with the extended modes and finding no real doc, I did it
> by guessing - it was kinda fun to see it is possible to work with )o+>
> this way... What I mean is, if you like, you can go programming with
> very low discipline (even without a sophisticated IDE), what is good for
> starting projects and mediocre motivated students...

I enjoy experimenting with such things.  I suspect that most students
will not.  As it currently stands, I would not consider that di, uo
modes are very important apart from ensuring the purity of I/O and
similar constructs - it allows the compiler to enforce quite a few
useful things, but doesn't have any real meaning (as the I/O state
does not really exist).  However, I believe that they do not work
properly for "real" data structures (see, for example, the comments at
the head of array).

I prefer working without a sophisticated IDE.  I have not yet found
one that was sophisticated enough to do what I wanted, when I wanted
it done (though some have come close).  I know of no IDE that comes
close to vim in its power of raw text-editing (unless you wish to call
emacs an IDE, as has been done).

Jon

--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list