I’ve been a fan of Ada and SPARK for a while now, and really wished I had it available when I was programming full time. It’s been used in military and avionic applications where secure and safety critical code is the norm, and it’s slowly creeping into other areas that can use this type of power (e.g., self-driving cars).
Most programmers tend to discount Ada and SPARK, a provable subset of Ada, because of the many myths surrounding Ada. But using Ada and SPARK, and even learning it from scratch, can result in cost savings for projects because deadlines are met and the quality of the resulting code is high, leading to fewer bugs reaching the field.
Fostering Ada and SPARK use has been a challenge, but one that AdaCore has addressed for many years. I spoke recently with AdaCore Software Engineer Fabien Chouteau about the results of the company’s third annual Make with Ada competition and how it’s inspiring software developers around the world to take a serious look at Ada and SPARK both for the inherent benefits and ease of adoption.
More Articles About Ada and Spark
Fabien Chouteau, Software Engineer, AdaCore
This is the third year AdaCore has sponsored the Make with Ada competition. Why is AdaCore so passionate about promoting Ada and SPARK?
Everything we do at AdaCore is centered around building tools and providing services to help developers build safe, secure, and reliable software. At the core lies the Ada programming language.
Ada was designed from its inception to be used in applications where safety and security are of the utmost importance. Its feature set and programming paradigms, by design, allow software developers to develop applications more effectively and efficiently. It encourages a “think first, code later” principle that produces more readable, reliable, and maintainable software. Unlike most programming languages, Ada’s strong typing and compile-time checking help catch errors early, when they’re easiest and least expensive to correct.
The SPARK programming language is a formally verifiable subset of the Ada language that allows developers to mathematically prove program properties through static means. These properties include proper information flows, absence from runtime errors, and even full functional correctness.
This is accomplished by exploiting the strengths of the Ada syntax while eliminating the features of the language that introduce ambiguity and non-deterministic behavior. The language, combined with a verification toolset and a design methodology, facilitates the development and deployment of low-defect software for high-reliability applications. This provides a level of assurance with regard to code correctness that’s much higher than with a regular programming language.
AdaCore has over two decades of experience working in industries such as aerospace, defense, and railways. As the need for secure and reliable applications expands into other industries, such as automotive, medical, energy, and IoT, we hope to bring these time-tested technologies as well as our expertise and services to inspire a whole new generation of developers.
What is the Make with Ada competition?
The Make with Ada competition is part of an overall AdaCore initiative to foster the growth of Ada and SPARK for developing embedded systems and more generally for developing “software that matters.”
With this competition, we aim to show the world how the Ada and SPARK language technologies can significantly improve code quality for modern embedded systems without requiring a steep learning curve for developers unfamiliar with these languages.
This contest began on October 16, 2018 and closed on February 15, 2019. Contestants were tasked with designing and implementing an embedded software project where Ada and/or SPARK are the principal language technologies. Winners were announced on March 26.
How many submissions did you receive this year?
We had 32 submissions demonstrating that even with little to no experience in Ada, embedded-system developers can build complex, reliable software on inexpensive microcontrollers. We were particularly impressed by the degree of difficulty attempted by some contestants and the results achieved, both in terms of the documentation provided, as well as the hardware and software developed. Having so many high-quality submissions made picking just three winners extremely difficult!
What are the judging criteria?
Prizes were awarded to the projects that best met the overall criteria of software dependability, openness, collaborativeness, and inventiveness [outlined below]. Projects also needed to provide thorough documentation describing the entire development process.
- Open: Does the Project have a Free Software License, as defined by the Free Software Foundation or an open-source license, as defined by the Open Source Initiative? Does it have an open design? Does it use open tools, hardware, and platforms?
- Collaborative: Is the Project usable by other members of the programming community? Does it have clearly defined interfaces and documentation? Is it available in a public repository through a version control system such as svn or git? Does it have a bug tracking system? Can it be built with tools available to the community?
- Dependable: Does the Project make use of processes and technologies that provide high confidence that the software meets its requirements (for example, formal methods, contract-based programming, testing, and coding standards)? Is its documentation accurate?
- Inventive: Does the Project demonstrate out-of-the-box thinking, does it bring new solutions to an existing problem, or apply existing solutions to a novel problem?
Who were the winners?
This year, the first place prize of $5,000 was awarded to Guillermo Alberto Perez Guillen, a communications and electronics engineer from Mexico, for his PID Light Meter Controller (Fig. 1). The goal of the project was to develop a system to measure and control the amount of light that a lamp emits with a feedback loop and PID controller. The project used an STM32F407 Discovery Kit board to run the PID control software, written in Ada. The project report is outstanding and really worth a read.
1. The Make with Ada first place winner developed a PID Light Meter Controller.
The second place prize of $2,000, and the Student Prize (an Analog Discovery 2 Pro Bundle), went to Samira Peiris, an electrical and electronic engineering undergraduate from Sri Lanka. His project was an Ada Modbus Analyzer (Fig. 2). MODBUS is an open communication protocol for industrial electronic devices. The objective of the project was to create a lightweight, handheld MODBUS-RTU Master device that could easily be used in the field for data logging, troubleshooting, and configuring MODBUS enabled devices. This project is very complete, up to the 3D-printed enclosure for the device.
2. The second place project delivered a Modbus Analyzer written in Ada.
The third place prize of $1,000 was awarded to Angel Gonzalez and Adrian Martinez from Laboratorio Gluón in Spain for their Low-Cost ECG Pathology Detection with Deep Neural Networks project (Fig. 3). The goal was to create a cost-effective prototype device that can detect different heart pathologies. Ada and SPARK are gaining more and more momentum in the medical devices industry, so it’s very interesting to see a project like this submitted for Make with Ada.
3. The third place project was on Low-Cost ECG Pathology Detection with Deep Neural Networks.
Aside from the winning projects, were there any other submissions that stood out to you?
Once again, the Make with Ada contest elicited some very innovative projects. Besides the winning projects, I enjoyed Hedley Rainnie’s project video with a demo of the very cool “Ada theremin” instrument at the end—the agricultural robot has an interesting mix of mechanical, electrical, and software components—and all the little video games made by students from the EPITA are very fun.
From the start, we never imposed any subject for the Make with Ada competition. We want participants to work on projects that motivate them. I think it’s paying off with so much variety in the projects.
I participated as a judge of this competition last year. Who were the judges this year?
Our panel of judges was composed of an international group of embedded systems experts, each with decades of experience in the software industry. This year we had a mix of editors, previous MWAC winners, and one of our own senior software engineers, including:
- Jack Ganssle, Principal Consultant at The Ganssle Group
- Rich Nass, Executive Vice-President, Brand Director, Embedded and IoT Franchises, OpenSystems Media
- Jonas Attertun, Embedded Software Engineer and Winner of the 2017 Make with Ada competition
- Stéphane Carrez, Senior Software Engineer, Twinlife, and Winner of the 2016 Make with Ada competition, and
- Patrick Rogers, Senior Technical Staff, AdaCore
When will the next Make with Ada competition start?
The competition runs from October through February annually. Information about this year’s Make with Ada competition will be available during Q2 2019 at http://www.makewithada.org/.
In the meantime, we encourage everyone interested in learning more about Ada and SPARK to visit our new learning site: www.learn.adacore.com.