Alef (Plan 9, edition 2)

Version of implementation Alef (Plan 9) of programming language Alef

Version of Alef compiler included in second edition of Plan 9 (1995).

Examples:

Hello, World! - Alef (385):

This example illustrates the usage of channels and processes. The main process creates a channel which transmits string addresses. After this it starts a child process with channel argument, feeds message address to the channel and terminates. The second process waits for the message, prints it and terminates as well.

#include	<alef.h>

void
receive(chan(byte*) c)
{
	byte *s;
	s = <-c;
	print("%s\n", s);
	terminate(nil);
}

void
main(void)
{
	chan(byte*) c;
	alloc c;
	proc receive(c);
	c <-= "Hello, World!";
	terminate(nil);
}