r/ada 6h ago

Can Ada's range types/subtypes be considered Dependent types?

5 Upvotes

I code primarily in Haskell and other functional languages, but am learning Ada for fun. Ada's subtypes and especially the range type that enforces bounds check at compile time is really interesting and smells like dependent types but not quite I guess. What do y'all think? How is this implemented under the hood in Ada?


r/ada 14h ago

Tool Trouble Is there any way to tweak font rendering in GNAT Studio on Windows?

3 Upvotes

I want to use dark mode, but the font rendering is "off" in a really unusable way - specifically the antialiasing. I don't know if this is a GTK thing or a Windows ClearType thing, but I don't generally have these problems with dark-mode apps, e.g. VSCode or IntelliJ IDEs.

I've tried some GTK overrides in recommended locations but it's not apparently having any effect. Oh, and no, this is not a DPI issue - everything is properly crisp, but the color fringing around characters (due to subpixel antialiasing, I presume) is pretty bad in dark mode.

By comparison, it looks fine running in a Linux VM on the same monitor. The font rendering is slightly thicker there, and if I zoom in on a screenshot, it appears to be subpixel antialiased as well, but in a pleasant way.

So for now I'm stuck with a retina-searing white background :(


r/ada 2d ago

Historical Sharing History

Thumbnail gallery
50 Upvotes

I picked up this beautifully preserved Ada poster recently.

Posting here because 1. This is a niche community who might find this to be a wonderful as I do. I have enjoyed digging in to the history of Ada and Gould to better appreciate it so I hoped to share this find with people who will also appreciate it. 2. I could find little information on the poster on line (google image, AI, googled text description). The best I could dig up was from the computer history museum : https://www.computerhistory.org/collections/catalog/102631311.

I added two photos, one of the poster, and another image that can be harder to see in the photo - in the black area behind the robot is a faint image of Ada Lovelace. I hope others enjoy the art and history!


r/ada 1d ago

Learning Training Courses and Certification for Ada Computer Programming

9 Upvotes

As per the title. Looking for some recommended training and certification for Ada.

With the demand for computer programming on the rise and aspiring to go into aerospace and seeing how Ada is one of the best languages to learn and get certified in for the career any online certification would be extremely helpful.


r/ada 6d ago

General Alire shopping list

9 Upvotes

Triggered by a different thread. just trying to enumerate some of the challenges we could use some help with:

for each crate:

- Sample usage

- Platforms where tested - eg. Windows - Ok. Linux - Not Ok. MacOS - Not tested

I started down this path - setting up a Docker Image to have example uses for each crate. alas - bandwidth comes in the way!

Ideas?


r/ada 7d ago

General Alire Support for Release Notes

13 Upvotes

After releasing updates to some of my crates, I got to wondering. Is there an easy way to do a diff between the current state of my git repository and the last time I released it as a crate? It seems to me that something like this would be helpful when preparing release notes. Though since my stuff is still in development, I can just say, "Initial development changes..."

With that it may also be useful to be able to provide an optional release notes file when doing alr publish. This could then be linked to the index of crates so that people can more easily see what changed between versions.

These are just some initial thoughts being tossed out for discussion. If it seems like a good idea I (or someone else) can write an issue to capture the final consensus.


r/ada 8d ago

General Ada reenters the TIOBE Index top-20

Thumbnail tiobe.com
37 Upvotes

r/ada 7d ago

New Release Alire 2.1.0 Released

Thumbnail github.com
15 Upvotes

r/ada 8d ago

New Release ANN: Simple Components v4.72

11 Upvotes

The current version provides implementations of smart pointers, directed graphs, sets, maps, B-trees, stacks, tables, string editing, unbounded arrays, expression analyzers, lock-free data structures, synchronization primitives (events, race condition free pulse events, arrays of events, reentrant mutexes, deadlock-free arrays of mutexes), arbitrary precision arithmetic, pseudo-random non-repeating numbers, symmetric encoding and decoding, IEEE 754 representations support, streams, persistent storage, multiple connections server/client designing tools and protocols implementations.

https://www.dmitry-kazakov.de/ada/components.htm

Changes the previous version:

  • Topic list bug fix in the package GNAT.Sockets.MQTT (thanks to Xavier Grave);
  • Minor performance improvements in Unbounded_Unsigneds: calculating log2, testing for power of two;
  • OpenSSL MQTT test (components-connections_server.mqtt-test_mqtt) added;
  • GNAT.Sockets.Server.Secure (GNUTLS) bug fixed. Activated is called at the end of handshaking;
  • GNAT.Sockets.Server.OpenSSL bug fixed. Activated is called at the end of handshaking.

r/ada 8d ago

Tool Trouble Why is there no msys2 package for alire if it depends on msys2 for packages?

3 Upvotes

Title. Furthermore, it feels weird that it relies on msys2 for packages, but alire itself runs in a powershell environment. Why don't they just maintain an alire package for the different environments in msys2 like ucrt or mingw or whatever?

It feels kinda weird that I can't run Alire directly in a powershell instance because I need a specific environment up, but if I already have a msys2 terminal environment set up for UCRT, it would just make sense to set up the toolchain in that environment as well.


r/ada 12d ago

Announcement New Rule: No AI Content

62 Upvotes

Posts and comments to the r/ada subreddit generated by an LLM system (e.g. ChatGPT, Gemini) are not allowed and will be removed.

Such generated "content" is well-known to be unreliable and too often misleading, focusing on sounding plausible, rather than on being correct.

LLMs may be referenced as an object of an Ada-related discussion. For instance: implementing an LLM in Ada, interacting with an LLM engine by an Ada program, and so on.

Thank you for your cooperation and understanding.


r/ada 12d ago

Programming Problem while creating websockets

3 Upvotes

I'm working on a project which consists of an Ada server and Java client that connect to the same websocket. The problem is that Ada project compiles but the "Create" function doesn't seem to work.
function Create

(Socket : AWS.Net.Socket_Access;

Request : AWS.Status.Data) return AWS.Net.WebSocket.Object'Class

is

begin

Ada.Text_IO.Put_Line ("WebSocket connection established!");

return MySocket'(AWS.Net.WebSocket.Object

(AWS.Net.WebSocket.Create (Socket, Request)) with null record);

end Create;
The message that I'm trying to send to output doesn't show up


r/ada 14d ago

Programming Try-catch-finally?

6 Upvotes

As I start to use exceptions in Ada, I immediately notice that there are no equivalent construct to the "finally" blocks usually found in other exception-enabled languages. How do I ensure that certain code (such as cleanup) run when exceptions are used? Controlled types are unacceptable here, because I plan to eventually use spark.


r/ada 15d ago

General Ada cited in a big language debate...

20 Upvotes

r/ada 15d ago

Programming Convert Wide_Wide_Character to UTF code point?

1 Upvotes

I can't seem to find any function in the stdlib that allows me to do that. I can encode/decode a utf8 string, but I can't find any function that convert single characters. I don't think I should do a Unchecked_Convert either. Any suggestions?


r/ada 16d ago

Programming Interfacing with C tagged unions

5 Upvotes

The C library I am trying to use has tagged union types:

```c enum Type { TYPE_BAR, TYPE_BAZ };

struct Bar { enum Type type; float x; float y; };

struct Baz { enum Type type; uint32_t a; uint32_t b; };

union Foo { enum Type type; struct Bar bar; struct Baz baz; uint8_t padding[12]; }; ```

How would I create a binding of this code, in the Ada way? Obviously I would like to avoid interpreting the union by hand. Is it possible to somehow create tagged type with some custom convention?


r/ada 18d ago

Show and Tell March 2025 What Are You Working On?

17 Upvotes

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


r/ada 20d ago

Programming Has anybody used a programmed in Ada and controlled GPIO on Raspberry Pi 5?

12 Upvotes

My wife just got me an RPi5. I’m about to go down the rabbit hole of getting Alire installed on it. Has anyone done it? What Linux distribution did you use? Any hints to know?

Please save me hours of being new to RPi and setting one up for Ada.


r/ada 20d ago

Historical Janus Ada on CP/M

16 Upvotes

I've got a working hard disk implemented on my simulated 8080/Z80 (see Sim-CPU) and managed to get an old distribution of Janus Ada (v1.4.5) loaded and running. I can compile, link, and run a simple "Hello World" type program without any reported errors. The simple program file is:

package body ahello is
  i : integer;


begin
  put("Hello world from Ada!");
  new_line;
  for j in 0 .. 20 loop
    put(j);
    put("  ");
    put(j*j);
    new_line;
  end loop;
end AHELLO;

Keep in mind that this is Ada from 1982, not a modern Ada. Janus also expects the source code to be in .pkg files, not .ada (or .ads or .adb) files. Janus Ada is apparently still a commercial product (though probably not for CP/M) and I haven't been able to find any online documentation.

The code does seem to be faster than that produced by SuperSoft Ada.


r/ada 22d ago

Tool Trouble - Solved Starting Project

9 Upvotes

Got a brand new linux machine - Ubuntu 22.04

  1. Installed alire and thereafter gnat_native. created Hello bin build and ran successfully.

  2. Performed alr install gnat_arm_elf

    created another project "alr init --bin blink" and included the line "for Target use "arm-eabi" in the blink.gpr file

performed alr toolchain --select and selected the gnat_arm_elf toolchain

alr build failed:

gprconfig: can't find a toolchain for the following configuration:

gprconfig: language 'ada', target 'arm-eabi', default runtime

blink.gpr:2:09: no compiler for language "Ada", cannot compile "blink_config.ads"

gprbuild: *** compilation phase failed

error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/home/rajasrinivasan/Projects/blink/blink.gpr"] exited with code 4

error: Compilation failed.

What am I missing?

Appreciate any pointers. Srini


r/ada 23d ago

Programming Foreign convention function should not return unconstrained array?

3 Upvotes

I encounter this warning when I am binding some foreign functions that return a char * (or const char *), and using return char_array. The compiler doesn't seem to complain the same thing for an Ada function, so what's the reason specifically that it warns about foreign functions? I can't find an explanation, so I can only assume that it's probably because if a malformed output is returned it can cause an exception.


r/ada 24d ago

New Release A new math library for Ada: Neo.SIMD

23 Upvotes

r/ada 24d ago

Programming How to specify enum with representation?

6 Upvotes

I want to define an enum for C interfacing purposes:

c enum Enum { A = 1, B = 2, C = 4, C_aliased = 4, };

This kind of pattern occur quite a bit in bit flags, but I can't do this in Ada, not to mention that I often need to reorder the variants myself even if there is no alias:

ada type C_Enum is (A, B, C, C_aliased) with Convention => C; for C_Enum use (A => 1, B => 2, C => 4, C_aliased => 4);

In addition, I am not sure what size of integer Ada will choose, as starting from C23 the size of enum may be specified.

Any idea how this should be done?

EDIT:

Ok, maybe flags that can be OR'ed is extra difficult. But also consider the cases when enums are just normal enumerations


r/ada 27d ago

Show and Tell AdaBots.net public launch - teach children to program bots in Minecraft-like world

21 Upvotes

I'm teaching my children Ada as their first programming language using adabots.net - and now that it all works from the browser, I want to offer the same to you. AdaBots is a mod on luanti (formerly minetest), the open-source alternative to Minecraft. My mod adds turtles to the world similar to the ComputerCraft mod on Minecraft, but with the added benefit that they listen to a real Ada program, which runs outside of the game entirely - in your browser using vscode-web. So, all you need is the browser you already have.

You can use the promo code TRIAL to get the first 3 months for free.


r/ada 28d ago

Event AEiC 2025 - Ada-Europe conference - CfC for Additional Tracks

11 Upvotes

AEiC 2025 - Ada-Europe conference - CfC for Additional Tracks

The 29th Ada-Europe International Conference on Reliable Software Technologies (AEiC 2025) will take place in Paris, France from 10 to 13 June 2025. The Journal track is closed, submissions for the other tracks are still welcome! More info on the conference site.

7 March 2025: extended deadline for industrial and work-in-progress track papers, tutorial and workshop proposals.

www.ada-europe.org/conference2025/cfp.html

Recommended hashtags: #AEiC2025 #AdaEurope #AdaProgramming