LambdaBuffers for Rust #108
bladyjoker
started this conversation in
General
Replies: 1 comment
-
Please follow our project board for this milestone at https://github.com/orgs/mlabs-haskell/projects/35/views/4 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
LambdaBuffers got funded by the Catalyst Fund10 round (as announced in #101) and our proposal lists Rust support as one of its first milestones.
Achieving this will enable us to seamlessly share types and their values between Rust and other supported languages. Whether it's to store and exchange JSON based configuration or Cardano dApp 'datums', the effort to do so will be effectively reduced to your devops automation and configuration (we provide Nix API to do exactly that). We don't want to spend time manually implementing various encodings in the 21st century, and we want to save you the trouble of doing that as well.
I want to briefly touch on the plans and known challenges that we are tackling to get Rust support.
Code generation
Two basic challenges we tackle here are:
LamVal
to target language translation step for each of the supported languages.LambdaBuffers Prelude for Rust
The LambdaBuffers Prelude package defines some basic types that could considered to be a common denominator between different programming languages. It also specifies a
Json
type class, which is a principal encoding method that each ofopaque
types listed in this module support.So, in order to have Rust support LB's Prelude, we need to:
Maybe
andEither
, are ubiquitous and part of the standard library (Option
andResult
),lbr-prelude
)lbt-prelude
)@szg251 is already tackling this #103.
LambdaBuffers Plutus for Rust
Supporting LambdaBuffers Plutus package is integral to this project, as the gracious Catalyst funding we received is contingent to facilitating Cardano dApp development.
The development process here is basically the same as for the LB Prelude package, we'll just need to do a preliminary investigation to understand which library is best to use when mapping
opaque
types that denote the foundationalplutus-ledger-api
types, the choice is roughly between:uplc
crateThe central LB type class in the Plutus package is
PlutusData
which denotes the, so called, 'Data' encoding which is the foundational value representation used in Cardano's Plutus application platform.Unlike the
lbr-prelude
runtime library for the LB Prelude package, these encodings are already set in stone by Cardano specs and a reference implementations used is located in the Haskell library plutus-ledger-api. This means we don't have to provide PlutusData encoding implementations for all the 'opaque' types in the LB Plutus package, they're already available in the target language ecosystems and we can just (re)use that!We do however need to provide the
lbt-plutus
testsuite to make sure our implementation derivation is sane!Beta Was this translation helpful? Give feedback.
All reactions