Please describe your proposed solution.
Market
Developers building out the Cardano ecosystem who would prefer to write smart contracts, off-chain server code, and in-browser front-end code using a single widely adopted JVM programming language.
Problem Space
I will second and expand the MLabs description of The Plutus Compilation Pipeline and Plutus Tx Pain Points from their Plutarch proposal:
The Plutus Tx compilation library has several shortcomings. Notably, it:
- Extensively relies on the INLINEABLE pragma making the majority of existing Haskell libraries unusable
- Produces extremely complicated error messages
- Makes it difficult to use abstractions due to overhead added to the resulting code
- Silently changes the semantics of Haskell code turning function applications strict
- Does not allow for fine-tuned control of Plutus Core
- Does not erase type abstractions (they get turned into a “delay”)
- Almost impossible to debug the UPLC scripts
Solution
Essentially, it was an original goal of using Haskell and PlutusTx – to reuse existing libraries, infrastructure, and tooling.
I propose an even better solution. Scala being a JVM targeted language, benefits from an enormous amount of libraries, has a great industry-grade tooling, excellent IDE support, and broader community.
Scala has a well designed and mature compiler plugins infrastructure we can leverage, similarly to how PlutusTx uses Haskell compiler.
Scala compiles to an intermediate representation, called TASTY, giving access to other code ASTs, allowing reuse of existing code. It’s like having INLINEABLE pragma everywhere.
Please describe how your proposed solution will address the Challenge that you have submitted it in.
Adding Scala support will have a large impact on the Cardano Developer Ecosystem:
- open a large pool of talent for hire
- simplify adoption by the financial sector companies that heavily invested in Java and Scala ecosystems
- greatly improve developers experience with working debugger, good IDE support, faster ‘change-compile-test’ turnaround
What are the main risks that could prevent you from delivering the project successfully and please explain how you will mitigate each risk?
The main risks are unknown unknowns that may arise during the development.
I think I'll be able to solve the potential issues by consulting with either my former colleagues from IOG and/or Scala Compiler developers. I know the guys, we met on conferences, etc.