Compiler construction: type checking ./ optimization passes in Prolog

I am aware of:

I am also aware of similarities between type inference <-> unification <-> logic programming.

'I am wondering if anyone has good recommended reading resources on building a type checker / compiler in prolog / logic languages. We can assume parsing is already done, i.e. we have an abstract syntax tree, and the remaining problems are:
(1) do type checking
(2) optimizations / code emit

I don't think your question is rust related, but this is somewhat covered in chapter 24 of The Art of Prolog

1 Like

There's a crate for constraint-based typechecking on lattices, called RustTyC. You might be interested in reading its source.

1 Like