Add precompilation of static queries at compile time
Imagine a function like this:
(defun legal-moves ()
(query (legal ?who ?move)))
The argument to `query` there is constant, so we can compile it into WAM
bytecode once, when the Lisp function around it is compiled. Then running the
query doesn't need to touch the Bones compiler -- it can just load the bytecode
from an array and first up the VM loop.
This saves a lot of time (and consing) compared to compiling the same query over
and over at runtime.
author |
Steve Losh <steve@stevelosh.com> |
date |
Sun, 17 Jul 2016 16:49:06 +0000 |
parents |
e555488c15e6 |
children |
837374f5256d |
(2 code-push-instruction!)
(1 repeat)
(2 define-instruction define-instructions)
(1 with-database)
(1 recursively)
(1 when-let)
(1 rule)
(0 push-logic-frame-with)
(1 cell-typecase)
(1 opcode-case)
(2 define-invocation)