Hi.

I'm currently writing a small functional language, and I've got a rather
general question about implementing type checking or type inference in
an incremental fashion.

I'm currently using dypgen for generating the parser, one important
reason being the ability to abort a reduction by raising the Dyp.Giveup
exception. For various reasons, I want to be able to do some
type checking or type inference during the parse phase in order to abort
the reduction of a parsing rule if typing gets inconsistent.

My problem is therefore to have a maintainable way to implement a type
inference algorithm that operates on incomplete type information (as
useful information for type inference may be located in a yet unparsed
portion of the code to be compiled). I'm currently using Mercury to do
that, and it sorts of works, but I've got the feeling that I'm slowly
heading to a maintenance nightmare.

I'm therefore wondering if anyone has tried to implement such a thing
before, and if not, if people with some experience in the implementation
of type inference algos have some advice on that matter. Such as the
choice of datastructures or specific caveats specific to such an
incremental algorithm.

Best regards,

-- 
     Guillaume Yziquel

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to