{"id":29245739,"url":"https://github.com/aygp-dr/scope-safari","last_synced_at":"2025-07-03T22:30:30.979Z","repository":{"id":301606784,"uuid":"1006529759","full_name":"aygp-dr/scope-safari","owner":"aygp-dr","description":"Cross-language exploration of module systems, scope, closures, and environment handling with formal verification","archived":false,"fork":false,"pushed_at":"2025-06-23T22:57:21.000Z","size":613,"stargazers_count":0,"open_issues_count":42,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-27T19:30:55.236Z","etag":null,"topics":["closure","concurrency","cross-language","emacs","environment","formal-methods","formal-verification","freebsd","language-comparison","literate-programming","makefile","module-systems","org-mode","programming-languages","scope","thread-safety","tla-plus","verification"],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","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-06-22T13:30:33.000Z","updated_at":"2025-06-24T06:33:14.000Z","dependencies_parsed_at":"2025-06-27T19:31:05.249Z","dependency_job_id":"d8ce4260-ceee-4682-9f40-28fbbbfaac37","html_url":"https://github.com/aygp-dr/scope-safari","commit_stats":null,"previous_names":["aygp-dr/scope-safari"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aygp-dr/scope-safari","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fscope-safari","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fscope-safari/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fscope-safari/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fscope-safari/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aygp-dr","download_url":"https://codeload.github.com/aygp-dr/scope-safari/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fscope-safari/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263414831,"owners_count":23463032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["closure","concurrency","cross-language","emacs","environment","formal-methods","formal-verification","freebsd","language-comparison","literate-programming","makefile","module-systems","org-mode","programming-languages","scope","thread-safety","tla-plus","verification"],"created_at":"2025-07-03T22:30:27.984Z","updated_at":"2025-07-03T22:30:30.931Z","avatar_url":"https://github.com/aygp-dr.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: Scope Safari\n#+AUTHOR: Environment Explorer\n#+DATE: 2025-06-22\n\n#+HTML: \u003cp align=\"center\"\u003e\n#+HTML:   \u003cimg src=\"https://img.shields.io/badge/status-development-orange\" alt=\"Status: Development\"/\u003e\n#+HTML:   \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue\" alt=\"License: MIT\"/\u003e\n#+HTML:   \u003cimg src=\"https://img.shields.io/badge/platform-FreeBSD%2014.3-red\" alt=\"Platform: FreeBSD 14.3\"/\u003e\n#+HTML: \u003c/p\u003e\n\n* Scope Safari: A Cross-Language Environment Exploration\n\nThis project explores scope, environment, and closures across different programming languages.\n\nEach implementation provides a minimal utility that converts boolean values to emoji:\n- ~true~ → \"😊\"\n- ~false~ → \"😔\"\n\nThe focus is on examining how different languages handle scope, environment, and module systems.\n\n* Tested Languages Matrix (FreeBSD 14.3-RELEASE)\n\n| Language   | Version      | Status  | Notes                         |\n|------------+--------------+---------+-------------------------------|\n| Python     | 3.11.11      | ✅      | Using uv for venv management  |\n| JavaScript | Node 22.14.0 | ✅      | npm 10.9.2                    |\n| Elisp      | Emacs 30.1   | ✅      | GNU Emacs                     |\n| Guile      | 3.0.10       | ✅      | GNU Guile 3                   |\n| Clojure    | 1.12.0.1488  | ✅      | Clojure CLI                   |\n| Hy         | 1.0.0        | ✅      | Lisp syntax for Python        |\n| Smalltalk  | 3.2.5        | ✅      | GNU Smalltalk                 |\n| Go         | 1.21.13      | ✅      | Thread-safe implementation    |\n| Rust       | 1.85.0       | ✅      | Using AtomicUsize for safety  |\n| C          | Clang 19.1.7 | ✅      | Using atomic variables        |\n| Zig        | 0.13.0       | ✅      | Memory-safe systems language  |\n| Haskell    | 9.4.8        | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/1][Issue #1]], [[https://github.com/aygp-dr/scope-safari/issues/17][#17]] (High)         |\n| Elixir     | 1.16.1       | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/2][Issue #2]] (Medium)         |\n| OCaml      | 4.14.0       | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/4][Issue #4]] (High)           |\n| Kotlin     | 1.9.20       | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/14][Issue #14]] (Low)           |\n| Crystal    | 1.9.2        | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/19][Issue #19]] (Low)           |\n| Julia      | 1.10.0       | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/18][Issue #18]] (Low)           |\n| V          | 0.4.0        | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/20][Issue #20]] (Low)           |\n| Nim        | 1.6.14       | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/23][Issue #23]] (Medium)         |\n| Racket     | 8.11.1       | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/24][Issue #24]] (Medium)         |\n| Ruby       | 3.2.7        | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/25][Issue #25]] (Low)           |\n| Perl       | 5.36.3       | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/26][Issue #26]] (Low)           |\n| Tcl        | 8.6.15       | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/27][Issue #27]] (Low)           |\n| Lua        | 5.4.7        | ⬜      | [[https://github.com/aygp-dr/scope-safari/issues/28][Issue #28]] (Medium)         |\n\n* Setup\n\n1. Clone the repository\n2. Install language dependencies (optional):\n   #+begin_src bash\n   make install-deps  # Requires sudo\n   #+end_src\n3. Create and activate the Python virtual environment:\n   #+begin_src bash\n   uv venv\n   source .venv/bin/activate\n   #+end_src\n\n* Project Structure\n\nThe project follows a simple structure for each language implementation:\n\n#+begin_src\nscope-safari/\n├── com/\n│   └── example/\n│       └── truthmoji/\n│           ├── index.js      # JavaScript implementation\n│           ├── index.ts      # TypeScript implementation\n│           ├── __init__.py   # Python implementation\n│           ├── truthmoji.hy  # Hy implementation\n│           ├── truthmoji.el  # Elisp implementation\n│           ├── truthmoji.scm # Guile Scheme implementation\n│           ├── truthmoji.st  # Smalltalk implementation\n│           ├── truthmoji.go  # Go implementation\n│           ├── truthmoji.rs  # Rust implementation\n│           ├── truthmoji.c   # C implementation\n│           └── truthmoji.zig # Zig implementation\n├── contracts/           # Formal specifications\n│   ├── TruthMoji.tla    # TLA+ specification\n│   ├── TruthMoji.cfg    # TLA+ configuration\n│   ├── TruthMoji.sol    # Solidity contract\n│   ├── truthmoji.lean   # Lean theorem proving\n│   └── truthmoji_contract.py # Pydantic contract\n├── scripts/             # Utility scripts\n│   └── download_tools.sh # Downloads TLA+ tools and reference manuals\n├── tools/               # TLA+ and verification tools (created by download_tools.sh)\n├── docs/                # Documentation and reference manuals\n│   └── references/      # Language reference manuals (created by download_tools.sh)\n├── .venv/               # Python virtual environment\n├── scope-safari.el      # Emacs support for the project\n├── .dir-locals.el       # Emacs directory local variables\n└── README.org           # This file\n#+end_src\n\n* Language Selection\n\nThe languages for this project were selected based on several factors:\n\n- Initial focus on Lisp family languages (Elisp, Scheme, Clojure, Hy)\n- High popularity/usage languages from the [[https://www.tiobe.com/tiobe-index/][TIOBE Index]]\n- Languages available in FreeBSD ports (/usr/ports/lang/)\n- Inspiration from [[https://github.com/kanaka/mal][MAL (Make A Lisp)]] project\n- Diverse representation of programming paradigms\n\nAdditional language implementations are tracked as GitHub issues, allowing other contributors or AI agents to extend the project while maintaining the consistent test structure. Implementation priorities (High, Medium, Low) reflect the importance of each language to the core goals of the project.\n\n* Key Insights\n\nFrom the exploration of scope and environment across different languages:\n\n1. *Lexical vs Dynamic*: All modern implementations use lexical scope by default\n2. *Privacy*: Ranges from convention (Python ~_~) to enforced (JS closures)\n3. *Introspection*: Lisp-family languages generally offer more runtime inspection\n4. *State Management*: Closures remain the universal pattern for encapsulation\n\n* Usage\n\nEach language implementation can be run independently. Use the Makefile targets for running implementations:\n\n#+begin_src bash\n# Run a specific language implementation\nmake run-js      # JavaScript\nmake run-py      # Python\nmake run-hy      # Hy\nmake run-el      # Elisp\nmake run-scm     # Guile Scheme\nmake run-clj     # Clojure\nmake run-st      # Smalltalk\nmake run-go      # Go\nmake run-rust    # Rust\nmake run-c       # C\nmake run-zig     # Zig\n\n# Run all implementations\nmake run-all\n#+end_src\n\nSee SS.org for details on each implementation.\n\n* Formal Verification\n\nThis project includes formal specifications of the TruthMoji behavior using:\n\n- TLA+ specification (contracts/TruthMoji.tla)\n- Pydantic model for Python (contracts/truthmoji_contract.py)\n- Solidity smart contract (contracts/TruthMoji.sol)\n- Lean theorem proving (contracts/truthmoji.lean)\n\nTo download TLA+ tools and language reference manuals:\n\n#+begin_src bash\nmake download-tools\n#+end_src\n\nTo run the TLA+ model checker against the specification:\n\n#+begin_src bash\nmake verify-tla\n#+end_src\n\nTo verify against the Pydantic contract:\n\n#+begin_src bash\nmake verify-contract\n#+end_src\n\nTo run all verification tools:\n\n#+begin_src bash\nmake verify-all\n#+end_src\n\n* License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faygp-dr%2Fscope-safari","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faygp-dr%2Fscope-safari","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faygp-dr%2Fscope-safari/lists"}