Alef (Plan 9)

Implementation of programming language Alef

Alef implementation for Plan 9 OS. Was included in first (1992) and second (1995) editions of the OS.

Examples:

Hello, World!:

Example for versions Alef (Plan 9, edition 2)

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);
}