<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 10, 2022 at 8:10 PM J. Gareth Moreton via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi everyone,<br>
<br>
This has been something that has been on my mind for a while now, but <br>
with my increasingly more complex optimisations being developed for the <br>
Free Pascal Compiler and the code becoming an ever bigger spiderweb of <br>
conditions, it got me to start wondering... might compiler optimisation <br>
be a candidate for AI?<br></blockquote><div><br></div><div>An interersting thought. On a slightly different tangent, could the language rules itself not be codified as a matrix so that one can use matrix algebra to perform node level optimizations via similarity transforms? Alternatively, if you want to test a candidate optimization idea, check if there is a feasible solution using matrix algebra (in other words check if it satisfies all the language rules and the original intent). My simplistic view of Pascal is that the language rules should form a set of linear equations (else the language specification is overly complicated), so linear algebra is ideal for checking if a potential solution satisfies the language rules. Also one could cast a node level optimization as a (similarity?) transformation matrix and apply this to the basic nodes generated by the parser.</div><div><br></div><div>So there is perhaps some scope for "simple" algebra before diving into stochastic optimization techniques.</div></div></div>