From Lambda to Ledger: A Functional Blockchain DSL Built on Haskell
Conference (INTERMEDIATE level)
Skalkotas
This talk reflects on the development of Plinth, an open source scripting language for the Cardano blockchain. Our journey building Plinth has been unconventional in several ways. First, Plinth reuses a subset of Haskell (as opposed to the much more common embedded DSLs), enabling a number of unique advantages. Second, the compilation process is done in three stages, most of which is handled in a compiler plugin - among the most intricate I’ve encountered - augmented by Template Haskell and runtime lifting where appropriate. Third, we implemented a range of compiler optimizations, some inspired by GHC’s own, others deliberately contrasting with them to suit Plinth’s semantics and runtime characteristics. Finally, Plinth’s runtime is a highly optimized implementation of an abstract machine - the CEK machine, equipped with a novel mechanism for precisely and safely tracking execution cost.
I will recount our design choices, outlining effective practices, challenges, and key takeaways, with an emphasis on recent advances in the language, compiler, and runtime.
I will recount our design choices, outlining effective practices, challenges, and key takeaways, with an emphasis on recent advances in the language, compiler, and runtime.
Ziyang Liu
Input Output Global
I lead the Plutus team at Input Output, focused on developing smart contract languages for the Cardano blockchain, along with the compilers, interpreters, libraries, and costing tools. Our work is fully open source and available at https://github.com/IntersectMBO/plutus.
