{"id":24258316,"url":"https://github.com/sillyfreak/typst-stack-pointer","last_synced_at":"2025-10-07T06:01:49.656Z","repository":{"id":247954328,"uuid":"812743455","full_name":"SillyFreak/typst-stack-pointer","owner":"SillyFreak","description":"Visualize the execution of (imperative) computer programs in Typst","archived":false,"fork":false,"pushed_at":"2025-02-20T15:18:33.000Z","size":1127,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-14T02:22:39.712Z","etag":null,"topics":["typst","typst-package"],"latest_commit_sha":null,"homepage":"https://typst.app/universe/package/stack-pointer","language":"Typst","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/SillyFreak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-06-09T18:49:54.000Z","updated_at":"2025-05-30T15:26:17.000Z","dependencies_parsed_at":"2025-03-04T20:39:49.163Z","dependency_job_id":null,"html_url":"https://github.com/SillyFreak/typst-stack-pointer","commit_stats":null,"previous_names":["sillyfreak/typst-stack-pointer"],"tags_count":1,"template":false,"template_full_name":"SillyFreak/typst-package-template","purl":"pkg:github/SillyFreak/typst-stack-pointer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-stack-pointer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-stack-pointer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-stack-pointer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-stack-pointer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SillyFreak","download_url":"https://codeload.github.com/SillyFreak/typst-stack-pointer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-stack-pointer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265863793,"owners_count":23840888,"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":["typst","typst-package"],"created_at":"2025-01-15T05:37:10.861Z","updated_at":"2025-10-07T06:01:49.335Z","avatar_url":"https://github.com/SillyFreak.png","language":"Typst","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stack Pointer\n\nStack Pointer is a library for visualizing the execution of (imperative) computer programs, particularly in terms of effects on the call stack: stack frames and local variables therein.\n\nStack Pointer lets you represent an example program (e.g. a C or Java program) using typst code with minimal hassle, and get the execution state of that program at different points in time.\n\n## Getting Started\n\nTo add this package to your project, use this:\n\n```typ\n#import \"@preview/stack-pointer:0.1.0\": *\n\n#execute(...)\n```\n\nFor example, the following C program\n\n```c\nint main() {\n  int x = foo();\n  return 0;\n}\n\nint foo() {\n  return 0;\n}\n```\n\nwould be represented by the following Typst code:\n\n```typ\n#let steps = execute({\n  let foo() = func(\"foo\", 6, l =\u003e {\n    l(0)\n    l(1); retval(0)\n  })\n  let main() = func(\"main\", 1, l =\u003e {\n    l(0)\n    l(1)\n    let (x, ..rest) = foo(); rest\n    l(1, push(\"x\", x))\n    l(2)\n  })\n  main(); l(none)\n})\n```\n\nThe `steps` variable now contains an array, where each element corresponds to one of the mentioned lines of code.\n\n## Usage\n\nSee the [manual](docs/manual.pdf) for details.\n\nTake a look at [this complete example](gallery/sum.pdf) of using Stack Pointer together with [Touying](https://touying-typ.github.io/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsillyfreak%2Ftypst-stack-pointer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsillyfreak%2Ftypst-stack-pointer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsillyfreak%2Ftypst-stack-pointer/lists"}