The return of Ada

The following are programs written in Ada, C and Java that print to the screen the phrase "Hello World." Gary Matoso, of AdaCore, provided the following Ada copy.







ADA PROGRAMMING LANGUAGE



with Ada.Text_IO;



procedure Hello_World is



begin



Ada.Text_IO.Put_Line ("Hello World>br>

from Ada");



end Hello_World;







C PROGRAMMING LANGUAGE



#include < stdio.h="">



void main()



{

printf("

Hello World

");



}





JAVA PROGRAMMING LANGUAGE



class helloworldjavaprogram



{



public static void main(String args[])



{



System.out.println("Hello World!");



}



}

Last fall, contractor Lockheed Martin delivered an update to the Federal Aviation Administration's next-generation flight data air traffic control system ' ahead of schedule and under budget, which is something you don't often hear about in government circles.The project, dubbed the En Route Automation Modernization System (ERAM), involved writing more than 1.2 million lines of code and had been labeled by the Government Accountability Office as a high-risk effort. GAO worried that many bugs in the program would appear, which would delay operations and drive up development costs.Although the project's success can be attributed to a lot of factors, Jeff O'Leary, an FAA software development and acquisition manager who oversaw ERAM, attributed at least part of it to the use of the Ada programming language.About half the code in the system is Ada, O'Leary said, and it provided a controlled environment that allowed programmers to develop secure, solid code.Today, when most people refer to Ada, it's usually as a cautionary tale. The Defense Department commissioned the programming language in the late 1970s.The idea was that mandating its use across all the services would stem the proliferation of many programming languages and even a greater number of dialects. Despite the mandate, few programmers used Ada, and the mandate was dropped in 1997. Developers and engineers claimed it was difficult to use.Military developers stuck with the venerable C programming language they knew well, or they moved to the up-and-coming C++. A few years later, Java took hold, as did Web application languages such as JavaScript.However, Ada never vanished completely. In fact, in certain communities, notably aviation software, it has remained the programming language of choice.'It's interesting that people think that Ada has gone away. In this industry, there is a technology du jour. And people assume things disappear.But especially in the Defense Department, nothing ever disappears,' said Robert Dewar, president of AdaCore and a professor emeritus of computer science at New York University.Dewar has been working with Ada since 1980.Last fall, the faithful gathered at the annual SIGAda 2007 conference in Fairfax, Va., where O'Leary and others spoke about Ada's promise.This decades-old language can solve a few of today's most pressing problems ' most notably security and reliability.'We're seeing a resurgence of interest,' Dewar said. 'I think people are beginning to realize that C++ is not the world's best choice for critical code.'ERAM is the latest component in a multi-decade plan to upgrade the country's air traffic control system. Not surprisingly, the system had some pretty stringent development requirements, O'Leary said.The system could never lose data. It had to be fault-tolerant. It had to be easily upgraded. It had to allow for continuous monitoring. Programs had to be able to recover from a crash. And the code that runs the system must 'be provably and test-ably free' of errors, O'Leary said.And such testing should reveal when errors occur and when the correct procedures fail to occur. 'If I get packet 218, but not 217, it would request 217 again,' he said.Ada can offer assistance to programmers with many of these tasks, even if it does require more work on the part of the programmer.'The thing people have always said about Ada is that it is hard to get a program by the compiler, but once you did, it would always work,' Dewar said. 'The compiler is checking a lot of stuff. Unlike a C program, where the C compiler will accept pretty much anything and then you have to fight off the bugs in the debugger, many of the problems in Ada are found by the compiler.'That stringency causes more work for programmers, but it will also make the code more secure, Ada enthusiasts say.When DOD commissioned the language in 1977 from the French Bull Co., it required that it have lots of checks to ensure the code did what the programmer intended, and nothing more or less.For instance, unlike many modern languages and even traditional ones such as C and C++, Ada has a feature called strong typing. This means that for every variable a programmer declares, he or she must also specify a range of all possible inputs. If the range entered is 1- 100, for instance, and the number 102 is entered, then the program won't accept that data.This ensures that a malicious hacker can't enter a long string of characters as part of a buffer overflow attack or that a wrong value won't later crash the program.Ada allows developers to prove security properties about programs. For instance, a programmer might want to prove that a variable is not altered while it is being used through the program. Ada is also friendly to static analysis tools. Static analysis looks at the program flow to ensure odd things aren't taking place ' such as making sure the program always calls a certain function with the same number of arguments. 'There is nothing in C that stops a program from doing that,' Dewar said. 'In Ada, it is impossible.'