The Plutus Compilation Pipeline: Understanding Plutus Core(s)
Posted on August 3, 2022Plutus is a strict, pure functional language. It is developed by IOHK for use on the Cardano blockchain, but in this blog post we will not be concerned with specific applications of the language, but instead look at its compilation pipeline.
Technically speaking, Plutus is not one language, but three, and most people who write “Plutus” are not really writing Plutus at all, but Haskell. These Haskell programs are translated to the Plutus Intermediate Representation (PIR). After that, data types are replaced by their Scott encodings, and recursion is replaced by explicit fixpoints to get to typed Plutus Core (PLC). Finally, types are erased to get to the Untyped Plutus Core (UPLC).
In this blog post, we will explain this entire process, with a particular focus on
- The consequences of polymorphism in the typed language on the untyped language
- Scott encoding
- Type and term level fixpoints