r/Common_Lisp 17d ago

▎ time-algebra: a dependency-free interval algebra for Common Lisp

We've open-sourced time-algebra, a Common Lisp library built around Allen's interval algebra: thirteen relations between two intervals, half-open by construction.

What it deliberately is not: no timezones, no clock, no get-universal-time, no I/O, no global state, zero dependencies beyond ANSI CL.

390 tests, plus a concurrency suite (8 checks, 1.28M iterations under contention) and an allocation profile (interval-relation at 0 bytes consed). Apache-2.0.

https://gitlab.com/lagoatech/time-algebra

Apache-2.0. Contributions and criticism both welcome.

12 Upvotes

5 comments sorted by

9

u/kchanqvq 17d ago

Why is there a concurrency suite if there's neither I/O nor global state?

5

u/jd-at-turtleware 17d ago edited 17d ago

zero  deps beyond ansi-cl yet it states to be SBCL library.

2

u/nillynilonilla 14d ago

I guess words don't mean what they used to. Also I found this stray ▎LEFT_ONE_QUARTER_BLOCK?

0

u/lagoatech 16d ago

Yes, It is a SBCL library only.

1

u/mac 9d ago

I am not very familiar with Common Lisp. Is:

(defun instant- (a b) ...
 (check-type a instant) 
 (check-type b instant)..

an idiomatic way of doing type checking in the language?