This article was first published on RChain Cooperative - Medium
There is a long-standing tradition in programming that your first program should say “Hello World”. Here’s the simplest rholang code to put that text on the screen.
Make the program print “Rholang rocks!” instead of “Hello World”.
WTH is stdout?
The heart of rholang is communicating on channels. Channels are communication lines that you use to send and receive messages. To send a message on a channel, you use the ! character.
We created the channel stdout on the first line of the program with new stdout. You'll create lots of channels as you learn rholang. We also gave our channel a special power by including (rho:io:stdout). More on that later, but for now just know that you need that part in parentheses to make text actually appear on the screen.
Using other channels
You can actually send messages on lots of channels, not just stdout. But unlike stdout they won't display on the screen because we won't add any special powers to them.
So where do the other channels go then? Nowhere! Not yet anyway. The messages just sit there waiting for someone (or some process) to receive them....
To keep reading, please go to the original article at:
RChain Cooperative - Medium