{"id":46698812,"url":"https://github.com/ejgallego/imp-lab","last_synced_at":"2026-03-09T06:04:15.262Z","repository":{"id":340231556,"uuid":"1165087600","full_name":"ejgallego/imp-lab","owner":"ejgallego","description":"Lean playground for programming language modeling tooling.","archived":false,"fork":false,"pushed_at":"2026-02-24T23:54:52.000Z","size":313,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-25T00:54:13.369Z","etag":null,"topics":["dap","formal-methods","formal-verification","functional-programming","lean","lean4","lsp","tooling","ux-research"],"latest_commit_sha":null,"homepage":"","language":"Lean","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ejgallego.png","metadata":{"files":{"readme":"README.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-23T20:10:58.000Z","updated_at":"2026-02-24T23:44:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ejgallego/imp-lab","commit_stats":null,"previous_names":["ejgallego/dap","ejgallego/imp-lab"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ejgallego/imp-lab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejgallego%2Fimp-lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejgallego%2Fimp-lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejgallego%2Fimp-lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejgallego%2Fimp-lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ejgallego","download_url":"https://codeload.github.com/ejgallego/imp-lab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejgallego%2Fimp-lab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30284636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"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":["dap","formal-methods","formal-verification","functional-programming","lean","lean4","lsp","tooling","ux-research"],"created_at":"2026-03-09T06:03:58.638Z","updated_at":"2026-03-09T06:04:15.253Z","avatar_url":"https://github.com/ejgallego.png","language":"Lean","funding_links":[],"categories":[],"sub_categories":[],"readme":"# imp-lab\n\nImpLab is a Lean playground for programming language modeling and teaching-oriented tooling.\n\nToday the core feature is the debugger, available in two modes:\n\n- as a [Debug Adapter Protocol (DAP)](https://microsoft.github.io/debug-adapter-protocol/) server (`toydap`) for editor integration, and,\n- as an in-editor Lean UI built with [ProofWidgets](https://github.com/leanprover-community/ProofWidgets4).\n\nImpLab was built using [Lean](https://lean-lang.org/) and [OpenAI's Codex](https://openai.com/codex/)\n\n**Note**: ImpLab is not production ready! It is designed to demonstrate and explore Lean’s capabilities. The code is a prototype and has not undergone the rigorous review and testing required for production use.\n\n## Run the Imp debugger\n\n### 1) Build the project\n\n```bash\nlake build\ncd client \u0026\u0026 npm install \u0026\u0026 npm run compile\n```\n\n### 2) Run in VS Code (DAP mode)\n\n1. Open the extension project:\n\n```bash\ncode client\n```\n\n2. In that VS Code window, press `F5` and run one of:\n- `Run ImpLab Toy DAP Extension (watch)`\n- `Run ImpLab Toy DAP Extension (compile once)`\n\n3. In the Extension Development Host window:\n- open the folder at the root of this repository,\n- open `examples/Main.lean`,\n- run debug config `ImpLab Toy DAP (auto-export ProgramInfo)`.\n\nNotes:\n- The launch config should auto-generate the debugger meta-data `.dap/programInfo.generated.json` using `dap-export` automatically.\n- The adapter binary is `toydap`.\n\n### 3) Run in Lean (ProofWidgets mode, less involved, less features)\n\n1. Open `examples/Main.lean`.\n2. Ensure the Lean infoview is active.\n3. Evaluate the widget declaration at the end of the file:\n\n```lean\n#widget ImpLab.traceExplorerWidget with ImpLab.Lang.Examples.sampleTracePropsJson\n```\n\nThis launches a debugger session directly in infoview.\n\n## Language\n\nImpLab includes a small imperative language with:\n\n- integer literals and local variables,\n- top-level mutable globals (`global g := N`) stored in a heap,\n- arithmetic operations (`add`, `sub`, `mul`, `div`),\n- heap operations (`get g`, `set g := v`),\n- function calls with parameters,\n- source-aware program metadata used by the debugger.\n\nPrograms are written with:\n\n- `imp%[...] : ImpLab.ProgramInfo`\n\nExample:\n\n```lean\ndef sample : ImpLab.ProgramInfo := imp%[\n  global counter := 0,\n  def inc(x) := {\n    let one := 1,\n    let out := add x one,\n    return out\n  },\n  def main() := {\n    let seed := 5,\n    let out := call inc(seed),\n    set counter := out,\n    let latest := get counter\n  }\n]\n```\n\n`get` and `set` on undeclared globals fail with a runtime error.\n\nLanguage reference:\n- `docs/language.md`\n\n## Additional links\n\n- Debugger architecture and launch contract: `docs/debugger.md`\n- Debugger roadmap (active priorities): `docs/debugger-roadmap.md`\n- VS Code extension details: `client/README.md`\n- Agent instructions (global): `AGENTS.md`\n- Agent instructions (debugger-local): `ImpLab/Debugger/AGENTS.md`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejgallego%2Fimp-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fejgallego%2Fimp-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejgallego%2Fimp-lab/lists"}