Last updated 2 years ago
People find it difficult to understand the potential of projects by reading whitepapers and websites, with unfriendly technical terms used. The terms used are very technical and not easy to access.
Scala compiler plugin to compile Scala to Untyped Plutus Core, similar to PlutusTx.
Benefits:
This is the total amount allocated to Scalus – Scala to Plutus compiler.
Scala compiler plugin to compile Scala to Untyped Plutus Core, similar to PlutusTx.
Benefits:
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:
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.
Adding Scala support will have a large impact on the Cardano Developer Ecosystem:
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.
Main tasks and development milestones are:
Scala UPLC CEK machine implementation – 80 hours
Scala TASTY to UPLC converter (limited to functions, constants, builtins, and expressions) – 80 hours
Scala Compiler Plugin MVP – 80 hours
Execution cost for CEK machine – 80 hours
Flat serialization – 80 hours
Plutus v2 builtins implementation – 160 hours
Generic Data serialization/deserialization for Scala datatypes – 80 hours
Optimization – 80
Test Suit satisfying "plutus-conformance" test vectors – 80 hours
Documentation, examples, tutorials – 80 hours
DevOps Effort (CI, Maven Central release, AWS) – 40 hours
Contingency Budget – 200 hours
Total engineering hours – 1120 hours
Budget – $84,000
Alexander Nemish
Scala and Haskell engineer.
Former IOG employee, worked on Marlowe.
Yes. I'd like to extend the Scala support with further development of libraries/frameworks for writing on-chain and off-chain code on Cardano.
It's an open source project, so the progress will be seen on Github: https://github.com/nau/scalus
KPIs (Key Performance Indicators):
Developers will be able to write Plutus Scripts in Scala.
Developers will benefit from the excellent IDE support, debugger, build tools, and faster compilation-testing turnaround whilst not sacrificing type safety.
More developers could write smart contracts for Cardano.
Developers will be able to reuse their Scala code in browser by compiling it to JavaScript using Scala.js.
This is a new proposal.