I did a reference implementation of unification code in pure scheme. It is just 185 lines of code (the rest is the test case)
see http://c-lambda.se/unify.scm Some timings for the example ============================ scheme-version > 2100 ms c-initial-guile > ~150 ms current-best-guile > 73 ms sbcl > 25 ms gprolog > ~20 ms So I've been able to tweak out 2x in guile + c So what next? This is what I will be playing with. one need apart from a unification primitive also be able to destruct a pattern into variable references this can be done in a vm on a stack machine. And I will now go on to let this vm be the guile vm itself. Later on when we the compiler starts to shine, I could hook into that as well and generate target code. So this litle play will spill over into being useful for the compiler later. /Stefan