random-state.net

Nikodemus Siivola

<< next | top | previous >>

Rucksack Fandom #
hacking, May 13th 2006

Arthur Lemmens presented his work-in-progress persistence system (layer? framework? library?) Rucksack in ELCM 2006. Key features: portable Common Lisp, persistence of CLOS objects, indexes, transaction support, garbage collected (no DELETE-INSTANCE, no dangling object-ids), open source.

I've made an initial port of Rucksack (originally developed on Lispworks and ACL) to SBCL:

(defclass foo ()
  ((bar :initarg :bar :reader bar-of))
  (:metaclass persistent-class))

=> #<PERSISTENT-CLASS FOO>

(defmethod print-object ((foo foo) stream)
  (print-unreadable-object (foo stream :type t)
    (princ (bar-of foo) stream)))

=> #<STANDARD-METHOD PRINT-OBJECT (FOO T) {ADC0519}>

(with-rucksack (r "/tmp/foosack/") 
  (with-transaction ()
    (dotimes (i 5)
      (add-rucksack-root (make-instance 'foo :bar i) r))))

=> T

(with-rucksack (r "/tmp/foosack/")
  (with-transaction ()
    (print (rucksack-roots r))))

=| (#<FOO 0> #<FOO 1> #<FOO 2> #<FOO 3> #<FOO 4>)

Not the most impressive of demos yet, but enough to show that the bare bones are in working order.

Rucksack is under 1-clause MIT licence, currently available from Arthur Lemmens on request — and as said it is still work-in-progress, not ready for actual use yet.

Cool stuff: much kudos to Arthur!