- Automatic Program Optimization
- 28 Aug 2014 04:36:52 pm
- Last edited by scAFwATLxpKzRCmVaHv on 28 Oct 2019 02:28:29 pm; edited 2 times in total
A very useful feature collection that could be added to SourceCoder is an automatic TI-BASIC program optimizer. For example, it would delete closing parentheses and quotation marks, find redundancies like:
Code:
and replace them, for example:
Code:
It could also combine commands that require no new line/colon; it could change:
Code:
to:
Code:
A bit more complicated would be higher-level optimization like replacing While loops with For loops wherever possible, etc.
I am no expert on program optimization, as I am sure people like KermM are. Perhaps some of the optimizations I mentioned have drawbacks, and there are definitely many optimizations I did not mention.
Could somebody please look into coding an optimizer into SourceCoder?
Code:
Disp "HELLO!
Pause
and replace them, for example:
Code:
Pause "HELLO!
It could also combine commands that require no new line/colon; it could change:
Code:
Archive X
DelVar A
to:
Code:
Archive X DelVar A
A bit more complicated would be higher-level optimization like replacing While loops with For loops wherever possible, etc.
I am no expert on program optimization, as I am sure people like KermM are. Perhaps some of the optimizations I mentioned have drawbacks, and there are definitely many optimizations I did not mention.
Could somebody please look into coding an optimizer into SourceCoder?