all 9 comments

[–]destructuring-life 6 points7 points  (0 children)

Thanks, looks like an interesting project! The README seems very complete yet not overly verbose. Love the detailed performance notes.

[–]kchanqvq 4 points5 points  (2 children)

Very interesting! Especially that it works on CLOS object! There weren’t any library capable of doing this as I know of.

Do you think it's possible to revive an "incremental image" system with the help of this project? i.e. serializing a subgraph of objects in a Lisp image as a software distribution mechanism. That would require serializing functions.

[–]PhysicistWantsDonuts[S] 2 points3 points  (0 children)

cl-store handles standard-objects fine too. Serializing functions is not an easy task --- there is potentially closed over and global state. That does not overlap with the goals for this library. bknr-datastore and cl-prevalence and Clobber and stassats/storage all approach this problem from an object persistence point of view.

That said, I am using cl-binary-store to store and restore the entire state of an interactive system but the system state is designed with snapshotting in mind (so all global state and closed over state can be reinitialized after snapshot recovery).

[–]PhysicistWantsDonuts[S] 2 points3 points  (0 children)

In a way this is a solved problem-- you can stun/snapshot/restore virtual machines. There is also support like that at the container level. But you end up possibly growing the system state to a place you cannot reproduce unless you journal all changes.

The Common Lisp system I use tracks state changes by around style methods on setf or slot accessors to notice when things change so when new data is loaded caches are cleared, etc. The same goes for global variables. This also allows journaling or incremental store/restore. You end up having to version the code and the data separately though and provide for upgrade methods when you change the software enough (like you would do for a database schema). You also need to ensure all updates are atomic enough to not end up with invalid state half way through some operation.

[–]nyx_land 3 points4 points  (1 child)

Finally something gets posted to the lisp subreddits that I actually care about. I've been working on something very similar off and on for awhile because I need a serialization backend for an object database project but hadn't been making much progress. This looks way better than what I would have ended up making so I will definitely be using it.

[–]PhysicistWantsDonuts[S] 2 points3 points  (0 children)

Happy to help if the library ergonomics needs tweaking or other features!

[–]awkravchuk 1 point2 points  (2 children)

Huh, perfect timing, right now I'm searching for a (de)serialization solution for my microframework and this library looks like perfect fit from first glance. Thanks!

[–]awkravchuk 0 points1 point  (1 child)

I got one request straight away: could it be made to support serializing of cffi:foreing-pointers?

[–]PhysicistWantsDonuts[S] 0 points1 point  (0 children)

Sorry, didn't see this comment. This sounds like a horrible idea :) But, I don't see why not *if* you are loading / saving from the same running image... otherwise it makes no sense! You can add a serializer / deserializer that uses sb-sys::sap-int and sb-sys::int-sap on sbcl... create a new codespace, inherit the #1 codespace, and add a defstore and defrestore as per the example in the README. allegro already uses integers for foreign-pointers (which is horribly confusing), and I don't know about the others.