{"id":34821531,"url":"https://github.com/cardillan/mindcode","last_synced_at":"2026-04-12T20:01:40.661Z","repository":{"id":42553335,"uuid":"348502265","full_name":"cardillan/mindcode","owner":"cardillan","description":"A high level language for Mindustry Logic (mlog) and Mindustry Schematics.","archived":false,"fork":false,"pushed_at":"2026-01-18T10:53:51.000Z","size":31909,"stargazers_count":126,"open_issues_count":18,"forks_count":13,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-18T12:16:54.840Z","etag":null,"topics":["compiler","logic","mindustry","mlog","schematics"],"latest_commit_sha":null,"homepage":"http://mindcode.herokuapp.com/","language":"Java","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/cardillan.png","metadata":{"files":{"readme":"README.markdown","changelog":"CHANGELOG.markdown","contributing":"CONTRIBUTING.markdown","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/idea/settings-filetypes.zip","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-03-16T21:54:25.000Z","updated_at":"2026-01-12T21:31:24.000Z","dependencies_parsed_at":"2026-01-03T11:00:18.534Z","dependency_job_id":null,"html_url":"https://github.com/cardillan/mindcode","commit_stats":null,"previous_names":["francois/mindcode"],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/cardillan/mindcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardillan%2Fmindcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardillan%2Fmindcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardillan%2Fmindcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardillan%2Fmindcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cardillan","download_url":"https://codeload.github.com/cardillan/mindcode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardillan%2Fmindcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28552595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T20:59:07.572Z","status":"ssl_error","status_checked_at":"2026-01-18T20:59:02.799Z","response_time":98,"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":["compiler","logic","mindustry","mlog","schematics"],"created_at":"2025-12-25T14:45:02.502Z","updated_at":"2026-04-12T20:01:40.648Z","avatar_url":"https://github.com/cardillan.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv markdown=\"1\" align=\"center\"\u003e\n   \u003cimg width=\"100%\" src=\"wide-logo.png\"\u003e\n\n# Mindcode: a high-level compiler for mlog\n\n\u003cbr\u003e\n\n[![Static Badge](https://img.shields.io/badge/web%20app-blue?link=http%3A%2F%2Fmindcode.herokuapp.com%2F)](http://mindcode.herokuapp.com/)\n[![Static Badge](https://img.shields.io/badge/doc-mincdcode-green?link=doc%2Fsyntax%2FSYNTAX.markdown)](doc/syntax/SYNTAX.markdown)\n[![Static Badge](https://img.shields.io/badge/doc-mlog-green?link=doc%2Fsyntax%2FSYNTAX.markdown)](https://yrueii.github.io/Mlog%20Documentation/)\n[![GitHub issue custom search in repo](https://img.shields.io/github/issues-search/cardillan/mindcode?query=is%3Aopen%20label%3Abug\u0026label=open%20bugs\u0026color=red\u0026link=https%3A%2F%2Fgithub.com%2Fcardillan%2Fmindcode%2Fissues%3Fq%3Dis%253Aissue%2520state%253Aopen%2520label%253Abug)](https://github.com/cardillan/mindcode/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug)\n[![Static Badge](https://img.shields.io/badge/chat-discord-blue?link=https%3A%2F%2Fdiscord.gg%2FA8vdVdvf)](https://discord.gg/q4eGwpu2mp)\n\n\u003c/div\u003e\n\u003cbr\u003e\n\n**Mindcode** is a high-level procedural programming language for [Mindustry Logic](https://github.com/Anuken/Mindustry). Many language features are provided, including variable declaration, arrays (including `@counter` arrays), conditional statements and loops, functions, modules, remote variables and function calls (synchronous and asynchronous), atomic code execution, system library, user libraries, debugging support, and others. Mindcode generates fairly well-optimized mlog code, using available instruction space to make the resulting code faster. It comes with a [web app](http://mindcode.herokuapp.com/) and a [command-line compiler](doc/syntax/TOOLS-IDE-INTEGRATION.markdown#setting-up-the-command-line-compiler) and provides means for integration both with various IDEs and Mindustry itself.\n\n**Schemacode**, an extension built over Mindcode, is a specialized definition language designed for creating a complete Mindustry schematic from a text file. [Schematics Builder](doc/syntax/SCHEMACODE.markdown) compiles these definition files directly into Mindustry schematics, either into binary `.msch` file, or into the text representation. Processors can be included in these schematics, complete with the code (specified either in Mindcode or mlog) and linked blocks.\n\n## Supported Mindustry versions\n\nMindcode can generate code for several Mindustry versions and different types of processors. The target can be selected in the web app using a combobox or by including one of the following commands in the source code: \n\n* **6.0 Build 126.2**: use `#set target = 6m;` to select it (`m` denotes a micro-processor, use `l`, `h` or `w` for a logic-, hyper- or world-processor).\n* **7.0 Build 146** (the default one): use `#set target = 7m;` to explicitly select it.  \n* **v8 Build 149 Beta**: use `#set target = 8.0m;` to select it.\n* **v8 Build 155 Beta** or later: use `#set target = 8m;` (or `8.1m`) to select it.\n\nAt this moment, target `8` (or `8.1`) is also fully compatible with the latest Mindustry version (157 Beta / BE build 26951).\n\n[Here](/doc/syntax/MINDUSTRY-8.markdown#new-functionality-in-mindustry-8) is a summary of the new Logic content and corresponding Mindcode functionality in Mindustry 8.\n\n## Mindcode Syntax\n\nPlease refer to the [documentation](doc/syntax/SYNTAX.markdown) for a complete description of Mindcode syntax. You can also use the code examples in the web application to get familiar with Mindcode.  \n\nAdditionally, the following repositories contain Mindcode projects, which may also serve as an example of how to use Mindcode: \n\n* Maintained by the author\n  * [golem](https://github.com/cardillan/golem), a collection of more complex Mindcode and Schemacode scripts.\n* Maintained by other users\n  * [Mindustry Mindcode Projects](https://github.com/50275/mindustry-mindcode-projects)\n  * [Mindustry logic scripts](https://github.com/dadymax/mindustrylogicscripts)\n\n## Latest development\n\nSee [issues](https://github.com/cardillan/mindcode/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) for open bugs and possible workarounds. \n\nThe most important recent changes to Mindcode include:\n\n* Mindustry 8 specific features\n  * Complete support for [the latest Mindustry 8 pre-release](/doc/syntax/MINDUSTRY-8.markdown).\n  * [Atomic code sections](doc/syntax/REMOTE-CALLS.markdown#atomic-code-execution) guaranteed to be executed atomically – without interruption.\n  * Full support for [remote functions and variables](doc/syntax/REMOTE-CALLS.markdown).\n  * [Array implementations](/doc/syntax/optimizations/ARRAY-OPTIMIZATION.markdown) using the Mindustry 8 Logic capabilities. \n  * New string/character-based instructions and character literals.\n* Language/compiler features\n  * Short-circuit evaluation of boolean expressions.\n  * Improved [Loop Rotation](doc/syntax/optimizations/LOOP-ROTATION.markdown) and [Loop Hoisting](doc/syntax/optimizations/LOOP-HOISTING.markdown) optimizations.\n  * The [`in` operator](doc/syntax/SYNTAX-2-EXPRESSIONS.markdown#rangelist-membership-operator) for testing range or list membership.\n  * Local compiler options.\n  * Significantly improved optimization of `case` expressions.\n* Other functionality\n  * Mobile-friendly [web application](http://mindcode.herokuapp.com/) with syntax highlighting.\n  * [Processor emulator](doc/syntax/TOOLS-PROCESSOR-EMULATOR.markdown) for all supported Mindcode targets, including schematic emulation.\n  * Reporting compiled code size broken down by function.  \n  * Support for [symbolic labels and indentation in generated mlog code](/doc/syntax/SYNTAX-5-OTHER.markdown#option-symbolic-labels).\n\nSee [changelog](CHANGELOG.markdown) for a comprehensive list of changes.\n\n## Using Mindcode \n\n### Online\n\nMindcode is available at http://mindcode.herokuapp.com/. Write some Mindcode in the _Mindcode Source Code_ text area, then press the **Compile** button. The _Mlog Code_ text area will contain the mlog version of your Mindcode. Copy the mlog code into the clipboard. Back in Mindustry, edit your processor, then use the **Edit** button in the Logic UI. Select **Import from Clipboard**. Mindustry is now ready to execute your code.\n\nYou can also use the **Compile and Run** button to execute the compiled code right away on an emulated processor. The output produced by `print` instructions in your code will be displayed. Very limited interaction with an emulated Mindustry World is supported.\n\n\u003e [!TIP]\n\u003e Mindcode performs a variety of different optimizations. The mlog code it produces may bear little resemblance to the source code at a first glance.\n\n### Offline\n\nAlternatively, you can download the command-line compiler and use Mindcode [from within an IDE](doc/syntax/TOOLS-IDE-INTEGRATION.markdown).\n\n### Support mods\n\nMindcode can interface with the [Mlog Watcher mod](/doc/syntax/TOOLS-MLOG-WATCHER.markdown) to inject the compiled code into the selected processor in Mindustry World directly, avoiding the use of the clipboard. Both the online and offline versions of Mindcode support this feature.\n\nThe [Mlog Assertions mod](https://github.com/cardillan/MlogAssertions), available for Mindustry 7/8, allows efficient [array-bounds checking](/doc/syntax/SYNTAX-5-OTHER.markdown#option-error-reporting) for both internal and external arrays, making this kind of bugs easier to detect. \n\n## Mindustry Logic References\n\nTo learn more about Mindustry Logic, you can find more information about it here:\n\n* Yruei's [Mlog Documentation](https://yrueii.github.io/MlogDocs/) (last updated April 2026)\n\nYou can also get help on these Discord servers:\n\n* [Logic channel on the Mindustry server](https://discord.gg/YkMMPMYABE)\n* [Mindustry Logic server](https://discord.gg/WkFD3E8bXv)\n\n## Contributing\n\nIf you're interested in helping with this project, please see [CONTRIBUTING](CONTRIBUTING.markdown).\n\nMindcode was initially created by [François Beausoleil](https://github.com/francois), and since 2023 has been maintained by [cardillan](https://github.com/cardillan). The new front-end was developed by [JeanJPNM](https://github.com/JeanJPNM).\n\nFor other contributors, please see [Contributors (GitHub)](https://github.com/cardillan/mindcode/graphs/contributors).\n\n# License\n\nMIT. See [LICENSE](LICENSE) for the full text of the license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardillan%2Fmindcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcardillan%2Fmindcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardillan%2Fmindcode/lists"}