Logo

dev-resources.site

for different kinds of informations.

Hello World with Ada

Published at
5/10/2022
Categories
ada
Author
youssouf
Categories
1 categories in total
ada
open
Author
8 person written this
youssouf
open
Hello World with Ada

Hi, i want to share with you basic about programming using Ada2012.

What is it Ada ?

Ada is a state-of-the art programming language that development teams worldwide are using for critical software: from microkernels and small-footprint, real-time embedded systems to large-scale enterprise applications, and everything in between

*Why use Ada? *

In short, because you want to write reliable and efficient code, with confidence that it works, and not waste time and effort in the process. Ada is unique among languages in how it helps you detect and eliminate bugs early in the software life cycle, when they are least expensive to correct. And as evidenced by the many successfully fielded applications that need to meet hard time or space constraints, Ada helps you build software that is reliable, safe and secure without sacrificing performance.

At the technical level, Ada has everything you might expect in a modern language:

  • Extensive compile-time and run-time checks

  • Full Object Oriented Programming support

  • Concurrent programming features, including support for multicore

  • Generic templates

  • Encapsulation

  • Hierarchical program composition / programming-in-the-large

for more information about the language visit:

Here is a simple program Hello world

A program in Ada2012 has an extension .adb (stands for ada body)

Image description

Let break it down

with Ada.Text_IO is an instruction just like import, include or from in other programming languages. It tells to the compiler to import the package Ada Text Input Output but not use it. And this package contains procedures to display text.

procedure in Ada is a function that return nothing. a procedure declaration always starts with the keyword procedure followed by the name of your choice in my case 'main' after we have is and then close using end plus the name of your choice (main). An instruction in ada always end up with semi colons.

Between procedure and end we have another keyword 'begin'.

Between procedure we have the declarative region. This is the part where you can declare your local variables. Instructions 'use Ada.Text_IO;' set visible package Text_IO.

Between begin and end we can write instructions that need to be executed by the program. In our case we only want to print in the console 'Hello World !'.

Image description

To execute our program localy we need to install GNAT compiler provided by AdaCore. This software is available here for windows, Linux and Mac users.

That's it and i hope you enjoyed this short tutorial. Leave your comment down here i will be glad to answer you

ada Article's
24 articles in total
Favicon
As 10 Linguagens de Programação mais velozes do mundo
Favicon
What is a Web Accessibility Solution, and how does it Work?
Favicon
Impacto Social da Tecnologia à Ética: O Legado de Ada Lovelace
Favicon
Ada Lovelace e a Inteligência Artificial: A Visão Pioneira Que Inspira a Inovação Tecnológica
Favicon
adssssssssssssss
Favicon
Exploring the Benefits of Working with ADA Compliance Experts
Favicon
The Fascinating History and Potential of Cardano's ADA Blockchain
Favicon
How to use the Azure OpenAI Embedding model to find the most relevant documents
Favicon
Getting started with Gtk and Ada in 2023
Favicon
Digital Accessibility 101: The importance of Digital Accessibility
Favicon
Embedded Systems Weekly #104
Favicon
Hello World with Ada
Favicon
100 Languages Speedrun: Episode 09: Ada
Favicon
XDC vs ADA | Who leads where?
Favicon
What Do Exotic Programming Languages and Single-origin Coffee Beans Have in Common?
Favicon
Generics systems
Favicon
Reasons for loving Ada: Type invariants (because bugs shouldn't sleep...)
Favicon
Come work on what matters, so you matter too.
Favicon
My first experience with SPARK-Ada
Favicon
Reasons for loving Ada. #1: strong typing
Favicon
Proving the correctness of a binary search procedure with SPARK/Ada
Favicon
Safer set-uid programs in Ada with the suid-helper library
Favicon
Watchdoging in Ada
Favicon
Accessible components: Alerts

Featured ones: