Cardillan
Cardillan
It looks like this optimization could improve nested conditional expressions as well as loops: ``` if A if B print("B") else print("not B") end print("A") else print("not A") end ```...
Today's release added missing list iteration loop unrolling, and automatic [Function Inlining](https://github.com/cardillan/mindcode/blob/main/doc/syntax/SYNTAX-6-OPTIMIZATIONS.markdown#function-inlining). Both of these weren't at all difficult to implement, once the necessary infrastructure was available. Give it a...
The last two optimizations serving the `speed` goal were added today. They're the [Case Switching](https://github.com/cardillan/mindcode/blob/main/doc/syntax/SYNTAX-6-OPTIMIZATIONS.markdown#case-switching) and [Return optimization](https://github.com/cardillan/mindcode/blob/main/doc/syntax/SYNTAX-6-OPTIMIZATIONS.markdown#return-optimization). Case Switching is useful for larger case expressions having several (at least...
The promised benchmark is here: https://github.com/cardillan/mindcode/discussions/106
A new idea about another kind of speed optimization (although it will require extension of the Data Flow Analysis): if a variable is known to only attain a limited number...
Thanks for all your suggestions! I'll comment on all of them here: > Another optimization idea. Make the compiler optimize jumps to end. Mindcode often generates `jump label-end `, which...
@limonovthesecond2 I've created a separate issue for the new optimization you've suggested.
> will it be that answer ? I'm afraid not. Mindustry Logic has very very limited support for communication between processors. They can only communicate through memory banks/unit flags, and...
That sounds great! I'm looking forward to it. Regarding the function class - what do you need it for? Do you want to manipulate Mindcode source code or compiled code?...
You might want to look at the `OptimizationContext` class. It contains these fields: - `program`: list of logic instructions (may contain _virtual instructions_ - these are resolved as one of...