You are on page 1of 2

25 Programming Languages for Real-Time Systems

The real-time and embedded systems market is huge and growing all the time. It has
been estimated that 100 times more processors are destined for embedded systems
rather than the desktop [Egg02]. Embedded real-time systems [Bur01]:
• are mainly small (for example, mobile phones) but can also be extremely large and
complex (for example air traffic control systems)
• have potentially complex mathematical models of their controlled environment
• must be dependable
• are inherently concurrent
• must interact within the time frame of the environment
• must interact with low-level mechanisms such as hardware devices and memory
management faculties.
The interdependence between functional and real-time semantics of real-time soft-
ware makes its design, implementation and maintenance especially difficult. Provid-
ing a programming language that directly supports the characteristics of embedded
real-time software can significantly ease these difficulties. In addition, embedded
software systems are not portable as they depend on the particular underlying operat-
ing system and hardware architecture. Providing implementation-independent pro-
gramming models also increases the portability.

25.1 Landscape

Rather than consider all possibly real-time programming languages, this section fo-
cuses mainly on three representatives groups of the landscape: C/C++ based lan-
guages, Ada and Real-Time Java (in particular the Real-Time Specification for Java).
Sequential languages such as C and C++ are not reviewed in their own right as (a)
their advantages and disadvantages are well known (see Barr [Bar99] for a full dis-
cussion) (b) they do not support the main characteristics of embedded real-time sys-
tems and consequently (c) their use requires direct interaction with the facilities of an
underlying operating system (which are considered in sections 21 and 22).
Ada represents the group of concurrent real-time programming languages that were
developed in late 1970s and early 1980s (including Pearl and CHILL). These have
been extended over the years to embrace object-oriented programming and to give
better support for real-time and distributed systems. Real-time Java represents the
current trend of supporting architectural neutral real-time systems potentially in an
open environment (and points to the direction that languages like C# might in future
take). Synchronous languages (such as Esterel, Signal or Lustre) and functional lan-
guages (such as Erlang) are not considered, as their use is either confined to a particu-
lar company (e.g. Ericsson and Erlang) or targeted at supporting only reactive systems
(e.g. Esterel).

Artist FP5 Consortium: Embedded Systems Design, LNCS 3436, 338 – 351, 2005.
© Springer-Verlag Berlin Heidelberg 2005
25.1 Landscape 339

Ada 95

The development of the Ada programming language forms a unique and, at times,
intriguing contribution to the history of computer languages. As all users of Ada must
know, the original language design was a result of competition between a number of
organizations, each of which attempted to give a complete language definition in
response to a series of requirements documents. This gave rise to Ada 83. Following
ten years of use, Ada was subject to a complete overhaul. Object-oriented program-
ming features were added (through type extensibility rather than via the usual class
model), better support for programming in the large was provided (via child pack-
ages) and the support for real-time and distributed programming was enhanced. The
resulting language, Ada 95, is defined by an international ISO standard.
An important aspect of the Ada 95 language is the model it presents for concurrent
programming. This model is both complex and wide ranging. It builds upon the origi-
nal Ada 83 language features for tasking but provides many additional facilities re-
quired to meet the challenges of modern systems development particularly in the
areas of real-time and embedded systems.
The Ada 95 definition has a core language design plus a number of domain-
specific annexes. A compiler need not support all the annexes but it must support the
core language. Most of the tasking features are contained in the core definition. But
many of the important features for real-time programming are to be found in Annex D.
A listing of the key language features of Ada (for real-time programming) would
contain: protected objects for efficient encapsulation of shared data and interrupt
handling, fixed priority scheduling integrated with a priority ceiling protocol, the
requeue statement that eliminates many sources of race condition in application code,
a monotonic clock with associated abstract data types for time with absolute and rela-
tive delay primitives, dynamic priorities and an asynchronous transfer of control ca-
pability that is integrated into the syntax of the core language. These features provide
an expressive environment for programming both hard real-time systems and flexible
applications [Ber01].
A complete technical description of the Ada language can be found at
http://www.adahome.com/.

Real-Time Java

Since its inception in the early 1990s, there is little doubt that Java has been a great
success. The Java environment provides attributes that make it a powerful platform to
develop embedded real-time applications. Since embedded systems normally have
limited memory, an advantage that some versions of Java (for instance J2ME) present
is the small size of both the Java runtime environment and the Java application pro-
grams. Dynamic loading of classes also facilitates the dynamic evolution of the appli-
cations. Additionally, the Java platform provides classes for building multithreaded
applications and automatic garbage collection; these make it an attractive environ-
ment to develop embedded real-time applications. Unfortunately, the problem with
garbage collection is that it introduces random pauses in the execution of applications.
Consequently, Java does not guarantee determinism nor bounded resource usage,
which are needed in embedded real-time systems.

You might also like