Ada library wishlist

I’d like to write more applications in Ada, but I often find that I need a library that doesn’t exist or isn’t well maintained. I thought it might be a good idea to share my wishlist in case anyone is looking for a project or wants to collaborate. I may have already started prototyping some of these.

  • HTTP - I don’t really like AWS and I think something simpler, like Go’s net/http for both clients and servers would be extremely useful.
  • Jinja2 - I have a couple of large Python apps that I’d like to rewrite in Ada, but the lack of a Jinja2 template parser means I’d have to rewrite my templates. I really don’t want to rewrite the templates.
  • Software defined radio - It would be really nice to prototype some wireless protocols using a HackRF. I do have some bindings written for the hardware, but am a bit out of my depth with the complex linear algebra needed to implement the filters. Some real world examples of Ada.Numerics usage would be helpful.
  • Error correction - LDPC and BCH would be nice to have on lossy radio links.
  • RP2040 PIO drivers - I’d love to get the VGA demo board fully working, especially the SD/MMC card interface using all four data lines.
  • Prometheus metrics - A simple library for pushing metrics to Prometheus or similar would be nice. There are even some good notes on client library design in their docs.
  • USB audio drivers - I could really use USB audio class support in the usb_embedded for one of my projects.

What’s on your wishlist?


Here is the wishlist I’m thinking about right now :

  • USB Mass-Storage (device side) for embedded devices to emulate a USB key/SSD.
  • USB HID (device side) for embedded devices : Already exists but I have to check it fulfill my needs (Manufacturer endpoints).
  • USB HID (host side) for Windows 10/11 : Started to work on it. Harder than I expected since I have to dive deep in Windows API. I could create a C wrapper but I prefer to keep source code pure Ada.
  • Netifaces for Windows 10/11 : Like the Python library. Started to work on it. Same problem : pure Ada, wrap Windows API.
  • Better support for IPV6 scopeid on Windows 10/11.
1 Like

I’ve used hidapi for host-side drivers before. It provides a nice portable API that works on both Linux and Windows. It looks like there might already be an Ada binding for it.

I also used a Python binding to hidapi a few years ago but was not happy with it.
I switched to PyWinUSB (I modified it slightly to suit my needs) which is much easier to use.
I started to convert it to Ada.

1 Like

I don’t know which of these might exist, I have some parts of these in progress. Most of what I do in Ada is desktop applications and tools, not embedded, but that doesn’t seem to be a category of software that the community is very interested in.

  • Backing for memory allocators (stack, page allocator w/ mmap, etc.)
  • Memory allocator types (free list, bump pointer, slab allocator)
  • Scope-based files (controlled-type files), that close when they go out of scope
  • Smart pointers - (atomic/non-atomic) reference counted, something analogous to std::unique_ptr
  • Memory mapped loading of files
  • Monitoring files for changes
  • “Is this file binary?” - e.g. Examine first 4 KiB of a file for a null byte
  • UTF-8 helpers to operate on String types - painful especially is grapheme cluster iteration. A lot of tools use UTF-8 or ASCII so I don’t want to move over to Wide_String or Wide_Wide_String.
  • String splitting - I have this in Septum
  • Python shlex equivalent
  • Code generation for JSON serialization/deserialization - feed it an .abs file and get an ads+adb file with load/save functionality.
  • Vulkan bindings
  • PNG loading
  • Super simple http

That would be fantastic especially it it is more portable than AWS that needs some tweaks to compile on OpenBSD. I haven’t tried AWS yet but it’s API looks quite nice. Maybe nicer than Go’s.

Edit: I have changed my mind. I do not need tasking on a microcontroller. A podcast got me thinking I should use them but thinking it through. I have never needed them on a single core and IMO they may actually be detrimental in that case. After all, you should avoid coroutines on Go unless really needed for multicore.

I wonder as an alternative to depending on OpenSSL or LibreSSL. Whether there is any possibiity of wrapping Gos web server into an API that Ada code can use directly, then you would get Gos ASN parsing. Http2/3 etc. that Google are spending considerable dollars? Though perhaps that is just part of BoringSSL. I am unsure. I know LibreSSL took some inspiration from Gos ASN parsing.

Additionally a simple http web server might be useful where end to end crypto can be used like the Spark NACL library and potentially where the Go server is too large?

This might be not what you’re seeking, but besides AWS, you also have EWS and one I recently stumbled upon, ash. Both are server-only, according to the documentation. There are also two libraries based on curl: CurlAda and ada-util (among other stuff).


There’s Sparre’s Black server.

1 Like

I want this (in terminal GUI library for Python) ^^

1 Like

With stack allocation of Real_Vector ( 1 … N ) when N >= 100,000 I get STACK_OVERFLOW ERROR while trying to check how fast operator overloading is working for an expression

X := A + B + C + C + A + B, where
A,B,C,X are all Real_Vector ( 1 … N ).

So my only option was to allocate on the heap using new. But then I lost the clean syntax

X := A + B + C + C + A + B

and I had to write instead:

X.all := A.all + B.all + C.all + C.all + A.all + B.all.

This is really not a tool for linear algebra algorithms implementation that rely heavily on matrix vector products and vector updates. There you do need to allocate on the heap (sizes are determined in runtime) and you do need a clean syntax, for promoting readability. Renaming A.all can help restoring the syntax. But it is clear that another Math library is needed.

Do you agree?

An up-to-date Audio library would be nice. I know we have ASFML, but other langauges have a lot more like FMOD, BASS, SFML etc.I know media is not really an avenue Ada/SPARK is aimed at, but personally I feel it’s an excellent language to create something like a video game in. It’s never going to be that popular in that area, but it’s certainly just as powerful as C++ is, and in some areas, better.

1 Like

Apart from ASFML, there are other sound libraries listed in Awesome-Ada: