Catalyst milestone 2: End to end proof of concept
Outputs
-
A configuration DSL for specifying domain data types.
- LambdaBuffers Frontend supports specifying modules with type definitions with opaque, product/record and sum types. Additionally, type class definitions are supported as well as type class rule definitions using the 'instance clause' and 'derive' syntax.
- Refer to the standard LambdaBuffers library lbf-base to get a sense of what the language looks like.
-
A compiler tool that outputs the interpreted configuration.
- The Compiler is exposed via an Google Protobuffers based API. The Codegen shares the same API types and is exposed in a similar fashion. The Frontend communicates with these components via the API.
- The API documentation is made available via LambdaBuffers Github Pages.
-
A Codegen module that takes in the interpreted configuration and outputs a Haskell+PlutusTx (was Plutarch) Cabal project containing all the types and necessary type class wiring.
- The module implementation is in lambda-buffers-codegen/src/LambdaBuffers/Codegen/Haskell.
- The auto-generated Haskell files can be viewed in lambda-buffers-codegen/data/goldens/haskell-autogen/LambdaBuffers.
- Codegen module outputs Haskell type definitions, and Prelude.Eq and PlutusTx.ToData type class implementations automatically.
- Plutarch Codegen module is suspended for the current milestone (as communicated with the Catalyst team). Plutarch is a Haskell EDSL for writing Plutus (UPLC) programs, and can be considered a completely separate backend/target language.
-
A Codegen module that takes in the interpreted configuration and outputs a Purescript+CTL Spago project containing all the types and necessary wiring.
- The module implementation is in lambda-buffers-codegen/src/LambdaBuffers/Codegen/Purescript.
- The auto-generated Purescript files can be viewed in lambda-buffers-codegen/data/goldens/purescript-autogen/LambdaBuffers.
- Codegen module outputs Purescript type definitions and Prelude.Eq and Ctl.Internal.ToData type class implementations.
Acceptance Criteria
- The generated Haskell+Plutarch Cabal project can successfully be built.
- The generated Purescript+CTL Spago project can successfully be built.
- All the above codegen modules are reviewed and made available in the project repository.
Evidence of Milestone Completion
-
Project repository is equipped with continuous integration tooling.
- The repository has been consistently built with HerculesCI since the beginning.
-
Completed and reviewed Haskell+Plutarch codegen module is made available in the project repository and the CI builds it successfully.
- The auto-generated Haskell files can be viewed in lambda-buffers-codegen/data/goldens/haskell-autogen/LambdaBuffers.
- Additionally, the auto generated Haskell files used during the demo can be found in experimental/plutustx-env/autogen/LambdaBuffers.
- Codegen module outputs Haskell type definitions, and Prelude.Eq and PlutusTx.ToData type class implementations automatically.
- Plutarch Codegen module is suspended for the current milestone (as communicated with the Catalyst team). Plutarch is a Haskell EDSL for writing Plutus (UPLC) programs, and can be considered a completely separate backend/target language.
-
Completed and reviewed Purescript+CTL codegen module is made available in the project repository and the CI builds it successfully.
- The module implementation is in lambda-buffers-codegen/src/LambdaBuffers/Codegen/Purescript.
- The auto-generated Purescript files can be viewed in lambda-buffers-codegen/data/goldens/purescript-autogen/LambdaBuffers.
- Additionally, the auto generated Purescript files used during the demo can be found in experimental/ctl-env/autogen/LambdaBuffers.
- Codegen module outputs Purescript type definitions and Prelude.Eq and Ctl.Internal.ToData type class implementations.
-
Test case: Compiler is able to output a valid module with types from a schema in Haskell+Plutarch.
- The auto-generated Haskell files can be viewed in lambda-buffers-codegen/data/goldens/haskell-autogen/LambdaBuffers.
-
Test case: Compiler is able to output a valid module with types from a schema in PureScript.
- The auto-generated Purescript files can be viewed in lambda-buffers-codegen/data/goldens/purescript-autogen/LambdaBuffers.
Demo recordings
- Introduction, working with the LambdaBuffers CLI tools and Frontend overview.
- Codegen into Haskell
- Codegen into Purescript
Demo files:
- LambdaBuffers Citizen.lbf module.
- Purescript demo files ctl-env.
- Haskell demo files plutustx-env.