Interactive queries (was: Mercury needs a Tutorial)

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Feb 16 17:41:28 AEDT 1999


On 16-Feb-1999, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> 
> This is about what I was thinking of if no one wants to get read/3 to
> work for preds.
...
> But it really *would* be a lot easier if you could just type code and
> clauses into a Mercury top level and see what happens.

Getting read/3 to somehow work for preds would be quite complex --
certainly a non-trivial amount of work.  Consider that to do it
properly, you would need to check queries for mode-correctness and
determinism-correctness.  In the end, you would need to put a
substantial amount of the compiler into the standard library to make
that work.

An alternative that would be much simpler to implement would be to
invoke the compiler dynamically, using the new dynamic linking support
(see extras/dynamic_linking in our latest development versions)
to link the compiled query into the program to execute it.
This would probably be a little slow, but still an order of magnitude
more interactive than the current system.

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