{"id":20605326,"url":"https://github.com/dim13/golyb","last_synced_at":"2026-05-26T20:32:26.258Z","repository":{"id":57525756,"uuid":"46677513","full_name":"dim13/golyb","owner":"dim13","description":"Go love your brain - yet another optimizing BrainF*ck interpreter in Go","archived":false,"fork":false,"pushed_at":"2025-09-24T21:24:57.000Z","size":762,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-24T23:28:41.696Z","etag":null,"topics":["brainfuck","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dim13.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":"2015-11-22T20:03:55.000Z","updated_at":"2025-09-24T21:25:00.000Z","dependencies_parsed_at":"2024-06-20T03:17:56.527Z","dependency_job_id":"1208d9cc-0e95-41f5-8404-0e80fed4069f","html_url":"https://github.com/dim13/golyb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dim13/golyb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dim13%2Fgolyb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dim13%2Fgolyb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dim13%2Fgolyb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dim13%2Fgolyb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dim13","download_url":"https://codeload.github.com/dim13/golyb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dim13%2Fgolyb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33538659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["brainfuck","golang"],"created_at":"2024-11-16T09:27:37.520Z","updated_at":"2026-05-26T20:32:26.252Z","avatar_url":"https://github.com/dim13.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/dim13/golyb.svg)](https://pkg.go.dev/github.com/dim13/golyb)\n[![Build](https://github.com/dim13/golyb/actions/workflows/go.yml/badge.svg)](https://github.com/dim13/golyb/actions/workflows/go.yml)\n\n# Go love your brain\nYet another optimizing BrainF\\*ck interpreter in Go\n\n## Installation\n    go get github.com/dim13/golyb/cmd/golyb\n\n## Usage\n```\nUsage of golyb:\n  -dump\n    \tDump AST and terminate\n  -file string\n    \tSource file (required)\n  -in string\n    \tInput file\n  -noop\n    \tDisable optimization\n  -out string\n    \tOutput file or /dev/null\n  -profile string\n    \tWrite CPU profile to file\n  -show\n    \tDump tape cells\n  -tape value\n    \tTape type: static or dynamic (default static)\n```\n\n## Tape storage type\n- static: 32k byte cells including 1k margin on the lower end (used by default)\n- dynamic: int cells allocated in 1k chunks as required on access\n\n# Code optimization\n- [x] Contraction\n- [x] Clear loops\n- [x] Copy loops\n- [x] Multiplication loops\n- [x] Scan loops (kind of)\n- [x] Operation offsets\n- [x] Reduce NOPs\n\nReference: http://calmerthanyouare.org/2015/01/07/optimizing-brainfuck.html\n\n## Some rough results\n\n| Program     | w/o optimization | with optimization | speed gain |\n| -----------:| ----------------:| -----------------:| ----------:|\n| madelbrot.b |         52.3 sec |          11.8 sec |       4.4x |\n| long.b      |         48.5 sec |           5.4 sec |       9.0x |\n| hanoi.b     |         47.0 sec |           1.0 sec |      47.0x |\n| bench.b     |          6.6 sec |           1.1 sec |       6.0x |\n\nExecuted on 1.3 GHz Intel Core i5\n\n## CPU profiles\n\n### mandelbrot.b\n#### optimized\n![mandelbrot profile](profiles/mandelbrot.gif)\n#### not optimized\n![mandelbrot profile](profiles/mandelbrot_noop.gif)\n\n### long.b\n#### optimized\n![long profile](profiles/long.gif)\n#### not optimized\n![long profile](profiles/long_noop.gif)\n\n### hanoi.b\n#### optimized\n![hanoi profile](profiles/hanoi.gif)\n#### not optimized\n![hanoi profile](profiles/hanoi_noop.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdim13%2Fgolyb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdim13%2Fgolyb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdim13%2Fgolyb/lists"}