[mercury-users] Mercury in academic teaching?

Kathryn Francis francis at students.csse.unimelb.edu.au
Sat Oct 7 14:37:29 AEST 2006



On Sat, 7 Oct 2006, Jonathan Morgan wrote:

> On 06/10/06, Jörg Roman Rudnick <joerg.rudnick at t-online.de> wrote:
> > Is Mercury an option as introduction to logic programming?
> >
> > Personally very convinced, I am unsure about possible problems in
> > teaching it as second (or third) language besides Java (and C#) to
> > students of AI (at a course of study like 'master of business computing').
> >
>
> As a student who is just studying Prolog, I do not believe that
> Mercury is likely to be a good introductory logic programming language
> for several reasons.  The main one is very simple - Mercury was not
> designed for simplicity, but rather for performance and large-scale
> Software Engineering.  In my opinion, this makes it a great language
> for using to write real programs, but not for education, as even small
> programs require understanding of Mercury's module system, type and
> mode system (unless you use inference), and the I/O state.  On the
> contrary, most Prologs do not require types, and have interpreters,
> allowing them to be used in an exploratory manner quickly and easily -
> which I feel is much better for education as an introduction to logic
> programming.

I'm a lab demonstrator for the subject 'Logic and Computation', which is
the subject that teaches Prolog in our department, and I find that one of
the main things that confuses people learning Prolog is the absence of
types. I get questions like "How does Prolog know that this is supposed to
be a tree?" all the time.

It seems to me that you need to think about types and modes to write
correct programs in prolog, and it's actually helpful for a novice to
write them down explicitly, which is what Mercury forces you to do. Also
having more static checking can be useful for novices because you get
handy hints from the compiler in cases where the corresponding Prolog
program would just fail or give a runtime error.

That said, I think the decision to teach Mercury or Prolog really depends
on exactly what you're wanting to get across. If you just want to teach
logic programming concepts, then maybe Mercury is the way to go, but if
you want to also introduce students to an interpreted style language
geared towards fast development, or you want to introduce a weakly typed
language to contrast with Java, then clearly Prolog is better.

Kathryn

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