{"id":14991191,"url":"https://github.com/supertails/langcraft","last_synced_at":"2025-04-05T12:06:22.709Z","repository":{"id":110617629,"uuid":"275293402","full_name":"SuperTails/langcraft","owner":"SuperTails","description":"Compiler from LLVM IR to Minecraft datapacks.","archived":false,"fork":false,"pushed_at":"2022-06-03T14:44:46.000Z","size":549,"stargazers_count":556,"open_issues_count":2,"forks_count":7,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-05T12:06:18.613Z","etag":null,"topics":["compiler","llvm","minecraft"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SuperTails.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-06-27T03:37:44.000Z","updated_at":"2025-03-29T03:35:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0eb7cdb-b07f-4d9e-ad5b-5c036a41f5a5","html_url":"https://github.com/SuperTails/langcraft","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/SuperTails%2Flangcraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperTails%2Flangcraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperTails%2Flangcraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperTails%2Flangcraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperTails","download_url":"https://codeload.github.com/SuperTails/langcraft/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332605,"owners_count":20921853,"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":["compiler","llvm","minecraft"],"created_at":"2024-09-24T14:21:42.458Z","updated_at":"2025-04-05T12:06:22.686Z","avatar_url":"https://github.com/SuperTails.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Langcraft\n### The LLVM target for Minecraft you've never wanted\n\nLangcraft is a code generator targeting [Minecraft Data Packs](https://minecraft.gamepedia.com/Data_Pack). It can currently run a fairly substantial set of bitcode files without issue. The project has a built-in command interpreter for debugging that supports breakpoints (ish) and inspecting register/memory values. All generated datapacks can be run in a real Minecraft Java Edition 1.16+ world in under 5 minutes.\n\n(See also [Wasmcraft2](https://github.com/SuperTails/wasmcraft2) for the spiritual successor to this project, which is faster and more reliable)\n\n### Usage\n```\ncargo run -- --arg1 --arg2 ./path/to/llvm/bitcode.bc\n```\nValid arguments are:\n - `--help`: Display usage and available options\n - `--out=path/to/dir/`: Specify the directory the datapack files should be placed in (default is `./out`)\n - `--run`: Run the command interpreter on the generated code\n - `--trace-bbs`: Insert a print command at the beginning of each LLVM basic block\n\nTo use the generated datapack in Minecraft:\n 1. Copy the entire output folder (`./out` by default) to the `datapacks/` directory of a Minecraft world (using a superflat void world is recommended)\n 2. Run `/function setup:setup`. This only has to be done the first time a Langcraft datapack is used in a world.\n 3. Run `/function rust:run`\n 4. If the datapack is modified while the world is open, run `/reload` and then go back to step 3.\n\nRust code must be built as follows:\n - Release mode \n - `panic=abort`\n - `#![no_std]`\n - `#![no_main]`\n - Have a `main` function with `#[no_mangle]`\n - Use `i686-unknown-linux`\n\n`rust_interp` is a Rust project already configured to generate the proper bitcode. The `interpreter` binary target as shown in the demo can be built with:\n```\nsh compile_rust.sh\n```\n\nAnd the file to use will be:\n\n`rust_interp/target/i686-unknown-linux-gnu/release/deps/interpreter-SOMEHEXSTRING.bc`\n\nAny other language capable of generating LLVM bitcode can be used, as long as it can be built for a bare-metal 32-bit target. For a clang example see `compile_c.sh`.\n\nNote that the latest nightly versions of rustc now use LLVM 11, which Langcraft cannot parse (yet). You can set an earlier version to use for a directory with:\n```\nrustup override set nightly-2020-08-23\n```\n\n### Demo\nA video of a Langcraft-compiled interpreter can be seen [here](https://youtu.be/Cx0w5Wn9pPU).\n\n### License\nLicensed under either of\n - MIT License\n - Apache License, Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupertails%2Flangcraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupertails%2Flangcraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupertails%2Flangcraft/lists"}