{"id":29718262,"url":"https://github.com/aygp-dr/fixed-point-explorer","last_synced_at":"2026-02-07T04:32:29.625Z","repository":{"id":305713633,"uuid":"1023653775","full_name":"aygp-dr/fixed-point-explorer","owner":"aygp-dr","description":"Y combinator and fixed-point recursion exploration across Scheme dialects with formal verification","archived":false,"fork":false,"pushed_at":"2025-07-23T20:38:46.000Z","size":332,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-31T00:40:22.341Z","etag":null,"topics":["functional-programming","recursion","scheme","y-combinator"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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,"zenodo":null}},"created_at":"2025-07-21T13:40:33.000Z","updated_at":"2025-08-02T20:48:02.000Z","dependencies_parsed_at":"2025-07-21T17:44:53.934Z","dependency_job_id":"2eb04acf-fff6-4220-ab71-f2b170be46a7","html_url":"https://github.com/aygp-dr/fixed-point-explorer","commit_stats":null,"previous_names":["aygp-dr/fixed-point-explorer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aygp-dr/fixed-point-explorer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Ffixed-point-explorer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Ffixed-point-explorer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Ffixed-point-explorer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Ffixed-point-explorer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aygp-dr","download_url":"https://codeload.github.com/aygp-dr/fixed-point-explorer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Ffixed-point-explorer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29186737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T03:35:06.566Z","status":"ssl_error","status_checked_at":"2026-02-07T03:34:57.604Z","response_time":63,"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":["functional-programming","recursion","scheme","y-combinator"],"created_at":"2025-07-24T09:40:30.225Z","updated_at":"2026-02-07T04:32:29.620Z","avatar_url":"https://github.com/aygp-dr.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: Fixed Point Explorer\n#+AUTHOR: jwalsh\n\n[[https://img.shields.io/badge/Guile-3.0+-blue.svg][https://img.shields.io/badge/Guile-3.0+-blue.svg]]\n[[https://img.shields.io/badge/Chez_Scheme-9.5+-green.svg][https://img.shields.io/badge/Chez_Scheme-9.5+-green.svg]]\n[[https://img.shields.io/badge/Racket-8.0+-red.svg][https://img.shields.io/badge/Racket-8.0+-red.svg]]\n[[https://img.shields.io/badge/License-MIT-yellow.svg][https://img.shields.io/badge/License-MIT-yellow.svg]]\n[[https://img.shields.io/badge/Lean-4.21.0-blue.svg][https://img.shields.io/badge/Lean-4.21.0-blue.svg]]\n[[https://img.shields.io/badge/Lake-5.0.0-green.svg][https://img.shields.io/badge/Lake-5.0.0-green.svg]]\n[[https://img.shields.io/badge/Platform-FreeBSD_|_Linux_|_macOS-lightgrey.svg][https://img.shields.io/badge/Platform-FreeBSD_|_Linux_|_macOS-lightgrey.svg]]\n\n* Overview\n\nFixed Point Explorer is a multi-implementation exploration of the Y combinator and fixed-point recursion patterns in Scheme. The project demonstrates how recursive functions can be built without explicit self-reference, using the Y combinator as a foundation.\n\n[[file:docs/images/tshirt-design.png]]\n\n* Features\n\n- ✨ Portable Y combinator implementation working across multiple Scheme dialects\n- 🎯 Pure functional implementations of classic recursive algorithms\n- 🔧 Support for GNU Guile, Chez Scheme, and Racket\n- 📊 Performance benchmarks and comparisons\n- 🧪 Comprehensive test suite with edge case coverage\n- 📚 Literate programming approach with Org-mode\n- 🔍 Formal verification capabilities (Lean 4 support)\n\n* Quick Start\n\n** Prerequisites\n\nCheck that you have the required dependencies:\n\n#+BEGIN_SRC bash\ngmake deps\n#+END_SRC\n\n** Running Tests\n\n#+BEGIN_SRC bash\n# Run all tests\ngmake test\n\n# Run tests for specific implementation\ngmake test-guile    # Primary implementation\ngmake test-chez\ngmake test-racket\n#+END_SRC\n\n** Interactive REPL\n\n#+BEGIN_SRC bash\n# Start Guile REPL with project loaded\ngmake repl-guile\n\n# In the REPL, try:\n(load \"src/portable/fibonacci.scm\")\n(fib 10)  ;; =\u003e 55\n(test-fibonacci)\n#+END_SRC\n\n* Project Structure\n\n#+BEGIN_EXAMPLE\nfixed-point-explorer/\n├── src/\n│   ├── portable/         # Cross-implementation code\n│   │   ├── y-combinator.scm\n│   │   ├── fibonacci.scm\n│   │   └── list-ops.scm\n│   ├── guile/           # Guile-specific extensions\n│   ├── chez/            # Chez-specific optimizations\n│   └── racket/          # Racket-specific typed versions\n├── test/\n│   ├── test-framework.scm\n│   └── integration/     # Cross-implementation tests\n├── scripts/\n│   ├── deps.sh          # Dependency checking\n│   └── setup.sh         # Tool installation\n├── lib/geiser/          # Emacs integration\n├── docs/                # Documentation\n└── Makefile             # Build automation\n#+END_EXAMPLE\n\n* Examples\n\n** Basic Y Combinator Usage\n\n#+BEGIN_SRC scheme\n;; Load the Y combinator\n(load \"src/portable/y-combinator.scm\")\n\n;; Define a recursive function using Y combinator\n(define CONTINUE-fact\n  (lambda (f)\n    (lambda (n)\n      (if (= n 0) \n          1 \n          (* n (f (- n 1)))))))\n\n(define factorial (Y-explicit CONTINUE-fact))\n(factorial 5)  ;; =\u003e 120\n#+END_SRC\n\n** Fibonacci with Memoization\n\n#+BEGIN_SRC scheme\n(load \"src/portable/fibonacci.scm\")\n\n;; Basic fibonacci\n(fib 20)  ;; =\u003e 6765\n\n;; Memoized version for better performance\n(define memo-fib (make-memoized-fib))\n(memo-fib 100)  ;; Computes quickly\n#+END_SRC\n\n** List Operations\n\n#+BEGIN_SRC scheme\n(load \"src/portable/list-ops.scm\")\n\n;; All list operations implemented using Y combinator\n(append-y '(1 2 3) '(4 5 6))         ;; =\u003e (1 2 3 4 5 6)\n(map-y (lambda (x) (* x 2)) '(1 2 3)) ;; =\u003e (2 4 6)\n(filter-y even? '(1 2 3 4 5 6))      ;; =\u003e (2 4 6)\n(foldr-y + 0 '(1 2 3 4 5))           ;; =\u003e 15\n#+END_SRC\n\n* Theoretical Background\n\nThe Y combinator, discovered by Haskell Curry, enables recursion in languages that don't have built-in recursion. Its type signature is:\n\n#+BEGIN_EXAMPLE\nY : ∀α. ((α → α) → (α → α)) → (α → α)\n#+END_EXAMPLE\n\nThis project explores practical applications of this theoretical construct across different Scheme implementations.\n\n* Implementation Details\n\n** Guile (Primary Implementation)\n\nGNU Guile 3.0+ is the primary development platform. All portable code is tested first on Guile.\n\n- Uses ~string-contains~ for implementation detection\n- Supports performance timing with ~(ice-9 time)~\n- Compatible with Geiser for interactive development\n\n** Cross-Implementation Compatibility\n\nThe portable code avoids implementation-specific features:\n- No ~format~ in core modules (for maximum compatibility)\n- Simple list-based memoization instead of hash tables\n- Explicit module loading with ~load~ instead of module systems\n\n* Performance\n\nRun benchmarks with:\n\n#+BEGIN_SRC bash\ngmake benchmark\n#+END_SRC\n\nExample output (times vary by system):\n- Guile: ~fib(30)~ in ~0.8s\n- Chez: ~fib(30)~ in ~0.3s\n- Racket: ~fib(30)~ in ~1.2s\n\n* Development\n\n** Building from Source\n\n1. Clone the repository\n2. Tangle the literate source (if using ~SETUP.org~):\n   #+BEGIN_SRC bash\n   # In Emacs: C-c C-v t on SETUP.org\n   #+END_SRC\n3. Run tests:\n   #+BEGIN_SRC bash\n   gmake test\n   #+END_SRC\n\n** Contributing\n\n1. Ensure all tests pass: ~gmake test~\n2. Follow the existing code style\n3. Add tests for new functionality\n4. Update documentation as needed\n\n* Formal Verification (Optional)\n\nFor formal verification with Lean 4:\n\n#+BEGIN_SRC bash\n# Install Lean 4 (FreeBSD with Linux compatibility)\ngmake setup\n\n# Or manual installation\ngmake -f Makefile.lean lean-install\n#+END_SRC\n\n* License\n\nThis project is licensed under the MIT License. See [[file:LICENSE][LICENSE]] for details.\n\n* Acknowledgments\n\n- Y combinator theory from Haskell Curry's work on combinatory logic\n- Inspired by \"The Little Schemer\" and SICP\n- Scheme community for maintaining excellent implementations\n\n* Resources\n\n- [[https://en.wikipedia.org/wiki/Fixed-point_combinator][Fixed-point combinator (Wikipedia)]]\n- [[file:SETUP.org][SETUP.org]] - Literate programming source\n- [[file:docs/specs/types.org][Type Specifications]] - Formal type documentation\n\n---\n\n[[file:docs/images/repo-barcode.png]]","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faygp-dr%2Ffixed-point-explorer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faygp-dr%2Ffixed-point-explorer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faygp-dr%2Ffixed-point-explorer/lists"}