Skip to content

Commit

Permalink
Block comments for Schemacode
Browse files Browse the repository at this point in the history
Documentation
  • Loading branch information
cardillan committed Oct 15, 2024
1 parent 38de4a0 commit 651e101
Show file tree
Hide file tree
Showing 35 changed files with 483 additions and 904 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.

* Fixed wrong compilation order of appended files ([#155](https://github.com/cardillan/mindcode/issues/155)).
* Fixed inadequate reporting of syntax error ([#156](https://github.com/cardillan/mindcode/issues/156)).
* Fixed Wrong handling of comparison operators by Data Flow Optimization ([#158](https://github.com/cardillan/mindcode/issues/158)).
* Fixed wrong parsing of formattable string literals.
* Fixed inadequate handling of unsupported expressions embedded in formattable string literals.

Expand All @@ -25,6 +26,10 @@ All notable changes to this project will be documented in this file.
* Added support for creating constants from formattable string literals.
* Added full support for the `sync()` function: a variable passed as an argument to this function becomes automatically volatile.

**Schemacode**

* Added support for block comments, delimited by `/*` and `*/`. These comments can span multiple lines.

#### Experimental features

* Added support for Mindustry Logic from upcoming version 8. The features supported correspond to the current implementation in Mindustry and might therefore still change. All new features are described in a [separate documentation](doc/syntax/MINDUSTRY-8.markdown).
Expand All @@ -35,12 +40,12 @@ All notable changes to this project will be documented in this file.

* **Breaking:** Changed the implementation of the `printf()` function under language target `ML8A`. Instead of compile-time formatting of passed parameters, the function uses `print` and `format` instructions for [run-time formatting](doc/syntax/SYNTAX-4-FUNCTIONS.markdown#run-time-formatting).
* Changed the definition of the `&&` and `||` operators: they are guaranteed to [always evaluate to either `0` or `1`](doc/syntax/SYNTAX-2-EXPRESSIONS.markdown#operators).
* Changed the `min()` and `max()` functions to accept two or more arguments.
* Changed the `min()` and `max()` functions to accept more than just two arguments.
* Changed the [Temporary Variables Elimination optimization](doc/syntax/SYNTAX-6-OPTIMIZATIONS.markdown#temporary-variables-elimination) to replace unused output variables in instructions with `0`, to ensure no unnecessary variable will be created by the instruction, reducing clutter. Closes [#154](https://github.com/cardillan/mindcode/issues/154).
* Changed the [If Expression Optimization](doc/syntax/SYNTAX-6-OPTIMIZATIONS.markdown#if-expression-optimization) to support value propagation for all instructions having one output parameter (based on instruction metadata), instead of just a subset of specifically handled instructions.
* Changed - yet again - the way the [Single Step Elimination optimization](doc/syntax/SYNTAX-6-OPTIMIZATIONS.markdown#single-step-elimination) removes the last instruction which is a jump to the beginning of the program, so that it doesn't leave behind any jump that might have targeted the removed instruction. Such a jump was harmless, but unnecessary and looked strange in the mlog.
* Changed the text buffer handling in the processor emulator to recognize identical outputs produced by consecutive `printflush` operations and avoid creating duplicate outputs.
* When a compiler-generated variable is evaluated as uninitialized, an internal error is thrown. This situation always means there's an error in the compiler or the optimizer, it is better to not produce anything instead of
* When a compiler-generated variable is evaluated as uninitialized (this situation indicates a bug in some of the optimizers), an internal error is thrown.

### Deprecated

Expand All @@ -54,7 +59,7 @@ All notable changes to this project will be documented in this file.
### Miscellaneous

* Added parallel execution of unit tests.
* Renamed the command-line tool module from `compiler` to `cmdline`, and the Mindcode compiler module from `mindcode` to `compiler`.
* Renamed the command-line tool module from `compiler` to `toolapp`, and the Mindcode compiler module from `mindcode` to `compiler`.
* Renamed the files in `bin` directory from `mcc`/`mcc.bat` to `mindcode`/`mindcode.bat`.

## 2.2.1 - 2024-09-30
Expand Down
6 changes: 3 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mindcode

**Mindcode** is a high-level programming language for [Mindustry Logic](https://github.com/Anuken/Mindustry). Mindcode generates fairly well optimized mlog code, utilizing 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/IDE-INTEGRATION.markdown#setting-up-the-command-line-compiler), provides means for integration both with various IDEs and Mindustry itself. The project uses lots of automated tests to make sure the produced code is correct.
**Mindcode** is a high-level programming language for [Mindustry Logic](https://github.com/Anuken/Mindustry). Mindcode generates fairly well optimized mlog code, utilizing 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), provides means for integration both with various IDEs and Mindustry itself. The project uses lots of automated tests to make sure the produced code is correct.

**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.

Expand All @@ -20,7 +20,7 @@ Please read the [syntax](doc/syntax/SYNTAX.markdown) document for a complete des

The most important recent changes to Mindcode include:

* Mindustry Logic
* Mindustry Logic 8
* Full support for the Mindustry Logic in the upcoming Mindustry version 8.
* User interface
* Significant improvement in reporting error messages generated during compilation.
Expand All @@ -39,7 +39,7 @@ Mindcode is available at http://mindcode.herokuapp.com/. Write some Mindcode in

You 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 the Mindustry World is supported.

Alternatively, you can download the command-line compiler and use Mindcode [from within your favourite IDE](doc/syntax/IDE-INTEGRATION.markdown).
Alternatively, you can download the command-line compiler and use Mindcode [from within your favourite IDE](doc/syntax/TOOLS-IDE-INTEGRATION.markdown).

## Mindustry Logic References

Expand Down
Loading

0 comments on commit 651e101

Please sign in to comment.