Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼

Embedded Systems

Ada Enhances Embedded-systems Development

Developing an embedded system is hard work. Reliability is essential; indeed, embedded software may control a safety- or security-critical system where an error can have catastrophic consequences. New requirements will almost surely pop up, so the software must be maintain- able. Real-time constraints and memory limitations make time and space predictability and run-time performance important. Many embedded systems comprise activities that are performed concurrently, either with actual parallelism or through multiplexing on a single processor. And most deal at some point with hardware-specific details like interrupt handling and data layout.

To meet those demands, a programming language needs high-level features that support sound software engineering and provide the necessary generality, but without sacrificing run-time performance. Such a language must also provide low-level mechanisms that are more typically found in assembly language programming.

Ada was designed to satisfy these sometimes-conflicting requirements, and recent enhancements in the new Ada 2005 standard have improved it. Ada makes the embedded-system developer's job more manageable, and it can be a better development choice than C, C++ or Java.

Ada was designed from the start to promote reliability and maintainability, with features that emphasize readability over writability and that detect errors early. Many checks are performed by the compiler--for example, to ensure that the uses of a data object are consistent with its type. Errors that are not detectable at compile time--such as an out-of-bounds index (also known as buffer overrun)--are caught at run-time through compiler-generated checks. Those checks can often be eliminated automatically through compiler optimizations or, if the programmer has verified that they will not fail, manually through specific directives.

Ada's emphasis on readability and reliability is in contrast with the C family of languages, including C++. Java detects buffer overrun errors, but its weakly typed primitive type facility allows data misuse errors that would be caught in Ada. And unlike both Java and the C-based languages, Ada allows programmers to specify a constrained range for a scalar variable (for example, integers in the range 0 through 100), which aids both readability and reliability.

The evolution of programming languages has been accompanied by two major development approaches: procedural programming, in which a system's architecture is dictated by the kinds of processing that must be performed, and object-oriented programming, in which a system's architecture is dictated by the kinds of entities that must be processed and their relationships. Some embedded systems can be modeled through a procedural-programming ap- proach; others may best be captured through object orientation in order to facilitate enhancements and maintenance.

Ada, like C++, can be used for both procedural and object-oriented programming. C, by contrast, lacks object orientation, and purely procedural programming in Java is rather clumsy.

Concurrent programming is intrinsically more difficult than sequential programming. Testing is complicated, since there are many more possible control paths and since new sorts of errors can arise, such as race conditions, deadlock and accessing a data object while it is being modified.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.