Catalyst milestone 4: Separate PlutusTx backend and improvements to existing LambdaBuffers facilities
Outputs
-
A separate code generator for Haskell and PlutusTx
-
A separate LambdaBuffers code generation module that outputs type definitions and derived implementations for Haskell's Prelude and PlutusTx's Prelude (or equivalent LambdaBuffers' Preludes) given a LambdaBuffers schema.
-
A Haskell test suite that assures the manually implemented and automatically generated implementations are consistent with the predefined LambdaBuffers Prelude golden data set of JSON files and perform correct implementation derivation.
- The Haskell test suite can be found here
-
-
Nix devops modules (Nix API) for streamlining the LambdaBuffers code generation pipeline to either Haskell's Prelude or PlutusTx's Prelude.
-
Documentation on LambdaBuffers usage patterns for Haskell's Prelude and PlutusTx's Prelude
-
A complete Plutus .lbf schema file to include all Plutus Ledger API types with backend support for Rust, TypeScript, and PureScript.
-
The
.lbf
schema file for V1 Plutus Ledger API can be found here -
The
.lbf
schema file for V2 Plutus Ledger API can be found here -
Rust backend support is given by the JSON file here where the types are provided by this package.
-
TypeScript backend support is given by the JSON file here where the types are provided by this package
-
PureScript backend support is given by the JSON file here where the types are provided by this package
-
-
An extended integration test suite to verify that the manually implemented and automatically implemented instances of the updated LambdaBuffers' Plutus .lbf schema file are consistent across all backends.
- The extended integration test suite to verify that the manually implemented and automatically implemented instances of the updated LambdaBuffers' PlutusTx .lbf schema file are consistent across all backends can be found here.
-
A versioning scheme for the LambdaBuffers git repository using git tags that follow semantic versioning.
-
A versioning scheme for the git repository using git tags that follows semantic versioning is given in the Releases page
-
Documentation for how the versioning scheme interplays with the monorepo setup is described in the CONTRIBUTING.md
-
-
Optimized Nix build times.
-
This was fixed in #233. It's well known that (in the version of Nix used with LambdaBuffers) large
flake.lock
files are a detriment to performance. So prior of #233, in e.g. 9ae3705f3f1a5c2506c7f86c8d5643c38d79e849, we see that$ git checkout 9ae3705f3f1a5c2506c7f86c8d5643c38d79e849 $ time nix flake lock real 0m27.437s user 0m27.331s sys 0m0.116s $ wc -l flake.lock 44552 flake.lock
it takes almost 28 seconds to execute the
nix flake lock
command due to the almost 45000 lines largeflake.lock
file.After the merge of #233, in e.g. 401f8a920a557c71440795174da199a1e128c4f9, we see significantly improved Nix performance
$ git checkout 401f8a920a557c71440795174da199a1e128c4f9 $ time nix flake lock real 0m1.423s user 0m1.348s sys 0m0.067s $ wc -l flake.lock 11585 flake.lock
where it now takes only about 1.5 seconds to execute the
nix flake lock
command due to the significantly reducedflake.lock
file size of being just under 12000 lines.
-
-
Error messages that follow the GNU error message format.
Acceptance Criteria
-
An executable and Nix tooling to translate LambdaBuffers modules to Haskell projects to specify application types.
-
An executable and Nix tooling to translate LambdaBuffers modules to PlutusTx projects to specify application types.
-
An updated LambdaBuffers Plutus schema for the complete Plutus Ledger API types.
- The updated LambdaBuffers Plutus schema for the complete Plutus Ledger API types can be found here
-
The documentation and devops tooling is available to facilitate easy adoption.
-
Git tags for official releases of LambdaBuffers.
- The releases page contains git tags for official releases of LambdaBuffers.
Evidence of Milestone Completion
-
The completed and reviewed LambdaBuffers code generator for Haskell's Prelude.
-
The completed and reviewed LambdaBuffers code generator for PlutusTx's Prelude.
-
Benchmarks of the before and after optimized Nix build times.
- This was fixed in #233, see above for benchmarks.
-
Demonstrations (in the form of screenshots or simply text) of error messages following the GNU error message format.
- We can see the following error messages follow the GNU error message format
$ lbf-prelude-to-haskell DoesNotExist.lbf DoesNotExist.lbf: error: the provided module file DoesNotExist.lbf doesn't exist $ cat TEST.lbf module TEST import Prelude (Eq, Json, Maybe, Either, List, Integer) derive Eq What $ lbf-prelude-to-haskell TEST.lbf TEST.lbf:5.11-5.15: error: [module TEST] type What not found in the module's scope Either Integer List Maybe Prelude.Either Prelude.Integer Prelude.List Prelude.Maybe $ cat ANOTHERTEST.lbf module ANOTHERTEST import Prelude (Eq, Json, Maybe, Either, List, Integer) prod What = (Integer derive Eq What $ lbf-prelude-to-haskell ANOTHERTEST.lbf ANOTHERTEST.lbf:6.7: error: unexpected keyword expecting s-expression