Poplar will target the FIR intermediate language extending Plutus Core for all on-chain code. Any valid Elm code should be a subset of Poplar to allow people to write web-based frontend code in the same language as they write on-chain code. For off-chain backend code, Poplar will target the Pony programming language. Here are some of the benefits of using Pony:
- Pony is an actor model language, promoting concurrency as a basis for system design
- It has a powerful type system with Sum, Product, and Intersection types
- Pony produces fast, non-blocking, highly scalable applications
- It utilizes reference capabilities for memory safety, similar to Rust's borrowing system
- It Can be used to ensure permission security through the use of object capabilities.
Elm uses what's called the Elm Architecture (TEA) to deal with changing states through monoidal composition of model and message pairs through the use of a single update function that takes in any messages that come from previous states of the model (Commands) or from outside the application (Subscriptions) and the current model to produce a new model along with any command messages to issue to the runtime system when the new state is reached. All effects are dealt with by Elm's runtime system, which allows for higher performance, because of referential transparency, which allows memoization during state transitions for diff-based updates.
The same features that make TEA work well in the context of a web app should also be applicable to a single actor, or a group of actors when parts of an update can be parallelized; and should also be able to model state machines to represent smart contracts.
The audience of this project is anyone who would want to produce scalable, full-stack applications that target the Cardano blockchain in order to enforce shared state across their system without having to deal with the cognitive load of using multiple different languages. Another benefit acquired from using one language to build out the full application stack is the ability to fully abstract away the communication layer between the different parts of the application. If you write a data structure that is valid on all parts of the stack, within a single homogenous codebase, it can be passed as a message between the structures that represent the different layers of the stack.
This project should make it easy to onboard Elm programmers for smart contract development on Cardano, as well as making the process much easier for new developers to get started.
One of my other proposals is about teaching people here in Malawi about Cardano and Dapp development. Having this language would make training much easier for me, and I believe this would also be true for others who want to bring more new developers to our ecosystem.
Some of the research involved in this project could also help other tool and language implementors on our platform improve their own systems, so the positive effects could go beyond just this project.
This project will definitely produce some good research that others might find useful in furthering the growth and accessibility of our ecosystem, though, the process of building compilers is a very complicated task. The full potential of this project is at least two years out.
There are techniques that can make the process simpler, as well as ways of patching in existing tools as part of the process before custom tailored solutions are developed, but these can take away from the best possible developer experience.
Patching in existing tools will probably be the best strategy in the short term, because later, these tools can be used to compare outputs with the custom-built solutions through things like property-based testing.