r/ada • • 1d ago

Learning Ada 2022 from Zero

Thumbnail
github.com
20 Upvotes

I am creating an Ada 2022 course.

This is the introductory volume. It can be a little dense or unclear at places, but I am working on it.

The next volume will be pointers/access types, tagged types , generics, tasking, etc.

You can try the course for yourself from this link too https://beyondfealty.com/ada22fromzero.html

Or view the code and download from github, it just an html page it will run locally in your browser.

The windows and mac tools might be wrong, I did the best I could, but I run linux and I couldn’t test the Windows and Mac steps.

Git is open for any contributions, pull and push requests.


r/ada • • 1d ago

New Release Announcing ESP-IDF GNAT Runtime 0.3.0

7 Upvotes

ESP-IDF GNAT Runtime 0.3.0 is out! This release introduces a new embedded runtime for ESP32-S3, featuring expanded tasking and interrupt support alongside tighter integration with the ESP-IDF build system.

Key Highlights

  • New ESP32-S3 Embedded Runtime (runtime-embedded-esp32s3.json) — Adds support for FreeRTOS-backed Ada tasks, protected objects, and runtime initialization.

  • Interrupt Support — Supports nested interrupts at Xtensa levels 1–3 and direct calls into Ada from ESP-IDF ISR callbacks. Each CPU core gets a dedicated secondary stack for interrupt handling, and the ESP-IDF component integrates the exception unwinder for use in interrupt contexts.

  • Foreign-Thread Support — FreeRTOS tasks created outside of Ada can safely call Ada code once partition elaboration completes. The runtime automatically attaches task context on demand via FreeRTOS TLS.

  • Primary Stack Checking (-fstack-check) — Adds support for compiler-generated stack checks in both task and interrupt contexts, raising Storage_Error when a check fails.

  • Generated SDK Constants — FreeRTOS storage sizes, alignments, tick rate, and the selected ATCB TLS slot are now derived directly from the active ESP-IDF configuration. The ATCB slot is configurable via CONFIG_GNAT_RUNTIME_ATCB_TLS_SLOT.

  • ESP-IDF Build Integration — The runtime now functions directly as an ESP-IDF component. The espidf_add_ada_application CMake helper connects Alire builds and their relocatable objects to the firmware build, handling SDK constant generation automatically.

  • Runtime Library Improvements — Updated clock and delay implementations, expanded runtime package coverage, and consolidated shared legacy descriptor settings.

  • Testing — Expanded the ESP32-S3 ACATS test configuration across multiple test suites.

Target Support & Requirements

  • Target Chips: The new embedded integration targets ESP32-S3. Existing descriptors for ESP32 and ESP32-C3 remain available, though validation of the new backend does not imply equivalent support on those targets.

  • Toolchain: Requires GNAT 16 with matching bb-runtimes sources and a compatible, up-to-date a0b-tools generator. The ESP-IDF component requires ESP-IDF 6.0 or later (the ESP32-S3 integration has been tested against ESP-IDF 6.1).

Configuration & Caveats

  • ESP-IDF Configuration (ESP32-S3): Enable C++ exceptions and Newlib, and reserve a FreeRTOS TLS slot for Ada.

  • Stack Sizing: A dual-core application with no additional foreign-thread consumers requires at least three binder secondary stacks (-Q3). Code compiled with -fstack-check requires an extra 12 KiB of primary stack allowance beyond the application workload.

  • Runtime Behavior: FreeRTOS scheduling does not fully implement Ada’s FIFO_Within_Priorities policy. Exceptions must not propagate out of ordinary callbacks exported to C, and ISR code must strictly use nonblocking, ISR-safe operations.


r/ada • • 3d ago

New Release System ET: an open-source ECAD (PCB design) tool written in Ada. Feedback welcome

3 Upvotes

I've written an ECAD tool for schematics and PCB layout in Ada. I chose Ada because hardware designed with it may end up in mission-critical systems, and the tool should hold itself to the same standard.

It has plain-text design files, a script processor, hierarchical reusable blocks and multi-board design, and it runs on Linux.

I'd welcome feedback on the code, the build and the docs: https://github.com/Blunk-electronic/ET


r/ada • • 4d ago

New Release [ANN] alr2appimage v1.1: now with Debian and RPM packages support

11 Upvotes

alr2appimage version 1.1 has been released and successfully published in the Alire index thanks to the new alire-index-mergebot.

The main new feature is support for generating deb and rpm packages automatically from your binary crate. The list of desired packages is specified with the new --out-package argument and AppImage continues to be the default target.

The easiest way to generate Linux packages from your application crate in a GitHub action is through the alr2appimage-action.

Changelog

Added

  • Support for Debian and RPM package generation, passing a list of package kinds to --out-package.

  • A --single-exe option to keep only the selected executable in generated packages.

  • A --debug option to keep the generation directory after a correct run.

  • Improved desktop metadata handling and terminal-related packaging options.

  • Tests using bbt including packaging checks and validation for AppImage, Debian and RPM artifacts.

  • RPM and Debian packages uploaded to the Releases section in GitHub.

Changed

  • Internally changed spoon crate by aShell for spawning processes. No user-visible changes.

Fixed

  • Corrected packaging problems related to file permissions (AppImage).

Full Changelog: v1.0.0…v1.1.1


r/ada • • 5d ago

Learning ada programming setup

8 Upvotes

i am planning to do setup for Ada. Bit confused on Alire/GNat/Gnat Studio.

Just downloaded GNat studio thinking its 'all in one' but its asking 'gpr build missing'

Can someone point to basic tutorial on how to setup the environment?

Thanks


r/ada • • 6d ago

Show and Tell Sparrow Web Stack v0.1.0

12 Upvotes

ada-lang.io crosspost: https://forum.ada-lang.io/t/sparrow-web-stack-0-1-0/4961

Hey fellow Ada enthusiasts.

I was watching some youtube and I came on this video: https://www.youtube.com/watch?v=sQXFhh_PiG4

Where everyone implements a web server with some specific requirements and constraints. 8 CPUs, a fixed postgres database with a specific config. A benchmark script, and some rules etc…

Unfortunately I’m not a member of this guy’s community so I was a bit late to take part in the challenge but I did see the typical languages up at the top of the leader board. Some rust, some zig, etc etc. I decided I would take some time and make a late entry and see how far I could push Ada. Could I get to the top of the leader board? I tried some experiments with AWS and while it is a good piece of software it wasn’t exactly written with performance in mind. It uses blocking sockets and it doesn’t have pools of reactors that handle responses in bulk.

Here was my submission: https://github.com/arjaythedev/multicore-server-challenge/pull/235

Yes I used Claude Opus 5.5 in the preparation of the submission, but it is not vibe coded. The engineering decisions were made by me. I chose the features and the path forward. I suspect if it ever gets accepted and bench marked it should place near the top. The top of the leader board is 230k users before breaking. On my machine I got just above 500k but that’s on 8 AMD Ryzen 9 9950X3D cores and not whatever weaker VCPU the bench marking machine has.

I spent some time extracting the core of the submission and building a web programming stack that would work with how people build web applications these days. The result is here: https://github.com/michael-hardeman/sparrow

What do you think of the repo? Should I take it any further? Should I publish it? Should we take the improvements and apply them to AWS?

The stack so far has:

  • http focused crypto crate provided by OpenSSL

  • postgres client crate provided by libpq

  • sqlite client crate provided by libsqlite3

  • valkey crate in native Ada

  • async TCP socket support for Linux, BSDs (Mac, etc..), and Windows.

  • Ada HTTP/1.1 and HTTP/2 server with gzip and TLS (via OpenSSL).

  • Ada HTTP/1.1 client with TLS

  • Support for health check and metric endpoints

  • logging with request tracing

  • Ada Open_Telemetry support crate

  • Ada S3 support crate

  • Ada Mustache logic-less template crate.

We have spark silver proof of absence of runtime errors throughout the stack. There is fuzzing testing using libfuzz across all communicating interfaces.


r/ada • • 7d ago

Programming An open-source ECAD tool written in Ada, where design files are plain text and modules are instantiated by reference

6 Upvotes

Disclosure first: I help Mario Blunk with promotion for this project. He wrote it, and he answers the technical questions here.

System ET is an ECAD tool for schematic capture and PCB layout. GPL-3.0, written in Ada, in development since 2017. The repo is about 10.8 MB of Ada today.

What I think this sub might actually find interesting is the file format. Design and library files are plain ASCII text, one file per module, symbol, package and device, so a schematic diffs like source code and lives in git without a database. Submodules are instantiated by reference with defined interfaces at the module boundary, and there is a virtual two-port component called a Netchanger that handles the net transitions between modules. Everything the GUI does is also available as a CLI command or a script file, which is what makes scripted or CI-driven hardware work possible.

Honest state: Linux only, builds from source with GNAT, GtkAda and gprbuild, no installer yet, parts of the GUI are still under construction. Screenshots are in the repo.

https://github.com/Blunk-electronic/ET

Manual: http://www.blunk-electronic.de/ET/pdf/caesystemet.pdf

For the Ada people here: the GUI layer is GtkAda, the whole thing is one codebase that has been alive for nine years, and the CLI is not a wrapper around the GUI but the other way round. Happy to answer anything about how that is structured.


r/ada • • 7d ago

General Flights cancellation in US

0 Upvotes

Anything to do with Ada? 'Analysts' on channels were saying systems/flight management software are outdated and need modernization.


r/ada • • 11d ago

New Release [ANN] adacovex v1.69.0: WIP compiler-like proof diagnostics

Thumbnail
gallery
15 Upvotes

What is adacovex

  • Is an Ada/SPARK formal verification and compliance toolkit

  • Zero dependency CLI (for published alire.toml), developer dependencies are gnatprove and the usual bunch of system dependencies.

  • SBOM generation (CycloneDX/SPDX), supporting a decent number of languages with plans to add more support

  • gnatprove/source code parsing, tells you about tests/proof coverage as well as DO-178C / ISO 26262 / IEC 62304

  • Web dashboard, HTTP server and bundled offline manual

  • caching on unchanged code

  • tldr, tealdeer, man page support

  • Status badges and stuff

GitHub: https://github.com/bladeacer/adacovex

Docs: https://adacovex.readthedocs.io/en/latest/

Other Screenshots

Yeah there is a lot of them 😅

About the update(s)

Wow it's been almost a month since I last posted on adacovex, here is what went into the time.

The TOML configuration file now comes with an adacovex init helper, this just provides you with the default configuration file you can use to override default flag values/toggle options.

There is also a WIP implementation for compiler-like proof diagnostics. Lets you contextualise gnatprove outputs with suggested fixes, relevant line and details on the errors. Inspired by what gnatprove can already do as well as compiler diagnostics/error messages as seen in Rust/Go and other ecosystems. Better support and documentation for this will come in future updates.

I am also working to improve contextual help text so it feels more cohesive.

Future Plans

Performance, as well as technical debt like the lack of proof coverage will come after critical fixes like making our SBOM less rudimentary. IMO there is a lot I can learn from syft, the gold standard of SBOM tooling.

There are some good first issues on GitHub I will be looking to create. Feel free to create new ones for bugs, proposed features, polish or edge cases I might have missed out on. I believe I have implemented most of what I set out to do pre 2.0.0. The remaining work is polishing up "tooling ergonomics" as well as addressing technical debt and performance.

I am also thinking of creating a Matrix room/Discord server for adacovex if there is any interest. Do let me know :D

Post-script

As usual the alire release will come later. I also posted about this earlier in the forum.

To think that this started off as a silly idea of mine for improving developer experience for a language I still have a long way to go in. Thank you all for the support all this time ^_^


r/ada • • 12d ago

General Lost job,help me find one

Thumbnail reddit.com
6 Upvotes

r/ada • • 13d ago

Show and Tell Castle *working name, a game I am writing entirely in ADA

Enable HLS to view with audio, or disable this notification

24 Upvotes

https://github.com/Adzvokatix/Castle-Game-Engine

Hello, if any of you are interested, here is a medieval colony sim, I am working on. I have completed production of the underlying engine. Everything is a result of procedural generation. Completed so far,

The world | Terrain, Geology, Deposits, Hydrology, Flora, Chunks, Worldgen, Maps

Climate | Seasons, Temperature, Wind, Weather

Rendering | Streaming, Mesher, Textures, Render, Camera, Colors, Currents

The interface | Font, UI, HUD, Input, Views, Pick, Rays (will be redone, rough implementation for production)

Editing and saves | Edits, World_Blocks, Saves

Live water | Fully flowing dynamic water systems

People | Bodies, Poses, Second_Order, Figures, Serfs, Props, Fire

Deer | Deer, Animals, Herds

Routes | Nav, Marks

The colony | Colony, Actions, Scenario

Food and needs

Habitation (prototype) | Buildings, Iso

See to the video, this shows a compilation of alpha stage production milestones and state change comparisons.

Apart from the OpenGL and GLFW bindings (the thin Castle.GL and Castle.GLFW packages that just import the C symbols, plus the -lglfw -lGL link lines), the project has no external libraries. The alire.toml declares no dependencies. The .gpr file pulls in nothing beyond the standard Ada runtime.

What appears in the with clauses is almost entirely the Ada standard library:

  • Ada.Numerics / Elementary_Functions for the math the generators and animation filters need

  • Ada.Text_IO, Ada.Command_Line, Ada.Directories, Ada.Streams for the tools and save format

  • Ada.Unchecked_Deallocation / Unchecked_Conversion for the usual manual memory

  • Ada.Real_Time, System.Multiprocessors for the job system timing

  • a couple of Ada.Containers uses

Everything else—noise, hydrology, geology, deposits, climate, water simulation, navigation, colony logic, serf bodies and poses, procedural buildings, the edit store, the mesher, the UI, the save format—is code written for this project. There are roughly 64 Castle.* package specs; the bindings to GLFW/GL are two of them.


r/ada • • 17d ago

New Release ANN: SparForte 3.0.1

23 Upvotes

SparForte is a scripting language, template language and shell based on Ada and Bourne shell. It has been in development for over 20 years and has about 135,000 lines of code.

SparForte 3 is now available with Alire.

Full announcement on forum.ada-lang.io


r/ada • • 18d ago

Learning Built my first small project in Ada — looking for feedback!

10 Upvotes

Hey everyone!

I'm a Software Developer, and I've recently started exploring Ada because of its applications in aerospace, embedded systems, and safety-critical software.

I decided to build a simple CLI Task Manager to get familiar with the language.

The project supports:

  • Adding and listing tasks

  • Marking tasks as completed

  • Basic input validation

  • Simple task management using Ada's type system

Coming from a background in backend development, I'm finding Ada's strong typing and focus on reliability really interesting.

I'm planning to explore more advanced concepts like concurrency, real-time programming, and SPARK.

I'd love to connect with experienced Ada developers, get some feedback, and learn more about real-world applications.

I'm also open to freelance opportunities, small projects, and collaborations involving Ada or general software development.

What would you recommend building next to gain more practical experience with Ada?


r/ada • • 18d ago

Programming A low-cost, ultra-reliable Holter ECG monitor

Thumbnail
hackster.io
14 Upvotes

Cardiovascular diseases are the leading cause of death worldwide. In Africa, their impact has continued to grow over the last two decades.

In light of this, I decided to take on a challenge: to design a portable, connected ECG (electrocardiogram) that would enable anyone to view and monitor changes in their heart activity from the comfort of their own home.

It is important to note that this prototype is not a certified medical device and cannot replace an examination carried out by a healthcare professional. It is, first and foremost, a technological experiment and a learning exercise.

But beyond the device itself, this project has a greater ambition: to demonstrate that it is possible to move from theory to practice, to transform scientific and technical knowledge into concrete solutions that address the challenges facing our continent.

Your feedback is very welcome.

Thanks


r/ada • • 21d ago

Show and Tell I built a cockpit-style habit tracker in Ada—including the web server

Enable HLS to view with audio, or disable this notification

17 Upvotes

Every habit is a cockpit button. Complete it and the lamp turns green. When everything is green, you’re cleared for takeoff.

This is a small programming experiment: about 1,200 lines of Ada, serving plain HTML and CSS with no JavaScript.

A few things I explored:

• Distinct types for habit IDs and day numbers, so accidentally mixing them fails at compile time.

• Preconditions that reject logging a habit for tomorrow.

• Eight worker tasks handling requests, with a dedicated recorder task serializing changes through rendezvous.

• An append-only, hash-chained event log that rebuilds the state on startup. Editing an old entry locks the panel, although someone could deliberately recompute the hashes.

One early bug had my HTTP parser reading past an array boundary. Getting a range error with a line number was a nice introduction to Ada’s checks.

Source and build instructions: https://github.com/nick-friedrich/ada-preflight

Five-minute walkthrough: https://youtu.be/5ax_a3xQJhE

I’d be interested in feedback from experienced Ada developers, particularly on the tasking structure and whether the contracts are idiomatic.


r/ada • • 24d ago

Show and Tell November 2026 What Are You Working On?

19 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 • • 24d ago

New Release Gnoga series on Alire

16 Upvotes

After many a hurdle during Alire registration process, you now have the following at your disposal.

The main Gnoga framework for cross platform GUIs for Ada comes in version 2.2.3.

And now the Gnoga series are finally on Alire:

Find a Gallery of demonstration, tutorials programs and more with the list of the main Gnoga components used by each program. May be helpful for a new comer or a help for finding a specific Gnoga widget example.

gnoga-list: Subscribe | Archive | Search — discussion of Gnoga or create a ticket.


r/ada • • 25d ago

Historical Bootstrapping Ada competitors: Red, Yellow, Blue

Thumbnail tym83.github.io
17 Upvotes

r/ada • • 28d ago

Learning Is Ada a good language for a beginner interested in building custom tools?

28 Upvotes

Hi everyone!

I'm pretty new to programming and I only know the absolute basics (variables, simple loops/functions).

I've been looking into Ada because it looks very interesting, clean, and robust. I have a strong interest in building and using my own custom tools.

Since I don't have a massive programming background yet, I was wondering:

Is Ada a manageable language for a relative beginner to start with, or is it too steep of a climb?

What are the best resources, tutorials, or entry points to learn Ada from scratch?

For someone wanting to build their own tools, how well does Ada fit that use case, and what kind of projects should I start with?

I'd love to hear your experiences and any tips for starting out with Ada!

Thanks in advance!


r/ada • • Oct 23 '26

New Release [ANN] adacovex v1.63.0: Better perf, cross platform support

10 Upvotes

So earlier this month v1.58.0 came out, and a user found that there were compilation errors on Windows.
This made me look more into the codebase and I found plenty of hard coded unix related paths. I have fixed them by implementing a platform agnostic file path resolving helper that respects platform conventions more. Some types like Long_Long_Integer were patched so as to have better cross platform portability. As a result, the code now better supports different platforms, though the GitHub Releases built binary is still Linux only for now. Down the road, I hope to build binaries for Windows and macOS when there is more demand. The patches aimed to fix the glaring issues of getting the code to run, since our goal is to get adacovex supported everywhere Alire runs.

this platform support refactor also has these consequences:
Configuration, cache and data directories for adacovex now respect platform conventions (XDG / ~/Library / %APPDATA%)

--compare-base, --coverage-delta now work on plain old Windows (without the use of WSL and the like)

Oh and I adopted some CI from alire-index to sanity check building the code on Windows/Mac at least. (macos-latestfails though this is a known underlying issue with gnat)

I moved to justfile from Makefile when debugging the code on a separate Windows machine, though the Makefile is still there for compatibility shim. What was previously all lumped in the Makefile targets' logic was moved out to separate Python scripts. This has the added benefit of getting certain things to run more seamlessly cross platform in CI.

There is also better caching in CI itself, the SBOM parser was checked for correctness on JS and Golang related projects. I will be testing the parser on more real world projects for Rust, Python and other languages soon. Of course, it also recognises alire.toml related dependencies.
I also added adacovex tldr which works like adacovex man but for tldr-pages (works with tealdeer as well). So you can run that and tldr adacovex any time.

There are more doc changes and improvements on performance, i.e reduced syscalls, slight improvement in warm cached proofs. Most of the time spent when one runs proving with adacovex is gnatprove itself, since adacovex prove wraps around it. adacovex status also now reports on the installation method.

I have some bigger goals for adacovex, though for now I will be taking a 2 week break away to focus on some of my other projects. Feel free to submit GitHub Issues or reach out to me here or on the forum, I will still be around.

GitHub: GitHub - bladeacer/adacovex: Ada/SPARK formal verification and compliance toolchain. · GitHub
v1.63.0 Changelogs: adacovex 1.63.0 - adacovex latest documentation (the other changes listed here were implemented from v1.59.0 to v1.62.0)

P.S. Bit of a text wall here, but there have been a fair bit of changes I wanted to share about

P.P.S. I posted this over in the forum as well earlier


r/ada • • Oct 21 '26

New Release Win32_Hash_Argon2 password hashing in Spark

7 Upvotes

Hi all,

I’ve published a companion Windows password-hashing library in Ada/SPARK: Win32_Hash_Argon2.

What it does:

  • Argon2id password hashing and verification, wrapping the native C library under a rigorous SPARK compliant architecture.

  • Random salt generation via Windows ProcessPrng with BCryptGenRandom as an automatic cryptographic fallback.

  • Standard encoded hash output supporting configurable cost parameters (t-cost, m-cost, parallelism) and strict format validation.

  • Separate verify procedure built on a strict fail-closed / fail-stop pattern.

  • Memory sanitization: Every secret (Password, Salt, temporary hashes) is aggressively wiped using SecureZeroMemory plus a redundant Ada overwrite on success and across every single exceptional exit path (entropy failures, range/constraint errors, API faults, or unexpected exceptions).

Verification:

  • GNATprove : all provers: 28/28 checks proved, 0 unproved.

  • Verified on two Gnatprove version: Community 2021, 16.1.0

Honest scope: The low-level bindings interfacing directly with the Windows API and the external Argon2 C library are SPARK_Mode => Off, while all surrounding wrapper logic, state validation, and safety invariants are formally proved. Windows only.

https://github.com/EliAvila10/Win32_Hash_Argon2

Feedback welcome.


r/ada • • Oct 19 '26

New Release Win32_Hash: PBKDF2-HMAC-SHA256 password hashing in SPARK

12 Upvotes

Hi all,

I’ve published a small Windows password-hashing library in Ada/SPARK: Win32_Hash.

What it does:

  • PBKDF2-HMAC-SHA256 through the Windows CNG API (BCryptDeriveKeyPBKDF2), 1,000,000 iterations by default (650k–1M by type)

  • Random salt, 32–256 bytes, from ProcessPrng with BCryptGenRandom as fallback; stored as Base64 (RFC 4648)

  • Hash stored as 64 uppercase hex characters; separate verify procedure with constant-time comparison, fail-closed

  • Every secret wiped with SecureZeroMemory plus a redundant Ada overwrite, on success and on every failure path

Verification:

  • GNATprove --level=4, all provers: 186/186 checks proved, 0 unproved

  • Re-verified on three GNATprove versions: Community 2021, 14.0.1, 16.0.1

  • adacovex: GNATprove Platinum (186 VCs), DO-178C DAL-C achieved

Honest scope, as documented in the README: the bodies that call the Windows API directly are SPARK_Mode => Off (their contracts are checked at run time); everything around them is proved. Not externally audited — I don’t call it “secure” without that qualification. Windows only.

https://github.com/EliAvila10/Win32_Hash

Feedback welcome.


r/ada • • Oct 16 '26

SPARK • I'm a 38-year-old welder. In 3 months, I learned Linux, Ada/SPARK, and built a formally verified TCB on top of the seL4 microkernel. Here is what I learned.

19 Upvotes

Hi r/ada,

I'm a 38-year-old welder from St. Petersburg, Russia. No formal CS background. I bought my first laptop for programming in June 2026, installed Linux, and started learning. Three months later I had a working prototype called Schild TCB - a trusted computing base on the seL4 microkernel, with an Ada/SPARK userland.

Here's what I found useful, especially the parts that didn't work, because those tend to be the most useful for anyone considering Ada/SPARK for a real project.

What it is

Schild TCB is two artifacts, not one:

A bare-metal OS written from scratch in Ada: bootloader, NVMe driver, e1000e NIC driver, TCP/IP stack, HTTP server. Runs on a ThinkPad T580.

An seL4-based artifact: the microkernel is upstream (I didn't write it), and my contribution is the root task and several daemons in Ada/SPARK. Network and storage run isolated in Ring 3 processes, communicating over IPC.

The point of the second artifact is formal verification. The bare-metal one answers "does it work"; the seL4 one answers "is it proven".

Verification

The kernel logic is 185 Ada modules, verified with gnatprove (GNAT Community toolchain) at SPARK Level 4. Result: not-proved: 0. Seven daemons in the root task are also proven at the same level.

I want to be precise here: not everything is proven. Drivers (NVMe, e1000e, network stack) are not proven and are not claimed to be. They're isolated in separate domains so their failure cannot reach the proven core. Proving a driver is a separate large effort - hardware has no formal specification, so there's nothing to write contracts against. Isolating is the right approach.

The most useful lesson

Formal verification caught a bug that all tests missed.

I set the page rights for MLS rings as ReadOnly := 1. But in seL4's CapRights layout, bit 0 is Write and bit 1 is Read. So my "read-only" page was actually "write-only", which x86 doesn't support, and the kernel masked it to "no access at all". Tests didn't catch this because the code simply never read those pages.

When I moved the root task to SPARK mode and started proving contracts, gnatprove showed the contract didn't match reality. One-line fix: ReadOnly := 2.

This is the single best argument for SPARK I can give: tests check what you thought to test. Proof checks what you claimed.

Where I'm stuck

Three things, all upstream, none in my code:

IOMMU (VT-d). No DMA isolation. I built seL4 with IOMMU support, the kernel detects VT-d, but under certain configurations the seL4 sporadic task replenishment path hangs non-deterministically (33-67% of runs, depending on period). Documented, left as-is.

SMAP. Hardware protection that prevents the kernel from accessing user memory without explicit permission. In this seL4 version, SMAP is gated on the printing option. Need logs - no SMAP. Need SMAP - no logs. I chose logs.

x86_64 MCS is formally verified weaker than ARM MCS. Official upstream status. I can only state it, not fix it.

One bug I did find and fix in upstream seL4: on a 32 GB laptop, the root task hung on first retype. Root cause was the MAX_NUM_DRHU formula - it treats the whole 1 GiB kernel-device window as IOMMU slots, yielding 262142, which bloated .boot.bss to ~6 MiB and shifted the kernel boundary. Capping it at 8 (real platforms have at most 8 IOMMUs) fixed the hang. Not my bug, but I found it.

On using AI

I used an AI agent as a coding assistant. I want to be upfront about this because it's relevant to how the project moved so fast.

I set the tasks, verified results, debugged on hardware, made architectural decisions. The agent wrote code. It's a separate skill, and I learned it during the project. The agent also made mistakes in microkernel specifics that I had to catch and correct.

I mention this because I think the Ada/SPARK community should know what's now possible for someone with no formal background, and also because I don't want to pretend I wrote every line myself.

What I'm looking for

I'm not publishing the repository yet. But I'd like feedback on the approach, especially from anyone who's done SPARK verification on a real system:

Is isolating drivers rather than proving them the right call, or is there a middle ground I'm missing?

The x86_64 MCS verification gap - is anyone tracking this upstream, or is ARM the only realistic path forward?

Any obvious mistakes in my trust model?

Happy to answer questions.


r/ada • • Oct 15 '26

New Release Turbo Ada v1.6 official release w/ example game

27 Upvotes

https://github.com/AdaDoom3/TurboAda
The latest version includes support for third party libraries as well as a more stable compiler and optimized runtime... oh, and a simple FPS-style game engine to play with - can you survive all five waves of undead? 🧟🎃🏰