OEP

145

Title

Implicit SEQ

Summary

Make multiple processes implicitly sequential where possible.

Owner

Adam Sampson <ats@offog.org>

Status

Proposed

Date-Proposed

2005-09-28

Keywords

language seq par

One of the most common errors made by beginner occam-pi programmers is forgetting to put SEQs around sets of sequential actions. A quick, unscientific analysis of all the occam-pi code I could find on my machine showed that SEQ is the second most common type of process (assignment is the first), and occurs ten times more often than PAR. Given these two facts, it would be worth considering making SEQ optional where doing so would not introduce ambiguity -- that is, making most statements capable of taking multiple processes which will be executed in sequence. For example:

IF
  condition
    output ("Hello, ")
    output ("world.*n")
  condition.2
    PAR
      output ("Goodbye, world.*n")
      free.world ()

A strong argument against this proposal is that occam has historically attempted to make sequential and parallel code as orthogonal as possible; the syntax for writing parallel code should mirror that of sequential code. Making SEQ implicit would also require retaining SEQ for use with replicators.

OEP/145 (last edited 2007-09-27 01:14:59 by ats1)