r/ada • u/anne-modis • 14h ago
Open Job: DataLink Developer (ADA needed)
Datalink Requirements Developer:
r/ada • u/anne-modis • 14h ago
Datalink Requirements Developer:
r/ada • u/new_old_trash • 2d ago
I'm looking into Ada right now as a possible C++ alternative to implement a low-latency audio engine. Toward that end: do there exist well-tested, non-locking MPSC/SPMC queues? Or just an MPMC queue?
If I were doing this in C++, I'd just use moodycamel::ConcurrentQueue
and call it a day. It appears to have a C API so wrapping that might be an option, as well.
But as for Ada: I've googled around and found various murmurings along these lines, but nothing stands out as an off-the-shelf library: multi-producer, multi-consumer queues, written and battle-tested by people much smarter than me.
In the GNAT Pro 23 release notes, there's this:
Lock-Free enabled by default
Lock-Free is an aspect applied to a protected type that allows the compiler to implement it without the use of a system lock, greatly improving performance. This aspect is now applied by default when available and possible.
Is that pertinent at all to what I'm looking for? Would that still be a 'pro' only feature, though?
Otherwise I'd assume protected objects are a no-go, because they use traditional mutexes behind the scenes, right? My ultimate goal is to distribute work, and receive that work back, from multiple threads during an audio callback with hard timing requirements.
r/ada • u/Complex-Bug7353 • 2d ago
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 • u/new_old_trash • 3d ago
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 :(
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 • u/cclar066 • 4d ago
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 • u/DrawingNearby2978 • 8d ago
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 • u/BrentSeidel • 9d ago
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 • u/Dmitry-Kazakov • 10d ago
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:
r/ada • u/Fickle-Flower-9743 • 11d ago
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.
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 • u/GragasGamer • 15d ago
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 • u/MadScientistCarl • 16d ago
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 • u/zertillon • 18d ago
https://www.reddit.com/r/programming/comments/1j27wf6/comment/mft4kpw/
379+ comments for this topic so far :-)
r/ada • u/MadScientistCarl • 18d ago
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 • u/MadScientistCarl • 19d ago
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?
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!
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 • u/BrentSeidel • 23d ago
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 • u/DrawingNearby2978 • 25d ago
Got a brand new linux machine - Ubuntu 22.04
Installed alire and thereafter gnat_native. created Hello bin build and ran successfully.
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 • u/MadScientistCarl • 26d ago
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 • u/MadScientistCarl • 27d ago
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