~theothornhill/cl-bare

bare messages in common lisp
39fe45f7 — Theodor Thornhill a month ago
Add some instructions awaiting real api

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~theothornhill/cl-bare
read/write
git@git.sr.ht:~theothornhill/cl-bare

You can also use your local clone with git send-email.

#cl-bare

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.

#todo

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

#bugs

yes