{"id":27223761,"url":"https://github.com/alextopher/autoperm","last_synced_at":"2025-04-10T09:36:33.463Z","repository":{"id":58457919,"uuid":"531751187","full_name":"Alextopher/autoperm","owner":"Alextopher","description":"A tool that generates instructions for applying stack effects diagrams. Includes a brainfuck backend \u003c3 ","archived":false,"fork":false,"pushed_at":"2025-01-28T09:30:25.000Z","size":104,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T21:18:14.186Z","etag":null,"topics":["brainfuck","programming-languages"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alextopher.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}},"created_at":"2022-09-02T02:12:39.000Z","updated_at":"2025-01-25T18:02:19.000Z","dependencies_parsed_at":"2025-01-25T18:31:47.257Z","dependency_job_id":null,"html_url":"https://github.com/Alextopher/autoperm","commit_stats":{"total_commits":80,"total_committers":4,"mean_commits":20.0,"dds":0.375,"last_synced_commit":"6d434963606ef78aded0ca9c5d1931022d11fdaf"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alextopher%2Fautoperm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alextopher%2Fautoperm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alextopher%2Fautoperm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alextopher%2Fautoperm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alextopher","download_url":"https://codeload.github.com/Alextopher/autoperm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248192367,"owners_count":21062672,"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":["brainfuck","programming-languages"],"created_at":"2025-04-10T09:36:32.722Z","updated_at":"2025-04-10T09:36:33.455Z","avatar_url":"https://github.com/Alextopher.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Crates.io](https://img.shields.io/crates/v/autoperm.svg)](https://crates.io/crates/autoperm)\n[![Documentation](https://docs.rs/autoperm/badge.svg)](https://docs.rs/autoperm/)\n[![Dependency status](https://deps.rs/repo/github/Alextopher/autoperm/status.svg)](https://deps.rs/repo/github/Alextopher/autoperm)\n\n# autoperm\n\nautoperm is a tool for generating programs that apply [stack effect diagrams](https://en.wikipedia.org/wiki/Stack-oriented_programming#Stack_effect_diagrams). The produced result has the fewest number of `MOV`\\* instructions. The algorithm has its foundations in [Tarjan's Strongly Connected Components](https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm).\n\nThe library is backend agnostic. A [brainfuck](https://en.wikipedia.org/wiki/Brainfuck) backend is provided. Installing the crate as a binary gives access to the `autoperm` command which uses this brainfuck backend.\n\n\\* A `MOV` Clears the data at a particular memory address and writes it to a list of other cells\n\nCheckout the [explanation](./explanation.md)!\n\n## Install\n\n```shell\ncargo install autoperm\n```\n\n## Usage\n\n```bf\n$ autoperm a b -- b a\n[-\u003e+\u003c]\u003c[-\u003e+\u003c]\u003e\u003e[-\u003c\u003c+\u003e\u003e]\u003c\n\n$ autoperm\na b c -- c a b\n[-\u003e+\u003c]\u003c[-\u003e+\u003c]\u003c[-\u003e+\u003c]\u003e\u003e\u003e[-\u003c\u003c\u003c+\u003e\u003e\u003e]\u003c\n\na -- a a a a\n[-\u003e\u003e\u003e\u003e+\u003c\u003c\u003c\u003c]\u003e\u003e\u003e\u003e[-\u003c+\u003c+\u003c+\u003c+\u003e\u003e\u003e\u003e]\u003c\n\na b c d -- d c a b\n[-\u003e+\u003c]\u003c\u003c[-\u003e\u003e+\u003c\u003c]\u003e[-\u003c+\u003e]\u003c\u003c[-\u003e\u003e+\u003c\u003c]\u003e\u003e\u003e\u003e[-\u003c\u003c\u003c\u003c+\u003e\u003e\u003e\u003e]\u003c\n\na b c -- c\n\u003c\u003c[-]\u003e[-]\u003e[-\u003c\u003c+\u003e\u003e]\u003c\u003c\n\na b c d e f -- c d d f e e b\n\u003c\u003c\u003c\u003c\u003c[-]\u003e[-\u003e\u003e\u003e\u003e\u003e+\u003c\u003c\u003c\u003c\u003c]\u003e[-\u003c\u003c+\u003e\u003e]\u003e[-\u003c+\u003c+\u003e\u003e]\u003e\u003e[-\u003c\u003c+\u003e\u003e]\u003c[-\u003e\u003e\u003e+\u003c\u003c\u003c]\u003e\u003e\u003e[-\u003c\u003c+\u003c+\u003e\u003e\u003e]\u003c\n\n```\n\nThe program assumes the memory pointer is pointing at the top of the stack. Any new cells should start empty and there must be 1 free cell at the top of the stack for temporary storage.\n\nFor example:\n\n```bf\n(a b c -- c)\nstart must be:\n  a  b *c  0 // a and b are cleared\n\u003c\u003c[-]\u003e[-]\u003e[-\u003c\u003c+\u003e\u003e]\u003c\u003c\nend:\n *c  0  0  0\n\n(a -- a a a a)\nstart must be:\n *a  0  0  0  0 // note: no 0s are initialized before usage\n[-\u003e\u003e\u003e\u003e+\u003c\u003c\u003c\u003c]\u003e\u003e\u003e\u003e[-\u003c+\u003c+\u003c+\u003c+\u003e\u003e\u003e\u003e]\u003c\nend:\n  a  a  a *a  0\n```\n\nA walk through of (a b -- a b a b)\n\n```bf\na b -- a b a b\n\u003c[-\u003e\u003e\u003e\u003e+\u003c\u003c\u003c\u003c]\u003e\u003e\u003e\u003e[-\u003c\u003c+\u003c\u003c+\u003e\u003e\u003e\u003e]\u003c\u003c\u003c[-\u003e\u003e\u003e+\u003c\u003c\u003c]\u003e\u003e\u003e[-\u003c+\u003c\u003c+\u003e\u003e\u003e]\u003c\n\n# the tape\n 0 *1  2  3  T \n a  b  0  0  0\n\n\u003c[-\u003e\u003e\u003e\u003e+\u003c\u003c\u003c\u003c]      0 → {T}\n*0  1  2  3  T \n 0  b  0  0  a\n\n\u003e\u003e\u003e\u003e[-\u003c\u003c+\u003c\u003c+\u003e\u003e\u003e\u003e]  T → {2 0}\n 0  1  2  3 *T \n a  b  a  0  0\n\n\u003c\u003c\u003c[-\u003e\u003e\u003e+\u003c\u003c\u003c]      1 → {T}\n 0 *1  2  3  T \n a  0  a  0  b\n\n\u003e\u003e\u003e[-\u003c+\u003c\u003c+\u003e\u003e\u003e]     T → {1 3}\n 0  1  2  3 *T \n a  b  a  b  0\n\n\u003c \n 0  1  2 *3  T \n a  b  a  b  0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextopher%2Fautoperm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falextopher%2Fautoperm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextopher%2Fautoperm/lists"}