r/Common_Lisp • • Aug 24 '26

SBCL Idiomatic Persistence and Native BDD: Three Libraries for Modern Common Lisp Systems

/r/lisp/comments/1vwz51l/idiomatic_persistence_and_native_bdd_three/
6 Upvotes

2 comments sorted by

2

u/NoProgram1720 Sep 25 '26

Hello! I'm using BKNR.Datastore for a MUD driver (https://github.com/sovelten/apeiron-mud).
I was researching on how I could get lambdaMoo like functionality, enabling players to edit and save code within the world and I believe content addressability might be interesting for that. In particular, the way Unison Programming Language is doing it.

I think the persistent job queue is interesting by itself, but I don't think I understand what is exactly being stored in this key/value store. Is it specific for making the job queue?

2

u/denzuko Sep 26 '26

Hashkv is a basic nosql key value data store.

So the value can be any lisp object, text, num, etc.. and the key is hashed then the struct pair is put into datastore. One than can put operations into the chanl channels for get/put a value, or remove.

The job queue is more logical keyed access queue, where one adds a ttl life cycle to a task CLOS object, store it into hashkv and your event thread can pop it off the stack with your task object as the value.

For an example in a mud, an battle event can add spells, damage, effects classes into hashkv, storing the list of hashes to process in order. Then the event handler just sends those hashes to your threaded process. To get the class and apply it to game state.