One of the more difficult aspects of coding stencils or other neighbourhood-based operations is working out what should happen at the edge of the grid. Parallel array languages such as ZPL have expended significant effort to provide mechanism to make coding edge effects easier. PM handles edge effects by making use of optional data types - containers that can hold either a value ( e.g. : an integer) or null . Optional types have many uses, including the representation of unbounded data structures in a pointerless language. A number of operators are defined for optional types, most usefully |. x|y returns the value contained in x if that value is not null . Otherwise y is returned. Binary communicating operators (x@[ neighbourhood ] or x@{ neighbourhood }) always return optionally-typed values, with off-edge cells set to null . Combined with the | operator, this makes dealing with edge-effects straightforward. The following code fragment demonstrates how PM hand...
This blog will cover the development of the PM Programming Language. This is a new language designed to simplify the coding of numerical models on parallel systems of all kinds. Project details may be found at: www.pm-lang.org