{"id":13760548,"url":"https://github.com/ndantam/sycamore","last_synced_at":"2026-03-05T17:54:54.083Z","repository":{"id":4067138,"uuid":"5171333","full_name":"ndantam/sycamore","owner":"ndantam","description":"A fast, purely functional data structure library in Common Lisp.","archived":false,"fork":false,"pushed_at":"2025-11-19T21:20:22.000Z","size":311,"stargazers_count":128,"open_issues_count":1,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-11-19T23:17:57.314Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ndantam.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2012-07-24T21:11:44.000Z","updated_at":"2025-11-19T21:20:26.000Z","dependencies_parsed_at":"2025-08-02T19:14:38.185Z","dependency_job_id":"6c7540f7-a3c4-4dd9-b5b9-60e423f7cf4b","html_url":"https://github.com/ndantam/sycamore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ndantam/sycamore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndantam%2Fsycamore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndantam%2Fsycamore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndantam%2Fsycamore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndantam%2Fsycamore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ndantam","download_url":"https://codeload.github.com/ndantam/sycamore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndantam%2Fsycamore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30140874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T16:58:46.102Z","status":"ssl_error","status_checked_at":"2026-03-05T16:58:45.706Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T13:01:12.660Z","updated_at":"2026-03-05T17:54:54.052Z","avatar_url":"https://github.com/ndantam.png","language":"Common Lisp","readme":"SYCAMORE\n========\n\nA fast, purely functional data structure library in Common Lisp.\n\nAPI Documentation: http://ndantam.github.io/sycamore\n\nFeatures\n========\n* Fast, purely functional weight-balanced binary trees.\n  - http://en.wikipedia.org/wiki/Weight-balanced_tree\n  - Leaf nodes are simple-vectors, greatly reducing tree height.\n* Interfaces for tree Sets and Maps (dictionaries).\n* Ropes\n  - http://en.wikipedia.org/wiki/Rope_(data_structure)\n* Purely functional pairing heaps\n  - http://en.wikipedia.org/wiki/Pairing_heap\n* Purely functional amortized queue\n\nInstallation\n============\n\n* Sycamore uses ASDF (https://common-lisp.net/project/asdf/)\n* See `INSTALL` file for details\n\nExamples\n========\n\nSee also `./example.lisp`\n\nSets\n----\n\nDefine an ordering function:\n\n    CL-USER\u003e (defun compare (a b)\n               (cond ((\u003c a b) -1)\n                     ((\u003e a b) 1)\n                     (t 0)))\n\n    COMPARE\n\nCreate a set for integers:\n\n    CL-USER\u003e (sycamore:tree-set #'compare 1 2 -10 40)\n\n    #\u003cTREE-SET (-10 1 2 40)\u003e\n\nInsertion:\n\n    CL-USER\u003e (sycamore:tree-set-insert (sycamore:tree-set #'compare 1 2)\n                                       0)\n    #\u003cTREE-SET (0 1 2)\u003e\n\nRemoval:\n\n    CL-USER\u003e (sycamore:tree-set-remove (sycamore:tree-set #'compare 1 2 0)\n                                       0)\n    #\u003cTREE-SET (1 2)\u003e\n\nUnion operation:\n\n    CL-USER\u003e (sycamore:tree-set-union (sycamore:tree-set #'compare 1 2)\n                                      (sycamore:tree-set #'compare 1 0 3))\n\n    #\u003cTREE-SET (0 1 2 3)\u003e\n\nIntersection operation:\n\n    CL-USER\u003e (sycamore:tree-set-intersection (sycamore:tree-set #'compare 1 2)\n                                             (sycamore:tree-set #'compare 1 0 3))\n\n    #\u003cTREE-SET (1)\u003e\n\nDifference operation:\n\n    CL-USER\u003e (sycamore:tree-set-difference (sycamore:tree-set #'compare 1 2)\n                                           (sycamore:tree-set #'compare 1 0 3))\n\n    #\u003cTREE-SET (2)\u003e\n\nMap set:\n\n    CL-USER\u003e (sycamore:map-tree-set 'list #'1+\n                                    (sycamore:tree-set #'compare 1 0 10 2))\n\n    (1 2 3 11)\n\nFold set:\n\n    CL-USER\u003e (sycamore:fold-tree-set (lambda (list item) (cons item list))\n                                     nil\n                                     (sycamore:tree-set #'compare 1 0 10 2))\n\n    (10 2 1 0)\n\nRopes\n-----\n\nCreate a Rope:\n\n    CL-USER\u003e (sycamore:rope \"Hello\" #\\Space 'World!)\n\n    #\u003cROPE \"Hello WORLD!\"\u003e\n\nAlso works on lists:\n\n    CL-USER\u003e (sycamore:rope (list \"Hello\" #\\Space 'World!))\n\n    #\u003cROPE \"Hello WORLD!\"\u003e\n\nAnd arrays:\n\n    CL-USER\u003e (sycamore:rope (vector \"Hello\" #\\Space 'World!))\n\n    #\u003cROPE \"Hello WORLD!\"\u003e\n\nRope to string:\n\n    CL-USER\u003e (sycamore:rope-string (sycamore:rope \"Hello\" #\\Space 'World!))\n\n    \"Hello WORLD!\"\n\nPrint a rope:\n\n    CL-USER\u003e (sycamore:rope-write (sycamore:rope \"Hello\" #\\Space 'World!)\n                                  :escape nil :stream *standard-output*)\n\n    Hello WORLD!\n\nAlternatives\n============\n\nThere are many other Common Lisp data structure libraries.  Here are a\nfew alternatives and their trade-offs relative to Sycamore.\n\nFSet\n----\nhttps://common-lisp.net/project/fset/Site/FSet-CL.html\n\nFSet implements finite sets with a CLOS-based set interface, while\nSycamore's finite sets take a parameter for a comparison function.\nBoth used weight-balanced trees with minor algorithmic differences.\nGeneric vs. explicit comparison functions is both an aesthetic and\nperformance issue.  FSet's generic comparison functions do not need to\nbe passed explicitly, while Sycamore's explicit comparison function\nparameter makes it easier to compare the same type differently if\nneeded, e.g., lexicographic vs. fast string comparison.\n\nIncluded benchmarks show that Sycamore is 30-50% faster than FSet.\n\nCL-Containers\n-------------\nhttps://github.com/gwkkwg/cl-containers\n\nCL-Containers is stateful/mutable/imperative, while Sycamore is\npurely-functional/persistent.\n\nLisp Interface Library (LIL)\n----------------------------\nhttps://github.com/fare/lisp-interface-library\n\nLisp Interface Library (LIL) provides abstracted data structures using\nInterface Passing Style, while Sycamore provides a few concrete data\nstructures. LIL's Interface Passing Style presumably improves\nflexibility at the cost of runtime overhead and API complexity.\nSycamore's explicit data structures have low-overhead, optimized\nimplementations and a simple, documented API.\n\n\nReferences\n==========\n\n* Okasaki, Chris. \"Purely Functional Data Structures.\" Cambridge\n  University Press. June 1999. ISBN: 978-0521663502.\n\n* Boehm, H.J., Atkinson, R. and Plass, M., 1995. Ropes: an alternative\n  to strings. Software: Practice and Experience, 25(12), pp.1315-1330.\n\n* Adams, Stephen., 1992. Implementing sets efficiently in a functional\n  language. University of Southampton. Tech Report CSTR 92-10.\n\n\nName\n====\nhttp://en.wikipedia.org/wiki/Platanus_occidentalis\n","funding_links":[],"categories":["Common Lisp","Expert Systems"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndantam%2Fsycamore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fndantam%2Fsycamore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndantam%2Fsycamore/lists"}