Rholang is a concurrent programming language, with a focus on message-passing and formally modeled by the ρ-calculus, a reflective, higher-order extension of the π-calculus. It is designed to be used to implement protocols and "smart contracts" on a general-purpose blockchain, but could be used in other settings as well.
The language is still in the early stages of development, but for those who are interested, more information can be found in the RChain Platform Architecture.
Currently we have a working interpreter for the language. It should be considered an early preview of the language.
- Clone the repository
- Configure/fetch dependencies
- Run
sbt rholang/bnfc:generate
to generate the lexer/parser. Re-run whenever you modify the grammar - Run
sbt rholang/compile
to compile classes - Run
sbt rholangCLI/assembly
to build a stand-alone.jar
file
$ java -jar rholang-cli/target/scala-2.12/rholangCLI-assembly-0.1.0-SNAPSHOT.jar rholang/tests/mercury-tut/coat_check_test.rho
<interpreter output follows.>
Consider running with -Dlogback.configurationFile=logback-rholang_cli.xml
for sane log output.
The interpereter can also be run as a REPL. Currently it won't accept multiline input, so each line must be a fully formed term.
See the bugtracker for an up-to-date list of known issues.
In general:
- Guarded patterns for channel receive (e.g.
for (@x <- y if x > 0)
) don't work. - 0-arity send and receive is currently broken.
- We don't pre-evaluate match cases. So matching 7 + 8 as a pattern currently doesn't work. Instead, you must match against 15.
Several working examples have been included in the examples directory, and the examples in the Rholang tutorial also work. If you run into something that doesn't work, check the bugtracker to see if it's a known issue, and if not, feel free to file a bug. We want Rholang to be a useful programming environment.