bare messages in common lisp

a92911f Add badge

14 days ago

39fe45f Add some instructions awaiting real api

14 days ago


builds.sr.ht status

A library to encode and decode bare messages, as described in baremessages.org

#How it works (right now)

Until I've implemented a proper API for this, I'll just explain a little about lisp-binary, which cl-bare heavily relies on. lisp-binary defines a small DSL, defbinary which sort-of works like the defstruct in common lisp.

For each binary type we define we get these functions (assume type is uint):

  • copy-uint
  • make-uint
  • uint
  • uint-p
  • uint-value

Using these we can compose different aggregated types based on a (to come) schema.

;; Assume we have two types, 'uint' and 'u8'
(let ((x (make-uint :value 31231))
      (y (make-u8 :value 2)))
  (print (uint-value x))
  (print (u8-value y)))

If read from stream we can chain them together, and read and write.


  • real API
  • tagged union
  • structs
  • schema
  • max size handling