bones.asd @ ba96e98a1d54

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 8a247663fec5
children 8897604cb9dd
(asdf:defsystem #:bones
  :name "bones"
  :description "A logic programming library for Common Lisp."

  :author "Steve Losh <steve@stevelosh.com>"
  :maintainer "Steve Losh <steve@stevelosh.com>"

  :license "MIT/X11"
  :version "0.0.1"

  :depends-on (#:trivial-types
               #:cl-arrows
               #:policy-cond)

  :serial t
  :components ((:file "src/quickutils") ; quickutils package ordering crap
               (:file "package")
               (:module "src"
                :serial t
                :components
                ((:file "paip")
                 (:file "utils")
                 (:file "circle")
                 (:module "wam"
                  :serial t
                  :components ((:file "constants")
                               (:file "types")
                               (:file "bytecode")
                               (:file "wam")
                               (:module "compiler"
                                :serial t
                                :components ((:file "0-data")
                                             (:file "1-parsing")
                                             (:file "2-register-allocation")
                                             (:file "3-flattening")
                                             (:file "4-tokenization")
                                             (:file "5-precompilation")
                                             (:file "6-optimization")
                                             (:file "7-rendering")
                                             (:file "8-ui")))
                               (:file "vm")
                               (:file "dump")
                               (:file "ui")))
                 (:file "bones")))))