fern
An efficient, consp, self-adjusting key-value trie-index abstraction for uuid namespaces.

Repository: https://github.com/danlentz/fern

Quick assessment (2023-04-24)

FERN> (get-trie (coerce "bagel" 'list) *trie*) 0E080B8B-E2CB-11ED-A5F7-11D683142201 T

This is the UUID assigned to bagel. The root of the trie looks like this:

FERN> *trie* (+NO-VALUE+ (+START+ +NO-VALUE+ . #<hash-table b8f0aa0>))

Then grab the highest-level hash table:

FERN> (cddadr *trie*) #<hash-table b8f0aa0>

And we get the sub-trie rooted at Z:

FERN> (gethash #\Z *) (+NO-VALUE+ (#\a +NO-VALUE+ (#\g +NO-VALUE+ +STASH+ (#\r #\e #\b) 0BA5B4F5-E2CB-11ED-A5F7-11D683142201) (#\i +NO-VALUE+ +STASH+ (#\r #\e) 0BA5B4F6-E2CB-11ED-A5F7-11D683142201) (#\n +NO-VALUE+ (+END+ 0BA5B4F8-E2CB-11ED-A5F7-11D683142201) (#\z +NO-VALUE+ +STASH+ (#\i #\b #\a #\r) 0BA5B4F9-E2CB-11ED-A5F7-11D683142201)) (#\m +NO-VALUE+ +STASH+ (#\b #\i #\a) 0BA5B4F7-E2CB-11ED-A5F7-11D683142201) (#\c +NO-VALUE+ +STASH+ (#\h #\a #\r #\y) 0BA5B4F4-E2CB-11ED-A5F7-11D683142201)) (#\u +NO-VALUE+ (#\r +NO-VALUE+ +STASH+ (#\i #\c #\h) 0C3E4791-E2CB-11ED-A5F7-11D683142201) (#\l +NO-VALUE+ (#\u +NO-VALUE+ (+END+ 0C3E478F-E2CB-11ED-A5F7-11D683142201) (#\s +NO-VALUE+ (+END+ 0C3E4790-E2CB-11ED-A5F7-11D683142201))))) (#\o +NO-VALUE+ (#\m +NO-VALUE+ +STASH+ (#\b #\a) 0C3E478B-E2CB-11ED-A5F7-11D683142201) (#\e +NO-VALUE+ (+END+ 0C3E478A-E2CB-11ED-A5F7-11D683142201)) (#\r +NO-VALUE+ (#\n +NO-VALUE+ (+END+ 0C3E478C-E2CB-11ED-A5F7-11D683142201)) (#\o +NO-VALUE+ (#\a +NO-VALUE+ (#\s +NO-VALUE+ (#\t +NO-VALUE+ (#\r +NO-VALUE+ +STASH+ (#\i #\a #\n) 0C3E478E-E2CB-11ED-A5F7-11D683142201) (#\e +NO-VALUE+ +STASH+ (#\r) 0C3E478D-E2CB-11ED-A5F7-11D683142201))))))) (#\i +NO-VALUE+ (#\g +NO-VALUE+ +STASH+ (#\g #\y) 0C3E4783-E2CB-11ED-A5F7-11D683142201) (#\m +NO-VALUE+ +STASH+ (#\m #\e #\r #\m #\a #\n) 0C3E4784-E2CB-11ED-A5F7-11D683142201) (#\o +NO-VALUE+ (#\n +NO-VALUE+ (#\s +NO-VALUE+ (+END+ 0C3E4789-E2CB-11ED-A5F7-11D683142201)) (+END+ 0C3E4785-E2CB-11ED-A5F7-11D683142201) (#\i +NO-VALUE+ (#\s +NO-VALUE+ (#\t +NO-VALUE+ (+END+ 0C3E4787-E2CB-11ED-A5F7-11D683142201) (#\s +NO-VALUE+ (+END+ 0C3E4788-E2CB-11ED-A5F7-11D683142201))) (#\m +NO-VALUE+ (+END+ 0C3E4786-E2CB-11ED-A5F7-11D683142201)))))) (#\e +NO-VALUE+ (#\g +NO-VALUE+ (#\f +NO-VALUE+ (#\e +NO-VALUE+ (#\l +NO-VALUE+ (#\d +NO-VALUE+ (+END+ 0C3E4780-E2CB-11ED-A5F7-11D683142201) (#\s +NO-VALUE+ (+END+ 0C3E4781-E2CB-11ED-A5F7-11D683142201)))))) (#\l +NO-VALUE+ +STASH+ (#\e #\r) 0C3E4782-E2CB-11ED-A5F7-11D683142201)))) (#\e +NO-VALUE+ (#\l +NO-VALUE+ +STASH+ (#\l #\e #\r #\b #\a #\c #\h) 0BA5B4FD-E2CB-11ED-A5F7-11D683142201) (#\i +NO-VALUE+ +STASH+ (#\s #\s) 0BA5B4FC-E2CB-11ED-A5F7-11D683142201) (#\f +NO-VALUE+ +STASH+ (#\f #\i #\r #\e #\l #\l #\i) 0BA5B4FB-E2CB-11ED-A5F7-11D683142201) (#\n +NO-VALUE+ (#\n +NO-VALUE+ +STASH+ (#\i #\s #\t) 0BA5B4FF-E2CB-11ED-A5F7-11D683142201) (+END+ 0BA5B4FE-E2CB-11ED-A5F7-11D683142201)) (#\u +NO-VALUE+ +STASH+ (#\s) 0BA5B500-E2CB-11ED-A5F7-11D683142201) (#\a +NO-VALUE+ +STASH+ (#\l #\a #\n #\d) 0BA5B4FA-E2CB-11ED-A5F7-11D683142201))) T

The only problem here is that the UUIDs do not want to *print-readably*.


data structure