{"id":16948920,"url":"https://github.com/dentosal/brain-opt","last_synced_at":"2026-04-19T10:35:08.644Z","repository":{"id":83101209,"uuid":"203572917","full_name":"Dentosal/brain-opt","owner":"Dentosal","description":"Optimizing BrainFuck compiler","archived":false,"fork":false,"pushed_at":"2019-08-21T14:03:53.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T06:25:42.147Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Dentosal.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":"2019-08-21T11:47:03.000Z","updated_at":"2022-12-28T13:28:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"df84b06b-ca3d-4070-91cd-33eef3869476","html_url":"https://github.com/Dentosal/brain-opt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dentosal%2Fbrain-opt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dentosal%2Fbrain-opt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dentosal%2Fbrain-opt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dentosal%2Fbrain-opt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dentosal","download_url":"https://codeload.github.com/Dentosal/brain-opt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244776338,"owners_count":20508506,"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":[],"created_at":"2024-10-13T21:52:41.825Z","updated_at":"2026-04-19T10:35:03.592Z","avatar_url":"https://github.com/Dentosal.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BrainOpt - Optimizing BrainFuck compiler\n\nCompiles BrainFuck code to x86-64 assembly.\nQuick compilation, and quick exection.\nAs if you would need those features with BrainFuck.\n\n## Example: Hello World\n\nConsider this rather beautiful `Hello World!` program:\n\n```brainfuck\n++++++++[\u003e++++[\u003e++\u003e+++\u003e+++\u003e+\u003c\u003c\u003c\u003c-]\u003e+\u003e+\u003e-\u003e\u003e+[\u003c]\u003c-]\u003e\u003e.\u003e\n---.+++++++..+++.\u003e\u003e.\u003c-.\u003c.+++.------.--------.\u003e\u003e+.\u003e++.\n```\n\nThat gets optimized to: (manually commented)\n\n```assembly\nextern read\nextern write\nextern exit\nglobal main\n\nsection .text\nmain:                           ; entry point\n    sub rsp, 30000              ; allocate stack space\n    mov rcx, 30000              ; set argument: count\n    mov rdi, rsp                ; set argument: start\n    xor al, al                  ; set argument: byte to clear with\n    rep stosb                   ; zero allocated stack space\n    mov rbx, rsp                ; set cell pointer\n    sub rsp, 8                  ; align stack for extern calls\n    mov rdi, 1                  ; set argument: fd = stdout\n    mov rsi, constant_output0   ; set argument: buf = constant_output0\n    mov rdx, 13                 ; set argument: count = 13\n    call _write                 ; actually write to stdout\n    xor rdi, rdi                ; set status code = 0\n    call _exit                  ; exit\n\nsection .data\n    constant_output0: db \"Hello World!\",0xa\n```\n\nIt's rather well optimized fast, although cleaning 30000 bytes of stack is still not optimized away.\n\n\n## Features\n\n- [x] Deterministic builds\n- [ ] CI tests for Linux (using Vagrant locally)\n\n## Operating system support\n\n- [x] Linux\n- [x] MacOS\n- [ ] Windows\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdentosal%2Fbrain-opt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdentosal%2Fbrain-opt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdentosal%2Fbrain-opt/lists"}