Process J - A Concurrent Language

Hello World in ProcessJ


← Previous (Index) Hello World in ProcessJ Next (Going Parallel) →

As customs prescribe, the first program should be Hello World. This is how Hello World looks in ProcessJ:

import std.io;

public proc void main(string args[]) {
  println("Hello World!");
}
Hello World in ProcessJ (HelloWorld.pj)

The first time import std.io imports the library that allows us to call the println statement in the main procedure. All ProcessJ programs need a main procedure to run. This main procedure should have the modifier public and it should take in on argument that is an array of strings. Note, in Java, the string data type is capitalized (String), it is not in ProcessJ. Any procedure in ProcessJ can have a number of modifiers (or none, in which case the procedure is assumned to be public. In Java it is assumed to have the default access modifier, but we do not have that in ProcessJ). After the modifiers the keyword proc indicated that we are defining a procedure. All procedures must declare a return value type, or void if it does not return a value. Like in Java, the parameter list is a comma-separated list of type and name pairs.


← Previous (Index) Hello World in ProcessJ Next (Going Parallel) →