It might make sense to port the run-time for patterns to the [Warren Abstract machine]( https://en.wikipedia.org/wiki/Warren_Abstract_Machine) (WAM). References: * [WAM for everyone: a virtual machine for logic programming](https://dl.acm.org/doi/10.1145/3191315.3191320) * [Warren’s Abstract Machine: A Tutorial Reconstruction](https://adamo.wordpress.com/2009/07/06/warrens-abstract-machine-a-tutorial-reconstruction/)