Using GNAT.String_Split to split a string

I’ve written a new article for our wiki:

GNAT.String_Split Basic Usage Example.

Splitting a string into smaller parts based on one or more separators is not an uncommon task in programming, so when I stumbled on an Ada example for doing just that (thanks caracal!), I jumped at the opportunity to turn it into a short beginner article. And this really is a beginners article, so everybody should be able to understand what’s going on.

I hope.

As usual I’ve done my best to honor Ada by not letting too many bugs and errors slip by, but there’s a good chance I might’ve failed somewhere. If so, please let me know, or just fix it yourself. It is a wiki after all, so you have that power.

Defensive programming: Fortran, Ada, C++, Java, ???

Since I started tracking the Ada sub reddit a few weeks ago, I’ve been exposed to quite a few very interesting Ada related items.

And today is no different.

From a blog called Kickin’ the darkness comes a little gem of an article: Defensive programming: Fortran, Ada, C++, Java, ???.

Here’s a quote:

The programming language that’s grabbing the commercial industry now I would be expecting to be dominating defense software development in about 10 or 15 years. And, well, first off I don’t perceive a dominating candidate yet, and the candidates that I do see lack an aspect I consider fundamental to safety- and mission-critical software systems. That aspect is an intentional, well thought out, unifying principle, ideally envisioned by an individual or small team of language designers.

The article raises some very interesting questions, and the comments are a worthwhile read also.

Using A Generic To Read A Configuration File

I’ve written a new article for our wiki:

Simple Configuration File Reader – Using A Generic

As the name implies, the article is all about how to read a configuration file using a generic. The general idea is that a generic is instantiated for every configuration file you need in your program.

Default values are of course also supported.

I’ve tried making the code as neat and clean as possible, but if you spot anything that’s ugly (or just plain un-Ada’ish) then please let me know. Or just change it. It’s a wiki page. You have that power.

For those not interested in the article, but just the code, feel free to pull it from the GitHub repository.

Enjoy!

SPARKRules Version 1.0

SparkSure has made the latest version of their SPARKRules software available:

SPARKRules is a utility program for managing proof libraries – which can contain user rule files and proof review files. SPARKRules allows user rules to be defined once and copied to Simplifier user rule files as required and supports the storage of proof review files in a separate library. The directories generated by the Examiner for the Simplifier are therefore not required for the storage of any permanent data.

You can read the full release announcement here.

Catching And Handling Interrupts In Ada

I’ve written a new article for the Ada-DK Wiki: Catching And Handling Interrupts In Ada.

Well, “article” might be too big a word for it – it’s probably more a simple presentation of three small source files, with some strategically placed comments.

If you don’t care about the article, you can go straight to the code at GitHub.

Enjoy!