Is Plutarch a good replacement for Plutus Tx?
1 Answer
This is covered pretty nicely in the project README. https://github.com/Plutonomicon/plutarch#why-plutarch
In short, Plutus Tx attempts to replicate Haskell-like lazy semantics inside of Untyped Plutus Core, which is strict by default. Untyped Plutus Core is the compilation target of Plutus which is actually run onchain.
As a result, the plutus interpreter injects a lot of unnecessary code, and makes it very difficult to reason about the time/space complexity of the code that you write.
This is compounded by very low limits for plutus script size, memory, and cpu usage which prevents scripts from running onchain if they are exceeded. As a result, Plutus Tx is only viable for very simple plutus contracts.
Plutarch is 300%+ more efficient on all three of these limits, allowing the same logic to be expressed with less than 1/4 of the resource usage. it is written using haskell, yet makes no attempt to maintain Haskell's lazy semantics, instead i
-
2