Skip to content

Instantly share code, notes, and snippets.

@kayvank
Last active April 19, 2018 07:27
Show Gist options
  • Save kayvank/15182c3dd554462ad03a99a9cb02b9ed to your computer and use it in GitHub Desktop.
Save kayvank/15182c3dd554462ad03a99a9cb02b9ed to your computer and use it in GitHub Desktop.
To run Rholang that is stored in a plain text file

Rchain

Rholang

executing Rholang source code

To run Rholang that is stored in a plain text file

Looks as if some required features are missing from the rchain/rnode. Using the instruction against the source code rholang/exmaples I could only get a successful run for:

Here are the result of running the docker image against all the examples code:

Script
➜  examples git:(dev) ✗ for i in `ls *.rho`; do echo "---- $i ---"; docker run -it --mount type=bind,source="$(pwd)",target=
Output
---- auction.rho ---
Syntax Error, trying to recover and continue parse... for input symbol "" spanning from unknown:18/41(1011) to unknown:18/42(1012)
Exception in thread "main" java.lang.Exception: Unrecoverable Syntax Error
	at coop.rchain.rholang.syntax.rholang_mercury.parser.unrecovered_syntax_error(parser.java:744)
	at java_cup.runtime.lr_parser.parse(lr_parser.java:731)
	at coop.rchain.rholang.syntax.rholang_mercury.parser.pProc(parser.java:731)
	at coop.rchain.node.Main$.buildAST(main.scala:213)
	at coop.rchain.node.Main$.buildNormalizedTerm(main.scala:203)
	at coop.rchain.node.Main$.main(main.scala:122)
	at coop.rchain.node.Main.main(main.scala)
---- hello_world_again.rho ---
Exception in thread "main" java.lang.Error: Compilation of construct not yet supported.
	at coop.rchain.rholang.interpreter.ProcNormalizeMatcher$.normalizeMatch(normalize.scala:537)
	at coop.rchain.rholang.interpreter.ProcNormalizeMatcher$.normalizeMatch(normalize.scala:448)
	at coop.rchain.rholang.interpreter.ProcNormalizeMatcher$.normalizeMatch(normalize.scala:354)
	at coop.rchain.rholang.interpreter.ProcNormalizeMatcher$.normalizeMatch(normalize.scala:467)
	at coop.rchain.rholang.interpreter.ProcNormalizeMatcher$.normalizeMatch(normalize.scala:480)
	at coop.rchain.node.Main$.normalizeTerm(main.scala:217)
	at coop.rchain.node.Main$.buildNormalizedTerm(main.scala:206)
	at coop.rchain.node.Main$.main(main.scala:122)
	at coop.rchain.node.Main.main(main.scala)
---- stderr.rho ---
Evaluating:
@{ "stderr" }!("hello, world!")

> Storage Contents:
@{ "stderr" }!("hello, world!")

> ---- stderrAck.rho ---
Evaluating:
new x0 in { @{ "stderrAck" }!("hello, world!", *x0) | for( _ <- x0 ) { @{ "stderr" }!("received") } }

> Storage Contents:
@{ "stderrAck" }!("hello, world!", 99f7209f-37e6-46ac-9419-e95b8b19f2b6) | for( _ <- @{ 99f7209f-37e6-46ac-9419-e95b8b19f2b6 } ) { @{ "stderr" }!("received") }

> ---- stdout.rho ---
Evaluating:
@{ "stdout" }!("hello, world!")

> Storage Contents:
@{ "stdout" }!("hello, world!")

> ---- stdoutAck.rho ---
Evaluating:
new x0 in { @{ "stdoutAck" }!("hello, world!", *x0) | for( _ <- x0 ) { @{ "stdout" }!("received") } }

> Storage Contents:
@{ "stdoutAck" }!("hello, world!", dea9b8c2-94dd-4e23-a287-9a5c46ed2be3) | for( _ <- @{ dea9b8c2-94dd-4e23-a287-9a5c46ed2be3 } ) { @{ "stdout" }!("received") }

> ---- token.rho ---
Syntax Error, trying to recover and continue parse... for input symbol "" spanning from unknown:11/33(404) to unknown:11/34(405)
Exception in thread "main" java.lang.Exception: Unrecoverable Syntax Error
	at coop.rchain.rholang.syntax.rholang_mercury.parser.unrecovered_syntax_error(parser.java:744)
	at java_cup.runtime.lr_parser.parse(lr_parser.java:731)
	at coop.rchain.rholang.syntax.rholang_mercury.parser.pProc(parser.java:731)
	at coop.rchain.node.Main$.buildAST(main.scala:213)
	at coop.rchain.node.Main$.buildNormalizedTerm(main.scala:203)
	at coop.rchain.node.Main$.main(main.scala:122)
	at coop.rchain.node.Main.main(main.scala)
---- tut-coat-check.rho ---
Syntax Error, trying to recover and continue parse... for input symbol "" spanning from unknown:4/21(111) to unknown:4/22(112)
Exception in thread "main" java.lang.Exception: Unrecoverable Syntax Error
	at coop.rchain.rholang.syntax.rholang_mercury.parser.unrecovered_syntax_error(parser.java:744)
	at java_cup.runtime.lr_parser.parse(lr_parser.java:731)
	at coop.rchain.rholang.syntax.rholang_mercury.parser.pProc(parser.java:731)
	at coop.rchain.node.Main$.buildAST(main.scala:213)
	at coop.rchain.node.Main$.buildNormalizedTerm(main.scala:203)
	at coop.rchain.node.Main$.main(main.scala:122)
	at coop.rchain.node.Main.main(main.scala)
---- tut-hello-again.rho ---
Syntax Error, trying to recover and continue parse... for input symbol "" spanning from unknown:4/11(77) to unknown:4/12(78)
Exception in thread "main" java.lang.Exception: Unrecoverable Syntax Error
	at coop.rchain.rholang.syntax.rholang_mercury.parser.unrecovered_syntax_error(parser.java:744)
	at java_cup.runtime.lr_parser.parse(lr_parser.java:731)
	at coop.rchain.rholang.syntax.rholang_mercury.parser.pProc(parser.java:731)
	at coop.rchain.node.Main$.buildAST(main.scala:213)
	at coop.rchain.node.Main$.buildNormalizedTerm(main.scala:203)
	at coop.rchain.node.Main$.main(main.scala:122)
	at coop.rchain.node.Main.main(main.scala)
---- tut-hello.rho ---
Syntax Error, trying to recover and continue parse... for input symbol "" spanning from unknown:5/13(105) to unknown:5/14(106)
Exception in thread "main" java.lang.Exception: Unrecoverable Syntax Error
	at coop.rchain.rholang.syntax.rholang_mercury.parser.unrecovered_syntax_error(parser.java:744)
	at java_cup.runtime.lr_parser.parse(lr_parser.java:731)
	at coop.rchain.rholang.syntax.rholang_mercury.parser.pProc(parser.java:731)
	at coop.rchain.node.Main$.buildAST(main.scala:213)
	at coop.rchain.node.Main$.buildNormalizedTerm(main.scala:203)
	at coop.rchain.node.Main$.main(main.scala:122)
	at coop.rchain.node.Main.main(main.scala)
---- tut-iterate.rho ---
Syntax Error, trying to recover and continue parse... for input symbol "" spanning from unknown:4/20(113) to unknown:4/21(114)
Exception in thread "main" java.lang.Exception: Unrecoverable Syntax Error
	at coop.rchain.rholang.syntax.rholang_mercury.parser.unrecovered_syntax_error(parser.java:744)
	at java_cup.runtime.lr_parser.parse(lr_parser.java:731)
	at coop.rchain.rholang.syntax.rholang_mercury.parser.pProc(parser.java:731)
	at coop.rchain.node.Main$.buildAST(main.scala:213)
	at coop.rchain.node.Main$.buildNormalizedTerm(main.scala:203)
	at coop.rchain.node.Main$.main(main.scala:122)
	at coop.rchain.node.Main.main(main.scala)
---- tut-make-cell.rho ---
Syntax Error, trying to recover and continue parse... for input symbol "" spanning from unknown:5/17(153) to unknown:5/18(154)
Exception in thread "main" java.lang.Exception: Unrecoverable Syntax Error
	at coop.rchain.rholang.syntax.rholang_mercury.parser.unrecovered_syntax_error(parser.java:744)
	at java_cup.runtime.lr_parser.parse(lr_parser.java:731)
	at coop.rchain.rholang.syntax.rholang_mercury.parser.pProc(parser.java:731)
	at coop.rchain.node.Main$.buildAST(main.scala:213)
	at coop.rchain.node.Main$.buildNormalizedTerm(main.scala:203)
	at coop.rchain.node.Main$.main(main.scala:122)
	at coop.rchain.node.Main.main(main.scala)
---- tut-philosophers.rho ---
Syntax Error, trying to recover and continue parse... for input symbol "" spanning from unknown:2/10(45) to unknown:2/11(46)
Exception in thread "main" java.lang.Exception: Unrecoverable Syntax Error
	at coop.rchain.rholang.syntax.rholang_mercury.parser.unrecovered_syntax_error(parser.java:744)
	at java_cup.runtime.lr_parser.parse(lr_parser.java:731)
	at coop.rchain.rholang.syntax.rholang_mercury.parser.pProc(parser.java:731)
	at coop.rchain.node.Main$.buildAST(main.scala:213)
	at coop.rchain.node.Main$.buildNormalizedTerm(main.scala:203)
	at coop.rchain.node.Main$.main(main.scala:122)
	at coop.rchain.node.Main.main(main.scala)
➜  examples git:(dev) ✗
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment