Language Concepts
BETA is a modern object-oriented language from the Scandinavian
school of object-orientation where the first object-oriented
language Simula was developed. BETA supports the object-oriented
perspective on programming and contains comprehensive
facilities for procedural and functional programming.
BETA has powerful abstraction mechanisms for supporting
identification of objects, classification and composition.
BETA is a strongly typed language like Simula, Eiffel
and C++ with most type checking being carried out at compile-time.
It is well known that it is not possible to obtain all
type checking at compile time without sacrificing the
expressiveness of the language. BETA has an optimum balance
between compile-time type checking and run-time type checking.
Powerful Abstraction Mechanisms
BETA has powerful abstraction mechanisms that provide
excellent support for design and implementation, including
data definition for persistent data. The powerful abstraction
mechanisms greatly enhance reusability of designs and
implementations.
The pattern
The abstraction mechanisms include class, procedure,
function, coroutine, process, exception and many more,
all unified into the ultimate abstraction mechanism:
the pattern. In addition to the pattern, BETA has subpattern,
virtual pattern and pattern variable. This unification
gives a uniform treatment of abstraction mechanisms
and a number of new ones. Most object-oriented languages
have classes, subclasses and virtual procedures, and
some have procedure variables. Since a pattern is a
generalization of abstraction mechanisms like class,
procedure, function, etc., the notions of subpattern,
virtual pattern and pattern variable also apply to these
abstraction mechanisms. In addition to the above mentioned
abstraction mechanisms, the pattern subsumes notions
such as generic package and task type as known from
Ada.
Coroutines and concurrency
BETA does not only allow for passive objects as in C++
and Eiffel. BETA objects may also act as coroutines,
making it possible to model alternating sequential processes
and quasi-parallel processes. BETA coroutines may be
executed concurrent (non pre-emptive scheduling in current
implementation). The basic mechanism for synchronization
is semaphores, but high-level abstractions for synchronization
and communication, hiding all details about semaphores,
are easy to implement, and the standard library includes
monitors, and rendezvous. The user may easily define
new concurrency abstractions including schedulers for
processes.
Subpattern
The subpattern covers subclasses as in most other object-oriented
languages. In addition, procedures may be organized
in a subprocedure hierarchy in the same way as classes
may be organized in a subclass hierarchy. Since patterns
may also be used to describe functions, coroutines,
concurrent processes, and exceptions, these may also
be organized in a pattern hierarchy.
Virtual pattern
The notion of virtual pattern covers virtual procedures
as in C++. In addition, virtual patterns cover virtual
classes, virtual coroutines, virtual concurrent processes,
and virtual exceptions. Virtual classes provide a more
general alternative to generic classes as in Eiffel
or templates as in C++.
Pattern variable
BETA includes the notion of pattern variable. This implies
that patterns are first class values, that may be passed
around as parameters to other patterns. By using pattern
variables instead of virtual patterns, it is possible
dynamically to change the behavior of an object after
its generation. Pattern variables cover procedure variables
(i.e. a variable that may be assigned different procedures).
Since patterns may be used as classes, it is also possible
to have variables that can be assigned classes, etc.
BETA supports the three main subfunctions of abstraction:
identification, classification, and composition as described
in the following.
|