{"id":21539129,"url":"https://github.com/profan/brainiac","last_synced_at":"2025-03-17T21:39:32.418Z","repository":{"id":196398074,"uuid":"696023941","full_name":"profan/brainiac","owner":"profan","description":"A F# brainfuck interpreter/compiler, compiles brainfuck to .NET IL and performs some basic optimizations.","archived":false,"fork":false,"pushed_at":"2023-10-04T19:47:26.000Z","size":168,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T08:31:32.532Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"F#","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/profan.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}},"created_at":"2023-09-24T22:57:02.000Z","updated_at":"2023-09-24T23:03:18.000Z","dependencies_parsed_at":"2023-09-29T20:59:46.889Z","dependency_job_id":null,"html_url":"https://github.com/profan/brainiac","commit_stats":null,"previous_names":["profan/brainiac"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profan%2Fbrainiac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profan%2Fbrainiac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profan%2Fbrainiac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profan%2Fbrainiac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/profan","download_url":"https://codeload.github.com/profan/brainiac/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244115111,"owners_count":20400515,"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-11-24T04:14:09.667Z","updated_at":"2025-03-17T21:39:32.400Z","avatar_url":"https://github.com/profan.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"brainiac\n-----------\n... If you're here and you're wondering what this is, it's a simple F# program that compiles [brainfuck](https://en.wikipedia.org/wiki/Brainfuck) to [.NET IL](https://en.wikipedia.org/wiki/Common_Intermediate_Language).\n\nSome simple optimizations are also applied in the process, some of which are the same as in my [old brainfuck interpreter in C](https://github.com/profan/yet-another-brainfuck-interpreter), but this time the optimizations actually compose much better... and the optimization pass code is a lot easier to read because it's not written in C.\n\n# General Details\n* Uses a 65536 * 4 cell space by default.\n* Uses (unsigned) byte cells, wrapping on overflow.\n* ~~Includes a special '#' instruction to dump the contents of all 65536 cells in a 16 column format, with a newline between each cell printed (as a number, not as a character).~~ (TODO)\n* Can directly execute your program, or optionally builds it to a .NET assembly and writes it to file.\n  * Reads your program from an input string (the --input flag) or from file (with the --file flag).\n* Accepts an unbounded input program size.\n\n# Compilation Details\n* Compiles the executed brainfuck to .NET IL, executing by invoking a method generated in the dynamic assembly.\n* Optimizes a few common brainfuck patterns to more specific instructions before compiling to .NET IL, such as:\n  * \\\u003e\\\u003e\\\u003e, ++++, etc.. optimizes continuous sequences of ptr mov/arithmetic into single operations\n  * [-] (which is equal to set current cell to zero) to a direct set to zero\n  * cleans up obviously no-op operations\n\n# License\nSee attached LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofan%2Fbrainiac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprofan%2Fbrainiac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofan%2Fbrainiac/lists"}