{"id":15669272,"url":"https://github.com/crazystylus/brainfk-rs","last_synced_at":"2025-05-06T20:06:06.568Z","repository":{"id":37908261,"uuid":"505466138","full_name":"crazystylus/brainfk-rs","owner":"crazystylus","description":"Compiles brainfuck to wasm!!","archived":false,"fork":false,"pushed_at":"2023-04-30T10:35:10.000Z","size":67,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"mainline","last_synced_at":"2025-03-31T02:22:24.275Z","etag":null,"topics":["brainfuck","compiler","hacktoberfest","jit","llvm","rust","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","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/crazystylus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-06-20T14:03:34.000Z","updated_at":"2023-04-30T15:46:33.000Z","dependencies_parsed_at":"2024-10-03T14:22:16.821Z","dependency_job_id":"8a8f4a06-4b33-41d4-bda1-1553e48d7167","html_url":"https://github.com/crazystylus/brainfk-rs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazystylus%2Fbrainfk-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazystylus%2Fbrainfk-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazystylus%2Fbrainfk-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazystylus%2Fbrainfk-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazystylus","download_url":"https://codeload.github.com/crazystylus/brainfk-rs/tar.gz/refs/heads/mainline","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252761140,"owners_count":21800124,"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","compiler","hacktoberfest","jit","llvm","rust","wasm","webassembly"],"created_at":"2024-10-03T14:22:09.009Z","updated_at":"2025-05-06T20:06:06.508Z","avatar_url":"https://github.com/crazystylus.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brainfk -\u003e WASM\n## Introduction\nThis repo contains a brainfk compiler written in Rust closely tied to wasm.\n\n### Features\n- Generate wasm from brainfk code\n- Compile and run brainfk code\n- Compile brainfk to wasmu (wasmer module serial format) which can run with wasmer-headless\n- Supports following backends\n  - LLVM (uses LLVM 14)\n  - Cranelift\n  - Singlepass\n\n### Usage\n```\n# JIT Compile \u0026 Execute brainfk code\n$ brainfk-rs run tests/files/hello.bf --backend cranelift\nHello World!\n\n$ brainfk-rs generate-wasm tests/files/hello.bf hello.wasm --target wasi\n✔ Successfully generated wasm.\n\n$ brainfk-rs compile-wasmu tests/files/hello.bf hello.wasmu --backend cranelift\n✔ Compiled successfully to wasmu.\nCompiled file can be executed using wasmer-headless.\n\n# Running in wasmer-headless\n$ ./wasmer-headless run hello.wasmu\nHello World!\n```\n\n### Install Wasmer Runtime\nFollow this link to install wasmer-runtime\nhttps://docs.wasmer.io/ecosystem/wasmer/getting-started\n\n## Benchmarks\n\n| Command | Mean [s] | Min [s] | Max [s] |\n|:---|---:|---:|---:|\n| `mandelbrot-extreme.bf` | 72.278 | 72.273 | 72.282 |\n| `mandelbrot-titannic.bf` | 13.979 | 13.975 | 13.982 |\n| `mandelbrot-huge.bf` | 2.9724 | 2.9729 | 2.9733 |\n| `mandelbrot.bf` | 0.56329 | 0.56318  | 0.56340 |\n| `mandelbrot-tiny.bf` | 0.14279 | 0.14277  | 0.14281 |\n\n### Benchmark Environment\n```\nCPU:Ryzen 5 5600X (12) @ 3.700GHz\nMemory: 16GB DDR4 3400 MT/s\nLinux: Pop!_OS 22.04 LTS x86_64\nKernel: 5.19.0-76051900-generic\nRust: rustc 1.64.0 (a55dd71d5 2022-09-19)\nToolchain Target: stable-x86_64-unknown-linux-gnu\n```\n\n### Performing a Benchmark\nCriterion-rs is used for benchmarking and report is generated in target dir.\n```\ncargo build --release --bench\ncargo bench\n```\n\n## TODO\n- [ ] Runtime memory check and growth\n- [x] Integrate with wasmer and support run \u0026 compile\n- [x] Add testing\n- [x] Benchmarks\n- [x] Add support for JS/Browser\n- Optimizations\n  + [x] Stdout Buffering\n  + [x] Utilize wasm-opt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazystylus%2Fbrainfk-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazystylus%2Fbrainfk-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazystylus%2Fbrainfk-rs/lists"}