[Epic] AST optimizations
effectfully opened this issue · comments
effectfully commented
This issue is for dumping all the plans regarding AST optimizations (such as case-of-case, case-of-known-constructors etc) in a largely unstructured way. We'll have separate messages for Plutus Core and Plutus IR, please just edit those instead of creating more messages.
effectfully commented
Plutus Core
- in
(\x -> s s x) (addInteger 1 i) xs
we could eta-contract the head tos s
. This potentially changes the order of effects, though - speaking of order of effects, we should figure out a strategy for when it's fine to change it and when it's not. It's worth handling logging and bottom separately, since messing with the former is OK (given it's locked behind a flag not enabled by default) and messing with the latter is a no-no
- handle
chooseList
in case-of-case similarly toifThenElse
? - we need a test that the inliner inline
blah
in(\b -> force ifThenElse b branch1 branch2) blah
. If it doesn't, we should implement that functionality - Aiken folks gave us an idea: try replacing Scott-encoded tuples with SOP-encoded tuples in the recursive functions combinators, SOP-encoded tuples should be faster thus making mutual recursion faster. If there’s anything else Scott-encoded there, we should change it too. Perhaps we could update the entire
PlutusCore.StdLib.Meta.Data.Tuple
. We have to keep the old code too for older versions of Plutus
effectfully commented