{"id":28347407,"url":"https://github.com/aygp-dr/functional-data-structures","last_synced_at":"2026-01-27T02:33:16.635Z","repository":{"id":285338005,"uuid":"957777450","full_name":"aygp-dr/functional-data-structures","owner":"aygp-dr","description":"Purely functional data structures implemented in Scheme and Hy, based on Chris Okasaki's book","archived":false,"fork":false,"pushed_at":"2025-05-24T13:08:29.000Z","size":44,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-05T01:16:28.134Z","etag":null,"topics":["algorithms","okasaki","persistent-data-structures","scheme"],"latest_commit_sha":null,"homepage":null,"language":"Scheme","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aygp-dr.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-31T05:38:40.000Z","updated_at":"2025-08-05T00:57:56.000Z","dependencies_parsed_at":"2025-03-31T06:28:08.953Z","dependency_job_id":"1b35fdb1-7b21-4a0d-a572-7e5a19b0e2dd","html_url":"https://github.com/aygp-dr/functional-data-structures","commit_stats":null,"previous_names":["aygp-dr/functional-data-structures"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aygp-dr/functional-data-structures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Ffunctional-data-structures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Ffunctional-data-structures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Ffunctional-data-structures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Ffunctional-data-structures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aygp-dr","download_url":"https://codeload.github.com/aygp-dr/functional-data-structures/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Ffunctional-data-structures/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28796977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"online","status_checked_at":"2026-01-27T02:00:07.755Z","response_time":168,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["algorithms","okasaki","persistent-data-structures","scheme"],"created_at":"2025-05-27T16:41:06.383Z","updated_at":"2026-01-27T02:33:16.630Z","avatar_url":"https://github.com/aygp-dr.png","language":"Scheme","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: Functional Data Structures\n#+AUTHOR: Functional Data Structures Team\n#+OPTIONS: toc:3 num:t\n\n* Overview\n\nThis repository contains implementations of purely functional data structures based on Chris Okasaki's book \"Purely Functional Data Structures\" and his PhD thesis. The implementations are available in two Lisp dialects:\n\n- *Guile Scheme 3.0+*: A dialect of Scheme (a Lisp variant) that is part of the GNU project\n- *Hy 1.0+*: A Lisp dialect embedded in Python, now with semantic macros and Scheme-inspired design\n\nHy 1.0 introduces a significant evolution in its design with a cleaner, more consistent semantic model. This makes it particularly well-suited for implementing functional data structures alongside Scheme.\n\n* References\n\n- Okasaki, C. (1999). /Purely Functional Data Structures/. Cambridge University Press. \n  - [[https://www.goodreads.com/book/show/594288.Purely_Functional_Data_Structures][Goodreads Link]]\n- Okasaki, C. (1996). /Purely Functional Data Structures/ (PhD thesis). Carnegie Mellon University.\n  - [[https://www.cs.cmu.edu/~rwh/students/okasaki.pdf][PDF Link]]\n\nYou can download the PhD thesis paper by running: ~make get-paper~\n\n* Data Structures\n\nThe following data structures are implemented:\n\n- Persistent Lists\n- Stacks\n- Queues (using the two-list approach)\n- Binomial Heaps\n- Red-Black Trees\n- More to come...\n\n* Getting Started\n\n** Prerequisites\n\n- Guile 3.0+ for the Scheme implementation\n- Python 3.10+ with Hy 1.0+ for the Hy implementation\n- Poetry for Python dependency management\n- Emacs with org-mode for development\n\n** Installation\n\n#+begin_src shell\n# Clone the repository\ngit clone https://github.com/aygp-dr/functional-data-structures.git\ncd functional-data-structures\n\n# Setup Python environment with Hy\npoetry install\n#+end_src\n\n** Quick Start\n\n#+begin_src shell\n# Install dependencies\nmake install\n\n# Run all tests and verify everything works\nmake test-scheme  # Scheme tests (fully working)\n\n# Test individual implementations  \nmake run-scheme   # Load and test Scheme stack module\nmake run-hy       # Load and test Hy stack module\n\n# Show all available commands\nmake help\n#+end_src\n\n** Development Workflow\n\nThe project uses a literate programming approach with Org-mode, but also supports direct modular development:\n\n1. **Modular Development** (Recommended):\n   - Edit files directly in =scheme/okasaki/= and =hy/okasaki/= directories\n   - Run =make detangle= to sync changes back to the org file\n   - Use =make test-scheme= to run tests\n\n2. **Literate Programming**:\n   - Edit the =okasaki-data-structures.org= file \n   - Run =make tangle= to generate modular code files\n   - The tangled files are marked as generated\n\n3. **Testing**:\n   - =make test-scheme= - Run Scheme tests (✅ Working)\n   - =make test-hy= - Run Hy tests (⚠️ In progress - modules load correctly)\n\nThe project maintains both approaches to support different development preferences while ensuring the implementations stay in sync.\n\n* Project Status\n\n** ✅ Working Components\n- Scheme implementation with full test suite\n- Hy implementation with module loading\n- Build system with tangle/detangle workflow  \n- Proper module organization for both languages\n- Comprehensive Makefile with all common tasks\n\n** ⚠️ In Progress\n- Hy test infrastructure (modules work, pytest integration needs work)\n- Additional data structures beyond stacks\n\n* Structure\n\n- =okasaki-data-structures.org= - Main source file in Org-mode (literate programming)\n- =scheme/okasaki/= - Modular Scheme implementation files\n- =hy/okasaki/= - Modular Hy implementation files  \n- =tests/scheme/= - Scheme test files (working)\n- =tests/hy/= - Hy test files (in progress)\n- =Makefile= - Build system with comprehensive targets\n\n* Development with Emacs\n\nThis project is designed to be developed with Emacs using org-mode for literate programming. The included =.emacs.d/init.el= provides the necessary configuration for:\n\n- Org-mode with syntax highlighting\n- Babel for executing source blocks\n- Tangle support for extracting code\n- Geiser integration for Scheme development (using Guile by default)\n- Hy-mode for Hy development\n\n* Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n* License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faygp-dr%2Ffunctional-data-structures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faygp-dr%2Ffunctional-data-structures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faygp-dr%2Ffunctional-data-structures/lists"}