VHDL programmers, learn Ada !

Posted on September 12, 2021 in Hardware

I have been using VHDL for years. I have complained a lot about the rigidity of this language.

Then one day, I decided to learn Ada [1].

Ada is as rigid as VHDL. Of course, VHDL is based on Ada.
Even if there are big differences between the two languages [2], there are also big similarities.
The biggest of these is the goal to achieve: Minimizing bugs.
To reach this goal, there is of course the syntax which must be respected to the comma. But also, and above all, the use of strong typing.
When discussing VHDL, this is not emphasized. On the other hand, when discussing Ada, this concept is very much in the foreground. The use of basic types (Integer, Float, boolean...) is not forbidden but not recommended. The Ada community insists on the fact that we must declare our own types. This, in order to avoid assignment errors. A variable containing minutes should not be assigned to a variable containing kilometers. Also, minutes have no meaning beyond 59... Or not, it depends on the context.

Another concept learned with Ada is that the verbose syntax of the language is not a problem, quite the contrary.
One of the mantras of Ada is: "You write a program once, you read it over and over again".
So the speed of writing is not an issue. What is important is that the programs are as readable as possible.
The syntax of the language is designed with this in mind.

Also, the capitalization of keywords, variable names, functions, procedures... is not important. The goal is still to avoid programming errors. In many languages, the names Loopback and LoopBack can be used to designate different objects. Not in Ada. It is impossible to confuse the two because they refer to the same object.

All these concepts are applicable to VHDL.

Ada has a very extensive literature on all the concepts implemented in the language. The literature dealing with VHDL does not put enough emphasis on these same concepts. It only focuses on the use of the language for describing numerical systems, and this is a pity.

By learning Ada, I learned a programming language but also a philosophy.
This same philosophy is applicable to VHDL.

Every VHDL programmer should learn Ada in order to gain the philosophy and to be able to appreciate VHDL to the fullest.

[1]I was looking for a more safe language than C to write programs with fewer bugs (see here) .
[2]VHDL is used to describe digital hardware systems (usable with ASICs and FPGAs) while Ada is a programming language for microprocessors.

Translated with www.DeepL.com/Translator (free version)