GNAT 6 experience report (very short)

John Marino has packaged GNAT 6 from FSF for FreeBSD and DragonFly.

I’ve installed FreeBSD with GNAT 6, and tried to see if there were any obvious differences to the older versions (I use GNAT 4.9 and 5 on Debian).

So far the result is that it is more picky about anonymous access types. (Maybe even too picky. I’m trying to figure that out.)

Here is an example:

GNAT 6.0.0 20151129 (snapshot) -=> GNAT AUX [FreeBSD64]
Copyright 1992-2015, Free Software Foundation, Inc.

Compiling: /usr/home/sparre/org.opentoken-6.0b/opentoken-production-parser-lalr-parser_lists.adb
Source file time stamp: 2015-12-10 10:32:39
Compiled at: 2015-12-24 13:56:17

   487.       return (Element => Position.Item'Access);
                                 |
        >>> access discriminant in return aggregate would be a dangling reference

 746 lines: 1 error
gnatmake: "/usr/home/sparre/org.opentoken-6.0b/opentoken-production-parser-lalr-parser_lists.adb" compilation error

The subroutine which causes the problem is:

   480     function Constant_Reference
   481       (Container : aliased in List'Class;
   482        Position  : in Parser_Node_Access)
   483       return Constant_Reference_Type
   484     is
   485        pragma Unreferenced (Container);
   486     begin
   487        return (Element => Position.Item'Access);
   488     end Constant_Reference;

Switching to 'Unrestricted_Access makes the compiler accept the function, but is it safe?

(Debian/experimental also has GNAT-6.)

Stephen Leake’s Ada Library, AKA SAL

On my daily “what’s happening in the Ada world” rounds, I stumbled over Stephen Leake’s Ada Library at the Ada reddit.

SAL is a…

…collection of stuff I’ve found useful in my projects. A large part of SAL provides a coherent set of generic abstract data types, intended to be yet another entry in the “Standard Ada Library” discussion. My goal in this part of SAL was to provide Ada packages that take full advantage of the flexibility and power of Ada generics, while at the same time making things relatively easy for the casual user. See here for more on my design philosophy. Another large part of SAL provides math operations for kinematics and dynamics of masses in 3 dimensional space. Cartesian vectors, quaternions, orthonormal rotation matrices, moments of inertia, forces, acceleration, velocity are supported, in 3 and 6 degrees of freedom (translation and rotation). I’ve used this library for both robotics and satellite simulation.

I’m going to be honest with you, and admit that I’ve no idea what half of those things are, but I do know how to download stuff, so I grabbed the source code to get a feel for it, and let me tell you; it is packed. There’s a lot more in the source package than mentioned on the SAL website.

Finally I’d like to point out that there’s other Ada goodies to be found at stephe-leake.org:

Stephen’s place is a regular goldmine.