You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed the webapp.bat file not working on Windows due to classpath being too long.
Added
Added secondary set of icons representing constants with dashes in identifiers replaced by underscores (e.g. ITEM_COAL instead of ITEM-COAL). Kebab-case identifiers (with dashes) are deprecated in Mindcode and will be desupported in a future release. (In Schemacode, there are currently no plans to remove support for kebab-case identifiers.)
Added support for declaring program parameters using a new param keyword. Using global variables for program parametrization is deprecated, program parameters should be used instead. Support for program parametrization through global variables will be removed in a future release.
Added a new noinline keyword, which will prevent a function from being inlined even when called just once, and by the Function Inlining optimization. The keyword can only be used when declaring a function.
Added support for block comments, delimited by /* and */. These comments can span multiple lines.
Added a new schematic sample with quite a sophisticated code on the Schematics page. It consists of an overdrive dome supplied by units controlled by a microprocessor. The microprocessor searches for available units among a list of supported types, switches to the preferred unit type when it becomes available, and rebinds units (possibly switching the type again) if units in use are destroyed or taken over by the player or a rogue processor.
Experimental features
Experimental features may contain bugs or produce suboptimal code, and are subject to change.
Added support for multiple loop variables in list iteration loops. Each iteration processes as many elements from the list as there are loop variables.
Added an out keyword to be used with loop control variables in list iteration loop, allowing list elements to be modified.
Added a new GUI option to choose optimization level in the web app when compiling Mindcode or building Schemacode.
Added a capability to run the compiled code on an emulated processor, by using a Compile and Run button in the web app, or the --run command line option. The output is shown in a separate control in the web app, or written to the log when using the command line tool.
Added a capability to the command line tool to compile several source files at once using the --append command line argument.
Added new optimization level, experimental. On this setting, the Data Flow optimizer doesn't assume the assignments to global variables might be changed by editing the compiled code, allowing to perform more optimizations on them. Program parameters must be used instead of global variables for program parametrization if this optimization level is used.
Added formattable string literals, which allow formatting outputs of the print and println functions the same way as printf does.
Added new sort-variables compiler directive which ensures that user variables will be accessed in a well-defined order, to make inspecting the variables in the Mindustry processors Vars screen easier.
Added generation of signature at the end of the compiled code. The signature is a print instruction (which is not executed) with the text "Compiled by Mindcode - github.com/cardillan/mindcode". The signature is not added should the instruction limit be exceeded, or when the program doesn't naturally end in an unconditional jump. Adding the signature can be disabled in the command line tool by the --no-signature command line argument.
Changed
Changed the names of optimization levels from off and aggressive to none and advanced. The former names are still supported in the #set compiler directive, but not in the command-line options.
Changed the Loop Hoisting optimization to analyze functions modifying variables inside loop instead of blanket assumption that all global variables may be changed by a function.
Changes to the web app
A button was added do the web app to copy the output code to the clipboard with a single click.
It is now possible to select the optimization level directly in the web app user interface. The default optimization level is now basic for Mindcode compiler and advanced for Schemacode builder.
Changed the syntax to allow an optional do keyword in all for and while loops, and optional then keyword in if and elsif statements.
Changed the command line tool to output final instruction numbers when printing out the unresolved code, for easier localization of errors reported when running the compiled code on an emulated processor.
Miscellaneous
From this version (2.2.0) on, Mindcode will use semantic versioning (major version will be increased for significant changes to the syntax). The command-line tool now reports the version when passed in -v or --version as a parameter.
Replaced pattern matching in switch cases (JDK17 preview feature) with if and other constructs to remove the dependency on the --enable-preview switch.
Updated existing Mindcode and Schemacode samples further to adapt for upcoming changes in syntax (optional keywords were added). Some samples were reworked.
This discussion was created from the release 2.2.0.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Fixed
remark()
function if theremarks
option was set tonone
oractive
.webapp.bat
file not working on Windows due to classpath being too long.Added
ITEM_COAL
instead ofITEM-COAL
). Kebab-case identifiers (with dashes) are deprecated in Mindcode and will be desupported in a future release. (In Schemacode, there are currently no plans to remove support for kebab-case identifiers.)param
keyword. Using global variables for program parametrization is deprecated, program parameters should be used instead. Support for program parametrization through global variables will be removed in a future release.noinline
keyword, which will prevent a function from being inlined even when called just once, and by the Function Inlining optimization. The keyword can only be used when declaring a function./*
and*/
. These comments can span multiple lines.Experimental features
Experimental features may contain bugs or produce suboptimal code, and are subject to change.
out
keyword to be used with loop control variables in list iteration loop, allowing list elements to be modified.Compile and Run
button in the web app, or the--run
command line option. The output is shown in a separate control in the web app, or written to the log when using the command line tool.--append
command line argument.experimental
. On this setting, the Data Flow optimizer doesn't assume the assignments to global variables might be changed by editing the compiled code, allowing to perform more optimizations on them. Program parameters must be used instead of global variables for program parametrization if this optimization level is used.print
andprintln
functions the same way asprintf
does.sort-variables
compiler directive which ensures that user variables will be accessed in a well-defined order, to make inspecting the variables in the Mindustry processors Vars screen easier.print
instruction (which is not executed) with the text "Compiled by Mindcode - github.com/cardillan/mindcode". The signature is not added should the instruction limit be exceeded, or when the program doesn't naturally end in an unconditional jump. Adding the signature can be disabled in the command line tool by the--no-signature
command line argument.Changed
off
andaggressive
tonone
andadvanced
. The former names are still supported in the#set
compiler directive, but not in the command-line options.basic
for Mindcode compiler andadvanced
for Schemacode builder.do
keyword in allfor
andwhile
loops, and optionalthen
keyword inif
andelsif
statements.end
instruction at the very end of the program onadvanced
optimization level.Miscellaneous
2.2.0
) on, Mindcode will use semantic versioning (major version will be increased for significant changes to the syntax). The command-line tool now reports the version when passed in-v
or--version
as a parameter.if
and other constructs to remove the dependency on the--enable-preview
switch.This discussion was created from the release 2.2.0.
Beta Was this translation helpful? Give feedback.
All reactions