Why are we using Scala for RChain?
Scala is a type-safe, mostly-functional language whose semantics are relatively well understood. That means that when we write software in Scala, we have some kind of prayer that we can prove it works the way we intended. We could have chosen another functional language, like Haskell, but we liked Scala because it runs on the JVM. That means that production integration is an easier sell to IT managers and business-people. They almost certainly have the JVM running in their stack, somewhere, and so we're not asking to place something esoteric in their data centers. The early core development team--Greg Meredith, Mike Stay, and others--had a lot of experience with Scala and were happy with it. As a result, we all agreed that Scala would be an excellent tool for realizing the RChain technology vision.
As far as "why didn't you choose X?," the answer is that we chose Scala. We didn't "not choose" whatever other language. Erlang, Golang, Rust, and Haskell are all fine languages, but they're not the language RChain will be written in. Projects do not succeed because of the programming language they're written in. Projects succeed or fail because of the people and because of the ideas. We have found that the Scala community contains many very talented people and that hiring Scala developers has allowed us to be more successful in the hiring process than one would statistically expect. Scala also allows us to express our ideas with clarity in a functional setting, while leveraging a variety of existing toolsets to great effect. This is a very powerful combination. ~Nash Foster
New to Scala?
Use the resources below to get started.
- Setting up your environment using either IDE or command line
- Tour of Scala - This tour contains bite-sized introductions to the most frequently used features of Scala. It is intended for newcomers to the language.
- Scala tutorial for Java programmers
Books and resources recommended by the RChain development team
Book or resource title with link | Recommended by | Why is this recommended? |
---|---|---|
Programming Scala: Tackle Multi-Core Complexity on the Java Virtual Machine (Pragmatic Programmers) | Mike Stay | |
http://ccfit.nsu.ru/~den/Scala/programming_in_scala_2nd.pdf | Keith McQueen | Free PDF |
Programming in Scala: Updated for Scala 2.12 3rd Edition | Keith McQueen | Latest edition |
https://www.amazon.com/Scala-Cookbook-Object-Oriented-Functional-Programming/dp/1449339611 https://play.google.com/store/books/details/Alvin_Alexander_Scala_Cookbook?id=xVU2AAAAQBAJ | Jeremy Busk | These give great examples for problems using Scala. |
Jeremy Busk | Udemy is a great resource. I've always been better off from doing a course. |
RChain Scala style guide
To assure code quality the RChain development team has adopted some common practices related to the implementation of Scala on the project. Below are resources to related to these decisions. As you are working and run into questions about how to use Scala on the project, please ask!!
*Note - resources below pulled from conversations in the RChain development team discord channel.
Topic | Resource |
---|---|
Tagless final style | Tagless final style reference guide Free and tagless compared - how not to commit to a monad too early |
Cats | https://typelevel.org/cats |