The standard library is a set of declarations implicitly available to all Orc programs. In this section we give an informal description of the standard library, including the type of each declaration and a short explanation of its use.
Orc programs are expected to rely on the host language and environment for
all but the most essential sites. For example, in the Java implementation of
Orc, the entire Java standard library is available to Orc programs via
import class declarations. Therefore the Orc standard library aims only
to provide convenience for the most common Orc idioms, not the complete set of
features needed for general-purpose programming.
The documentation of library functions uses special notation for types
that have dot-accessible members.
Member names of an instance of
Type are written in the form
refers to the
get member of an object of type
The object type can include type parameters which are referenced by the member
type, so for example
@method channel[A].get() :: A means that
get method is called on a value of type
it will return a value of type
The Standard Library makes use of colored tags to quickly convey properties of library sites. The tags and their definitions are as follows:
Site Property Set
A call to this site will never block execution of an expression, since it is guaranteed to always immediately publish a value or halt.
Any call to this site is pure, meaning that it is deterministic, responds immediately, and has no side effects.
A call to a pure site may be textually replaced with its return value
(or replaced with
stop if the call halts) in any program context.
The site is idempotent; calling it more than once on the same arguments is equivalent to calling it once on those arguments.