/r/ada

Photograph via snooOG

Pointers to news, articles, and other items of interest about the Ada programming language.


Pointers to news, articles, and other items of interest about the Ada programming language.


If a submission doesn't show up, please message the moderators to drag it out of the spam queue. We don't want to miss anything!


Want to learn about Ada? Some suggestions:


Thanks! -- The /r/ada moderators

/r/ada

8,858 Subscribers

9

Best IDE for Ada

Hi! I'm just learning Ada and I installed IntelliJ IDEA with a plugin to make it work with Ada (after installing Alire). The problem is that I had to install a IntelliJ IDEA 2019 version due to the fact that the plugin maintenance was discontinued.
I saw that lot of people suggest Visual Studio, but some friend of mine for some reason don't like it so I'm skeptical.

What's the best option in you opinion? Thank you in advance for you answers

10 Comments
2024/11/09
09:10 UTC

8

Adacore Libadalang

If anyone is using libadalang, I've been unsuccessfully trying to find a way to recursively analyze record types. In other words, from a record definition that has records within it, to go to those record definitions, etc. The problem is that from a record def one can use F_Components to get a Component_List, and from that get component types and declarations, but it seems like there is no way to get to another record_def on a record type. At least I haven't been able to find it. Any help would be appreciated.

1 Comment
2024/11/08
13:49 UTC

10

Recent interest from industry

For those in the Ada industry, has there been an increase in interest in Ada given the pressure from the DoD and US government as a whole to use memory-safe languages?

7 Comments
2024/11/05
23:07 UTC

14

Ada Developer Room at FOSDEM 2025 - deadline Sat 30 Nov 2024

www.cs.kuleuven.be/~dirk/ada-belgium/events/25/250202-fosdem.html

The 12th Ada Developer Room will take place on Sunday morning 2 February 2025. As before it is organized in cooperation with Ada-Belgium and Ada-Europe. The Call for Presentations is now open: deadline is Saturday 30 November 2024.

Do you have a talk you want to give?
Do you have a project you would like to present?
Would you like to get more people involved with your project?
Would you like to share some knowledge and lessons about Ada?

We're inviting proposals related to Ada software development that include a technical oriented discussion. You're not limited to slide presentations. Be creative. Propose something fun to share with people so they might feel some of your enthusiasm for Ada!

Speaking slots are around 20 or 50 minutes, plus 5 or 10 min. Q&A resp. Please provide a title, preferred length, plus an abstract and a short bio similar in style as on the program for previous Ada DevRooms, see www.cs.kuleuven.be/\~dirk/ada-belgium/events/20/200201-fosdem.html and archive.fosdem.org/2022/schedule/track/ada/ for the last in-person and online edition, resp.

Please submit proposals ASAP, and definitely by November 30, 2024. More information is on the Ada-Belgium web-site (see URL above).

We're looking forward to your proposals!

#AdaFOSDEM #AdaDevRoom #AdaProgramming #AdaBelgium #AdaEurope #FOSDEM2025

0 Comments
2024/11/02
15:22 UTC

13

November 2024 What Are You Working On?

Welcome to the monthly r/ada What Are You Working On? post.

Share here what you've worked on during the last month. Anything goes: concepts, change logs, articles, videos, code, commercial products, etc, so long as it's related to Ada. From snippets to theses, from text to video, feel free to let us know what you've done or have ongoing.

Please stay on topic of course--items not related to the Ada programming language will be deleted on sight!

Previous "What Are You Working On" Posts

14 Comments
2024/11/01
00:01 UTC

18

Looking for a Project to Fund or an RFP for a new one

Hello everyone,

I’m sure you’ve seen me around here, learning, asking noob questions, and trying not to be wrong when commenting. You know…. Reddit stuff. I’ve learned a lot of Ada. Deployed some code. Used it when it was ”Had to work”. Wrote a totally unnecessary HAL for a board with an SVD that I didn’t use. Learned to bit bang. Still the vast ocean in front of me appears to be eternally vast. Maybe that’s why I’m still interested.

Well, I made a post not long ago expressing frustration about GPL licenses, AdaCore and small businesses. Turns out, I was just wrong. AdaCore provides most everything a small business (or large business) could need, free of charge. You pay for help and certifications. Everything else is kinda… there. The big response from the community was “find a project and fund that, instead of paying for an AdaCore license you don’t need.” Fair enough. I looked through a bunch projects and I found a lot of work that was finished, perpetual progress, or early ideas.

I want to fund an innovation and something that will genuinely bring people to Ada from C++, Rust, and whatever’s niche this week. I’d like to submit to r/Ada an RFP, a Request for Proposal (but not like real full up proposals).

What idea do you have that you’d like funded? What’s you plan for it? Do you plan to monetize or make it free? Do you have a solid project that you think I didn’t see?

Full disclosure: I own a business that provides Venture Capital and contracts Sweat Equity to small businesses in exchange for opportunity of ROI, be it equity, percentage of profits, whatever works for everyone. This isn’t related to that. This is more like “Who has a solid idea that’s Ada related that I can shove some money into supporting, profitable or not?” If you have a business that you’re trying to start and you need help, I’m interested in that and can help with funding, sales, engineers, attorneys, accountants, whatever. We have all that. Please DM me though so we don’t turn this into shark tank.

Exo

7 Comments
2024/10/31
03:05 UTC

2

Spark access type equality

Hi, I read that testing equality on access types, when neither value is syntactically null (literally written "null"), is not allowed ? I find it strange, what could be wrong with this ? Access values have more information than a memory zone's address, but they come down to this in practice, there is no ambiguity. Any idea ?

5 Comments
2024/10/30
01:29 UTC

6

If expression: else branch that defaults to True.

procedure Main is

FiveIsLessThanZero : Boolean;

begin

FiveIsLessThanZero := (if 5 < 0 then 0 > 5);

Put_Line (FiveIsLessThanZero'Image);

end Main;

And this code prints TRUE. I think that this is not okay... Why not just forbid an incomplete if expression? What do you guys think?

2 Comments
2024/10/29
16:25 UTC

23

Ada DevRoom at FOSDEM 2025

We are pleased to report there will be an Ada Developer Room at FOSDEM 2025, on 2 February 2025 in Brussels, Belgium. CfP will follow shortly. #AdaDevRoom #AdaFOSDEM #AdaProgramming

https://fosdem.org/2025/news/2024-10-28-devrooms-announced/

5 Comments
2024/10/29
09:34 UTC

4

How to get GNATcoll to work on Windows?

Can someone give me instructions on how to install GNATColl on windows? I am getting the error: file "gnatcoll.ads" not found.

This language is very frustrating to get setup with. No wonder it is dying. More friction means less people coming into the ecosystem.

18 Comments
2024/10/26
17:48 UTC

12

Is there any async library like boost Asio for Ada?

I wanna make a tcp server with Ada and was wondering if there was any good async libraries?

14 Comments
2024/10/25
22:14 UTC

11

What happens when you compile for an MCU without an RTS?

In the Inspirel guide, you can use folders Adalib and Adainclude along with a system.ads. Then specify RTS=.

When you do that, what happens? What’s available? Is it just taking what it needs from the base language? Can you use tasking?

4 Comments
2024/10/25
02:32 UTC

21

whats the impact in performance of ada sparlk over something like c, modern c++ and safe rust

hi i'm curios in your opinion or better,data.

do you use ada in performance constrained environments like micro controllers?, do you feel or mesure big lost i performance for using?, there is any good reference for squeezing performance whit ada?

have nice day.

PD: i can't change sparlk for SPARK in the title, if you can do it

12 Comments
2024/10/24
15:17 UTC

18

AEiC 2025 - Ada-Europe conference - 1st Call for Contributions

The 29th Ada-Europe International Conference on Reliable Software Technologies (AEiC 2025) will take place in Paris, France from 10 to 13 June.

The conference schedule comprises a journal track, an industrial track, a work-in-progress track, a vendor exhibition, parallel tutorials, and satellite workshops.

Deadlines: 20 January 2025 for journal track papers; 24 February 2025 for industrial track and work-in-progress track papers, and tutorial and workshop proposals.

More information is available on the conference site, including an extensive list of topics.

www.ada-europe.org/conference2025

Hashtags: #AEiC2025 #AdaEurope #AdaProgramming

6 Comments
2024/10/21
15:42 UTC

5

Added VHDL synthesis to Gentoo's overlay

Can't see why VHDL related stuff is not allowed here considering it's Ada adjacent.

If anyone on Gentoo is wanting to mess with Yosys and GHDL, I've added a pull request to the FPGA overlay

3 Comments
2024/10/21
14:21 UTC

12

[ANN] bbt 0.0.5

bbt 4 is a simple tool to “black box” check the behavior of an executable in command line mode (bbt stands for Black Box Tester) .

btt special feature is that it aims at directly using your behavior description, written in plain English, within a classical Gherkin Given / When / Then framework, as the test script.

Yes, there is a trick :-)
I let you guess (or read the doc), but, hint, there's no LLM behind!

Here is an example of a gcc test scenario (but I could say of behavior description) : bbt/docs/tests/examples/hello_word.md.
This file is the only input for btt.
No preprocessing, no scripting, no manual adjustment, bbt just “run the doc”.

Here is the Howto install, super easy.

Any feedback is welcomed!

Lionel

0 Comments
2024/10/20
21:12 UTC

34

[VIDEO] Ada For Game Developers: Using SDL (Setting Up)

2 Comments
2024/10/19
01:51 UTC

7

Can't understand a simulation algorithm

Hi,

I use the book "Software construction and data structure with ada 95" to learn algorithmics, but I have some autism/dyslexia and some things, English description of processes to be precise, I can't grasp no matter how many times I read them. Schemas are fine, I get them, where there are some, but not descriptions. I may not be a native English speaker but it would be the same in French imho...

Here's the description, it's pretty lengthy and I wouldn't know what to omit:

Here is the scenario:

A shopper arrives at the checkout area of the store at a certain time of day with a certain number of items in a shopping cart. The shopper finds the shortest line and joins it. For simplicity, we will assume that the shopper cannot see into other shoppers carts,and that therefore the choice offline is not influenced by how full or empty they are. Another simplifying assumption is that the path to the checkout area is narrow and therefore two shoppers cannot enter it at the same instant.
We also assume that no shopper gets tired of waiting and abandons a cart, leaving the store without checking out. We will represent the time of day as an integer representing the number of time units since the store opened that day,and will assume that each item requires an average of one time unit to ring up and put in a bag. We define average checkout time as the sum of the length of time a shopper waits in line and the length of time taken to check out all his or her items. The goal of the simulation is to find, for a given store opening period, and a given group of shoppers and cart loads, the average checkout time as a function of the number of open lines.
To set up the simulation, we provide a set of FIFO queues, each representing one checkout line in the market. We define departure time as the time when a customer reaches the front of his or her queue, departs from that queue, and begins to be checked out by the cashier. Thus, the first customer in line is waiting to be served; the customer being served is thought of as having left the queue. If this seems unrealistic,consider the queueing system in use in many banks, post offices, and airports, where a single queue is processed by many servers. In such a system, the customer leaves the queue to be processed by the next available server.
How will our simulation program operate? In a real supermarket, all the people are independent processes needing no external control; in a program, we need a control mechanism. This kind of simulation, in which there are a number of queues all moving at different rates, can be controlled by means of an event list, and is called an event-dri ven simulation. There is no direct supermarket analogy to the event list; it is a special queue con taining scheduled arrival and departure events. The event list is not FIFO; the events must be ordered by time. We therefore use a priority queue for the event list; the item with the earliest time is processed with the highest priority.
When an arriving shopper record is read from a file, mi arrival event is placed on the event list(sorted by time because there may be departure events already scheduled). When the arrival record reaches the front of the event list, it is removed and joins the shortest checkout queue. If it is the only customer in the queue, it can be served immediately; its arrival and departure times are the same and a departure event, indicating the scheduled departure time and queue number,is placed on the event list. At this point, another arrival record is read from the file to replace the one just removed from the event list.
When a departure event reaches the front of the event list, we remove the first node from the corresponding queue,say queue k. We know its arrival time, its time of departure from the queue, and the time required to process all its purchased items, so we can compute its checkout time and add it to a grand total from which we can, at the end of the simulation,compute the average service time. We can also compute the scheduled departure time for the next customer in queue k: Because the next customer begins to be served just as the previous customer finishes, the next customer's departure time is the sum of the current customer's departure time and that customer's processing time. Having computed the scheduled departure time for the customer at the front of queue k(the customer waiting to be served), we place the associated departure event on the event list.

I don't understand what processing either the event list or the four queues do. I don't understand how the checkout time is calculated at all, and how the size of the waiting queues impacts it. It all reads as gibberish to me...

5 Comments
2024/10/18
23:53 UTC

1

For loop to recursion

I have this function that checks if my type Tuple, which is an Array of Integers, is less than another Tuple. I managed to solve this using a for-loop, but I think it could be done with recursion. However, I do not see how.

    function "<"(L, R: in Tuple) return Boolean is
    begin
        for I in reverse L'First .. L'Last loop
            if L(I) < R(I) then
                return true;
            end if;

            if L(I) /= R(I) then
                return false;
            end if;
        end loop;
        return false;
    end "<";

Note that the loop goes in reverse. Two 3-sized tuples that are compared should first check index 3, then 2, then 1 (if needed). Any ideas? I think the reverse part stumbles me.

Edit: Solved, see comment.

6 Comments
2024/10/15
13:28 UTC

10

How would I do this without running into a problem?

https://preview.redd.it/8yk3i2a27wud1.png?width=769&format=png&auto=webp&s=73dde0b7701ab227e5c0f41b40f550409c1aa8c7

The UEFI specification says that "Output_String" defined in EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL has it's first argument being a pointer to the protocol, but the protocol also has the function defined inside of it... so how would I go about making this work? If there's a better way to do it I'd be really up to taking it.

5 Comments
2024/10/15
09:55 UTC

7

GprBuild "Library_Symbol_File"

I am trying to restrict the symbols in my dynamic library but an .ads file isn't working.

Here is my gprbuild file:

project Vst3 is
for Library_Symbol_Policy use "restricted";

for Library_Standalone use "encapsulated";

for Library_Interface use ("Vst3_Entry");

for Library_Auto_Init use "true";

for Library_Src_Dir use "entry";

for Library_Name use "test";

for Library_Dir use "lib";

for Library_Kind use "dynamic";

for Source_Dirs use ("src");

for Object_Dir use "obj";

for Library_Symbol_File use "vst3_entry.ads";

end Vst3;

Can anyone enlighten me on the usage of this option?

3 Comments
2024/10/13
19:51 UTC

14

[ANN] Release of UXStrings 0.8.1

This Ada library provides utilities for Unicode character strings of dynamic length.

It is now available on Alire in version 0.8.1.

Change:

So far in UXStrings, its API are similar to those of the strings Ada standard libraries. If you find some missing, make your proposals on Github.

The library provides four different implementations selectable with GPR options UXS1, UXS2, USX3 and UXS4. The performance of each of them is described here.

NB: UXS4 is now the default implementation.

0 Comments
2024/10/13
08:45 UTC

9

gnatpp (pretty printer) gone ?

Hi,

Gnat mentions the utility program gnatpp, which formats the source files depending on the switches. What does gnatstudio but in commandline. I can't find gnatpp anywhere, nor on my debian repo, nor on alire's latest native gnat.

Does it stll exist ? I have a bunch of other utilities mentioned on the site, but not this one.

5 Comments
2024/10/09
21:32 UTC

26

AdaCore Memories: the stories behind the first 30 years of AdaCore

https://blog.adacore.com/adacore-memories-the-stories-behind-the-first-30-years-of-adacore

Congratulations on the first 30 years!

I was lucky to have experienced much from quite close. The "speed" of Ada/Ed as an early user. ;-). The first bootstrap of GNAT announced by Robert Dewar at the 1993 Ada-Europe conference in Paris. The founding of ACT Europe first announced at the 1995 Ada-Belgium Seminar in Leuven. The various Gilbert&Sullivan operettas featuring Ada Lovelace at SIGAda and Ada-Europe conferences. Especially nice to read the reference to Eurocontrol at the end of the article!

8 Comments
2024/10/09
06:07 UTC

8

quadratic algorithm appears linear in execution time ?

Hi,

I study algorithmics with a book using Ada 95, but it's slightly dated, in terms of the power PCs could be expected to have back then.

As requested, I plotted the execution time of

```

FOR Cycle IN 1 .. NumberOfCycles LOOP
maxindex := maxindex + 1;
CPUClock.ResetCPUTime;
declare
A : ARRAY (1 .. Maxindex, 1 .. Maxindex) OF Integer;
use Ada.Float_Text_IO;
begin
FOR Row IN 1 .. Maxindex LOOP
FOR Col IN 1 .. Maxindex LOOP
A (Row, Col) := Row * Col;
END LOOP;
END LOOP;

TrialTime := CPUClock.CPUTime;
Put (maxindex'Image);
Put (TrialTime, Fore => 2, Aft => 7, Exp => 0);
new_line;
end;
END LOOP;
```

CPUclock just uses Ada.Calendar.Clock to give a timer.
It gives me a data set, which I plotted, and it looks very linear. Are there some foul optimizations at play here, or is it that CPUs are so powerful now that memory overflows before that kind of simple loops get to look quadratic ?

12 Comments
2024/10/07
13:10 UTC

19

Good open source Ada projects to look at?

Im in the process of learning Ada I’ve been playing around with the language for a little while but I learn the best by reading code and big projects. However I’m finding a hard time finding some big open source projects online. Could someone give me some good open source projects in Ada to see some good code?

5 Comments
2024/10/06
23:26 UTC

19

October 2024 What Are You Working On?

Welcome to the monthly r/ada What Are You Working On? post.

Share here what you've worked on during the last month. Anything goes: concepts, change logs, articles, videos, code, commercial products, etc, so long as it's related to Ada. From snippets to theses, from text to video, feel free to let us know what you've done or have ongoing.

Please stay on topic of course--items not related to the Ada programming language will be deleted on sight!

Previous "What Are You Working On" Posts

14 Comments
2024/10/01
00:02 UTC

12

code from Software Construction and Data Structures with Ada 95

Hi, I needed a course on algorithmics with Ada, and this is the only one that I know.
But given its age, I can't find the source code anywhere. The sites to find it were:

ftp://ftp.aw.com/cseng/authors/feldman/cs2-ada

ftp://ftp.gwu.edu/pub/ada/courses

http://www.aw.com/cseng/authors/feldman/cs2-ada

and the filename was cs2code. Google says Adaic still has it but the site does not respond. If anyone has a clue, please share it because this book is very good and thorough, a real course, even including assertions and post/preconditions. But copying from a non-curated pdf is horrible.

Thank you.

16 Comments
2024/09/29
12:15 UTC

16

renamed predefined unit is an obsolescent feature

I've been using an old open-source Ada program called Whitaker's Words. Its author is dead, and the person who set up the github site seems to have lost interest in maintaining it. I went to the trouble of writing an Expect-style interface to it in another project of my own, so I feel a certain level of commitment to keeping it working. When I upgraded my debian-based system, the package went away, and when I tried to compile it from source, which had previously worked, I got this error message:

makeinfl.adb:23:06: warning: renamed predefined unit is an obsolescent feature (RM J.1) [-gnatwj]

I don't know anything about Ada, but after some googling I was able to fix this for the time being by changing the makefile to use the option -gnatwJ. However, it seems preferable to fix this in the source code. Is this something that would likely be hard to fix? I googled on the error message and didn't find much that would explain what this was.

Thanks in advance for any suggestions!

8 Comments
2024/09/27
12:31 UTC

Back To Top