Skip to content

Releases: cardillan/mindcode

3.16.1

12 Apr 17:52

Choose a tag to compare

3.16.1 – 2026-04-12

Fixed

  • Fixed incorrect Condition Optimization (#307).

Added

  • Added a limit on the maximum length of mlog string literals (65,535 bytes in UTF-8 encoding). String literals larger than this limit cause compilation errors.
  • Added a limit on the maximum generated mlog code size (102,400 bytes in UTF-8 encoding). When the generated or loaded mlog code exceeds this limit, an error or warning is generated, depending on the value of the enforce-instruction-limit compiler option.
  • Added support for the new setrule pauseDisabled instruction.

Changed

  • The new version of the Mlog Watcher mod is now used by default by the tool app.
  • Updated the Mindustry metadata to the latest version, adding the new @large-canvas block.

3.16.0

06 Mar 17:09

Choose a tag to compare

3.16.0 – 2026-03-06

Changed

  • The target attribute specified in a Schemacode definition file now expects only the version number (e.g., target = 8.0). The processor type cannot be specified using the target attribute, but is inferred from the block type in the schematic.
  • The web application has been completely overhauled. The highlights of the new web app are:
    • Modern, mobile-friendly design.
    • The compilation happens without page refresh, meaning the edit history of the code is not lost on compilation. It is also possible to undo (Ctrl-Z) the action of loading an example code or clearing the editor.
    • Syntax highlighting in the source code editor. All syntaxes (Mindcode including mlog blocks, Schemacode) are supported.
    • Code folding in all source code editors.
    • Indicating syntax errors from the last compilation directly in the editor.
    • Support for running schematics and generic mlog code on the built-in processor emulator.

3.15.1

28 Feb 21:03

Choose a tag to compare

3.15.1 – 2026-02-28

Fixed

  • Fixed compiler crashing when an unsupported combination of a processor version and a processor type is specified (e.g., #set target = 6;).
  • Fixed wrong handling of linked blocks by the DFO (#303).
  • Fixed Boolean Optimization bugs (#304):
    • The optimization may crash when compiling for targets 8.0 and lower.
    • The optimization incorrectly processes some noninteger values.

3.15.0

22 Feb 21:00

Choose a tag to compare

3.15.0 – 2026-02-22

Note

Atomic code sections are only guaranteed to execute correctly in Minddustry build 155 Beta or later.

Note

The new Mlog Watcher functionality available with the tool app requires a new version of the Mlog Watcher mod. The new version has not yet been released, but a Mindustry 8-compatible binary is available here. To use that version, the --watcher-version v1 command line argument must be specified.

Fixed

  • Fixed a possible error in the tool app handling command-line parameters (#302).

Added

  • Breaking: the loop keyword has been reintroduced, to create infinite loops. Code that uses loop as a function or variable name will not compile, and the variable or function will have to be renamed.
  • Added the possibility to use the break statement to exit code blocks.
  • Added implicit labels to loops and code blocks.

Changed

  • Breaking: Changed the meaning of the target compiler option: when no processor type is specified, the compiler generates the code for a non-processor context. Privileged instructions are supported, but atomic sections and waits aren't.

3.14.0

08 Feb 11:44

Choose a tag to compare

3.14.0 – 2026-02-08

Note

Atomic code execution are only guaranteed to execute correctly in the latest BE version (build 26658 or later). The latest beta release (v154.3) doesn't provide necessary support for atomic code execution.

Note

The new Mlog Watcher functionality available with the tool app requires a new version of the Mlog Watcher mod. The new version has not yet been released, but a Mindustry 8-compatible build is available here. To use that version, the --watcher-version v1 command line argument must be specified.

Fixed

  • Fixed an internal error when compiling a function in the main program declared as export.
  • Fixed incorrect Temp variable elimination (#298).
  • Fixed a possible internal error when parsing a syntactically incorrect file.
  • Fixed incorrect handling of some privileged instructions by the Print Merging optimization (#300).
  • Fixed incorrect handling of function calls in short-circuit expressions by the Data Flow Optimization (#301).

Added

  • Added the atomic() intrinsic function and atomic function modifier.
  • Added support for nested atomic sections and atomic function calls from an atomic section. The entire topmost atomic section is executed atomically.
  • Added support atomic section merging. The duration limit of a merged section can be specified using the atomic-merge-level compiler option (one tick by default).
  • Added a atomic-safety-margin compiler option. No safety margin is necessary with the latest Mindustry BE build, though.
  • Added new tool app functionalities:
    • Support for the new version of Mlog Watcher mod, providing several useful new ways to send or extract mlog code and schematics to/from a running game. To use the new Mlog Watcher mod, the --watcher-version v1 command-line argument needs to be specified.
    • Ability to execute mlog code loaded from a file on the processor emulator and for sending it to the Mlog Watcher. Use the new pm or process-mlog command-line argument.
    • Ability to execute schematics loaded from a file on the processor emulator and for sending it to the new version of the Mlog Watcher. Use the new ps or process-schematic command-line argument.
  • Added a validation step to the compiler to verify the generated code doesn't exceed the maximum number of instructions. The enforce-instruction-limit compiler option can be used to control this behavior.

Changed

  • When an atomic section doesn't contain any protected instruction, the wait instruction providing the atomicity of the section is not generated.
  • The setrate instruction is no longer allowed in atomic sections.
  • The volatile-atomic compiler option has been renamed to atomic-full-protection, with inverted meaning.
  • Changed Mindcode syntax to allow specifying multiple function modifiers in arbitrary order. For example, it is now possible to declare a function as inline debug as well as debug inline (which was the only allower order previously).
  • Compiler and optimizer messages are no longer output on the console in the command-line application. To access these messages, a log file needs to be generated.
  • Console output is generated on the fly, instead of being cached and dumped all at once when the processing is finished.

Deprecated

  • The dm (decompile mlog) and ds (decompile schematic) command-line arguments are deprecated. Use pm and ps instead ("p" stands for "process" as the command-line tool now allows more actions to be performed in addition to decompilation, such as running it on the internal emulator).
  • The Schematics Refresher mod is deprecated and will be no longer maintained. The Mlog Watcher mod will provide better functionality for managing schematics in the game.

3.13.0

18 Jan 20:22

Choose a tag to compare

3.13.0 – 2026-01-18

Note

The atomic code blocks are only guaranteed to execute correctly in the latest BE version (build 26609 or higher). The latest beta release (v154.3) doesn't provide necessary support for atomic code blocks.

Fixed

  • Fixed incorrect emulation of the instruction accumulator for targets 6 and 7 affecting instruction scheduling.

Added

  • Added new @maxUnits sensable property.
  • Added an atomic code block: a block of code guaranteed to be executed atomically (without interruption), meaning that other processors or game updates do not change the world state.
  • Added the setrate and ipt compiler options. These options specify the rate at which a world processor executes instructions (used by the compiler when building atomic blocks).
  • Added the volatile-atomic compiler option governing the way atomic blocks are created.
  • Added the processor-id, program-name and program-version compiler options. These options take string values, which are then encoded into a *id variable and can be used to identify the processor in the schematics.
  • Added the emulator-fps compiler options to specify the frame rate to be emulated by the processor emulator. While frames are always emulated fully by Mindcode emulator, the change in instruction scheduling caused by different frame rate only affects situations where an interaction between two or more processors is being emulated.
  • Added the ability to run the compiled schematics on the schematics emulator to the tool app.
  • Added support for sensing @x and @y in blocks when emulating schematics.
  • Added the encode-zero-characters compiler option, which allows encoding zero characters in string literals. Use with caution: resulting code cannot be edited or passed via clipboard. Option has no effect in the web app.

Changed

  • Runtime errors generated when running the code in the processor emulator no longer prevent outputting the compiled code in the tool app.
  • Changed the format of the target compiler option. Instead of a processor edition (standard or world), a particular processor type is now specified, using the first letter of the type name (i.e., m for micro-, l for logic-, h for hyper-, and w for world-processor, case-insensitive), for example, #set target = 8L;.
  • When compiling Mindcode for a processor in a schematic, the target type of the processor is determined by the block type in the schematic.
  • Compiler-defined constants now follow the @@VARIABLE pattern, instead of earlier __VARIABLE__ (for example, @@MINDUSTRY_VERSION).
  • Changed the emulator handling of the wait instruction with zero argument to match the latest Mindustry BE behavior.

Miscellaneous

  • The system of compiler options has been updated to allow determining whether a given option has been set. This allows the default values of unset options to be derived from the values of other options.
  • The transfer variable, defined for uncached external and remote variables, is no longer used for reads. Instead, a fresh new temporary variable is used each time. This may increase the number of temporary variables generated but avoids unnecessary instructions when using postfix operators on these variables. This became quite important with atomic blocks.

3.12.1

12 Jan 21:34

Choose a tag to compare

3.12.1 - 2026-01-12

Fixed

  • Fixed the Data Flow optimization incorrectly marking a variable as uninitialized (#296).

3.12.0

11 Jan 13:45

Choose a tag to compare

3.12.0 - 2026-01-11

Fixed

  • Fixed incorrect evaluation of some numeric mlog constants (#295).
  • Fixed the Mandelbrot schematic sample not rendering after build.

Changed

  • The Loop Rotation optimization has been updated:
    • Full loop rotation is performed even for conditions which contain complex code (such as nested loops or function calls).
    • A full loop rotation is also considered alongside a partial rotation if it could be beneficial to Loop Hoisting.
  • The Loop Hoisting optimization has been extended:
    • The optimizer gathers information to support the Loop Rotation optimization.
    • When a loop is fully rotated, an instruction can be hoisted in such a way that it's executed at most once, but only if the loop actually runs.
    • When a loop is not known to execute at least once, an instruction affecting just the loop can still get hoisted entirely out of the loop if the loop is nested.
  • The mlog processor emulator has been completely rewritten. The emulator now matches the behavior if a Mindustry processor of the version identified by the target (or emulator-target compiler options.
  • The execution flags have been updated to match the new processor emulator. Some flags have been removed, some have been added, and some have been renamed.
  • The processor emulator is now able to execute supported instructions even when created using an mlog() fuction or an mlog block. This includes the code generated by the compatibility library.

3.11.0

25 Dec 12:05

Choose a tag to compare

3.11.0 - 2025-12-25

Note: the new features in this release bring about changes to the best practices for writing Mindcode.

Fixed

  • Some select optimizations were not applied when optimizing for size. As a result, code optimized for size might end up larger than code optimized for speed.
  • Some select optimizations may have been incorrect. Due to the previous bug, the probability of them being applied was low (#290).
  • Fixed the wrong optimization of volatile variables in If Expression Optimization (#291).
  • Fixed instructions being hoisted in front of the loop even when the loop is not guaranteed to run (#293).
  • Fixed loop-dependent instructions being possibly hoisted in front of the loop (#294).

Added

  • Breaking: new keywords have been added to the language: public and private and are reserved for future use. Code that uses any of these keywords as a function or variable name will not compile, and the variable or function will have to be renamed.
  • Added the no-argument-padding compiler option. When activated, instructions are not padded to the maximum number of arguments.
  • Added the author compiler option. The option adds an entry to the list of authors, which is then displayed alongside the usual compiler signature.
  • Added support for new instruction opcode (ucontrol deconstruct).
  • Added a binary in operator for testing whether a value is contained in a given range or a list of values.

Changed

  • Breaking: The and and or operators now perform short-circuit evaluation.
  • The Jump Optimization has been renamed to Condition Optimization, and has been significantly extended:
  • Breaking: The jump-optimization command-line option and compiler directive has been renamed to condition-optimization.
  • The Loop Optimization has been renamed to Loop Rotation, and has been extended to support short-circuit conditions. Full and partial loop rotations are now supported.
  • Breaking: The loop-optimization command-line option and compiler directive has been renamed to loop-rotation.
  • The Boolean Optimization, previously included in the If Expression Optimization as a Select Optimization, has been extracted into a separate optimization class and enhanced:
    • Several optimizations aimed at short-circuited conditional expressions were added.
    • Where possible, an op instruction is used instead of select. This allows applying some optimizations even when the compilation target doesn't support select.
  • The Expression Optimization has been updated:
    • More cases where a select instruction can be replaced with a set instruction are now supported.
    • When the resulting values of select are 0 and 1 and the condition allows it, the instruction is replaced with an op instruction.
    • The instruction normalizing the result of an || operator to 0 or 1 is removed when not needed.
    • Added an optimization turning a read instruction with a constant string and a constant index into a set instruction setting the character value directly.
  • When evaluating jump and select conditions during optimizations, cases where the operands of the condition are identical (the same variable) are handled.
  • The compatibility system library now also performs a test to find out whether assigning null to @counter is ignored by the processor.
  • The mimex metadata have been updated to match the current BE version. The most significant change is a new set of sound constants.
  • The documentation has been restructured. Individual optimizers are described in separate files, and the description of Logic functions with links to the Function reference was also moved to a separate file.

Miscellaneous

  • A new optimization, Instruction Reordering, is being developed. The corresponding compiler directive is already present, but the optimization, even when explicitly enabled, is not yet functional.
  • All experimental features are now considered standard. The default optimization level is now advanced. Going forward, only features controllable via compiler options will be marked experimental, and the default optimization level will be advanced. Note that Mindcode is a live system and features may be modified to support new functionalities. A reasonable effort will be spent to ensure smooth conversion or backwards compatibility, but all features, both well-established and relatively recent, can be changed or removed in a new release.

3.10.0

17 Nov 22:13

Choose a tag to compare

3.10.0 - 2025-11-17

Fixed

  • Fixed an error in the Single Step Elimination optimization causing some superfluous jumps not being removed.

Added

  • A new fast dispatch optimization is available for case expressions. Fast dispatch uses just a single instruction to transfer the control to the desired branch of a case expression, including the else branch.
  • A new value translation optimization, which reads values encoded into a text string using the read instruction, may be applied on case expressions (#289).
  • Added the use-text-translations compiler option to allow/disallow using encoding values into a text string for the above optimization.

Changed

  • Breaking: the text-tables compiler option has been renamed (yet again - sorry) to use-text-jump-tables.
  • The Case Switcher optimization was updated to fully support null values in when branches (even in integer expressions).
  • The Extended testing tool now accepts values for any compiler directive in the settings file.