{"id":49764128,"url":"https://github.com/reflechant/imgo","last_synced_at":"2026-05-11T10:14:02.986Z","repository":{"id":350634012,"uuid":"1207459042","full_name":"reflechant/imgo","owner":"reflechant","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-07T08:52:02.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-07T10:37:33.758Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/reflechant.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-11T01:02:43.000Z","updated_at":"2026-04-22T06:21:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/reflechant/imgo","commit_stats":null,"previous_names":["reflechant/imgo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reflechant/imgo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflechant%2Fimgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflechant%2Fimgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflechant%2Fimgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflechant%2Fimgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reflechant","download_url":"https://codeload.github.com/reflechant/imgo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflechant%2Fimgo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32890173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"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":[],"created_at":"2026-05-11T10:14:01.955Z","updated_at":"2026-05-11T10:14:02.976Z","avatar_url":"https://github.com/reflechant.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 ImGo\n\n**ImGo** is Go with Clojure-like immutability. While it allows non-pure IO and other side effects (much like Clojure), its core is functional in its approach to data. The main idea is to stay as close to Go as possible while providing the safety and reasoning guarantees that deep immutability provides.\n\nImGo isn't just about prohibiting mutation; it's about shifting your mental model from \"updating state in-place\" to \"transforming data through a chain of functions.\" This results in code that is simpler to reason about, trivial to parallelize, and fundamentally more error-proof.\n\n## 🛠️ How it Works\nImGo is a **transpiler** that generates Go code from `.im` source files. It validates your ImGo code against strict immutability rules and lowers functional patterns (like identifier re-binding and recursive nested updates) into efficient Go code that leverages persistent data structures.\n\n## ⚡ Quick Start (For the Impatient)\n\n```bash\n# 1. Build the ImGo transpiler\ngo build -o imgo ./cmd/imgo\n\n# 2. Transpile the examples (you can point ImGo to a directory or to a single file)\n# BTW, check out docs/tutorial.im\n./imgo pkg/transpiler/testdata\n\n# 3. Run a generated example\ngo run pkg/transpiler/testdata/list_imgo_gen.go\n```\n\n## 🔍 Semantic Divergence from Go\nWhile ImGo code looks like standard Go, its functional core leads to several behavioral and syntactical differences.\n\n### 🚫 Prohibitions\n*   **No mutation in place:** Operators `=`, `+=`, `++`, `--`, etc., are strictly forbidden.\n*   **Restricted pointers:** `*T`, `*p`, and `\u0026x` are permitted for type signatures and expressions, but in-place mutation via pointers is strictly forbidden.\n*   **Builtins:** `cap`, `clear`, `close`, `copy`, `delete`, and `new` are prohibited. `append` and `len` are supported.\n\n### 🌊 Immutable Data\nIn order to fully comprehend the concepts behind ImGo it's highly recommended to watch the talk \"Value of Values\" by Rich Hickey. Another good talk of his is \"Simple made easy\".\n\nIn ImGo you can not update data in place like you can \"change the value of a variable\" in Go.\n\nImGo, like Clojure, decouples the notions of \"identity\" and \"value\". Identity is what you're used to call \"variable name\". It's a name, bound to a certain value. \n\nValues are immutable, they **never** change. You can safely store an ImGo value or a pointer to it knowing that it cannot be changed by anyone from the outside.\n\nIn ImGo you can \"reassign\" a value using Go syntax `:=`.\n\nThis is correct ImGo:\n```go\nx := 2\nf := func() { return x }\nx := 3\n```\n\nBecause `x` is an identity and when you refer to it by name you get the **current** state which is an immutable value function `f` will always return `2` no matter what you do.\n\n\n### 📦 Persistent Collections\nLike Go, Imgo has maps, arrays and slices. The difference is they are immutable just like strings in Go. It's achieved by building them on top of a library (github.com/benbjohnson/immutable) of persistent data structures that allow us to efficiently store all the history of changes for as long as it's needed.\n\n*   **Safe Indexing:** `m[k]` and `l[i]` never panic. They return zero-values on miss or out-of-bounds.\n*   **The `make` Discrepancy:** `make([]int, 10)` returns an **empty list (length 0)**, not a list of 10 zeros. `make` is purely for collection initialization in ImGo.\n*   **Nil Safety:** `nil` is a valid empty collection. `len(nilMap)` is 0, and `nilMap.Set(k, v)` returns a new map with one entry.\n\n## 📚 Documentation\n- **[Language Specification](docs/SPEC.md)**: Formal rules and detailed nuances.\n- **[EBNF Grammar](docs/GRAMMAR.md)**: Formal syntax definition.\n- **[Library Reference](docs/REFERENCE.md)**: API for persistent collections.\n- **[Getting Started Tutorial](docs/TUTORIAL.md)**: Build your first ImGo program.\n\n---\n*Built with ❤️ for the Go community.*\n\n## 🤖 AI Disclosure\nThis project is developed and maintained with the assistance of AI models, including Claude 4.6, 4.7, and Gemini 3.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freflechant%2Fimgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freflechant%2Fimgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freflechant%2Fimgo/lists"}