Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ANN: Simple components for Ada v3.9

4 views
Skip to first unread message

Dmitry A. Kazakov

unread,
Jul 11, 2010, 4:52:52 PM7/11/10
to
The library provides implementations of smart pointers, directed graphs,
sets, maps, 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), pseudo-random non-repeating numbers,
symmetric encoding and decoding, IEEE 754 representations support. It grew
out of needs and does not pretend to be universal. Tables management and
strings editing are described in separate documents see Tables and Strings
edit. The library is kept conform to both Ada 95 and Ada 2005 language
standards.

http://www.dmitry-kazakov.de/ada/components.htm

The version 3.9 has experimental packages for Debian and Fedora linux. Note
that due to gcc 4.4 bugs not all features are available. See release notes:

http://www.dmitry-kazakov.de/distributions/components_fedora.htm
http://www.dmitry-kazakov.de/distributions/components_debian.htm

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Dirk Heinrichs

unread,
Jul 12, 2010, 4:36:09 PM7/12/10
to
Dmitry A. Kazakov wrote:

> The version 3.9 has experimental packages for Debian and Fedora linux.
> Note that due to gcc 4.4 bugs not all features are available. See release
> notes:
>

> http://www.dmitry-kazakov.de/distributions/components_debian.htm

For which debian version are those packages? I assume "testing", because of
gcc 4.4. OTOH you state that "APQ persistence layer is not supported because
APQ is not yet packaged.", but APQ packages are available for "testing". So
I'm a bit confused.

Bye...

Dirk

tonyg

unread,
Jul 12, 2010, 6:09:26 PM7/12/10
to

I think this is because of the status of APQ rather than Dmitrys
code . I have used these component recently to implement a database
in odbc and I have to say it is very good and does the job. As to
which version, just use the gpr file as part of your gnat-gps project
and it works very very nice.

Dmitry A. Kazakov

unread,
Jul 13, 2010, 3:55:43 AM7/13/10
to
On Mon, 12 Jul 2010 22:36:09 +0200, Dirk Heinrichs wrote:

> Dmitry A. Kazakov wrote:
>
>> The version 3.9 has experimental packages for Debian and Fedora linux.
>> Note that due to gcc 4.4 bugs not all features are available. See release
>> notes:
>>
>> http://www.dmitry-kazakov.de/distributions/components_debian.htm
>
> For which debian version are those packages? I assume "testing", because of
> gcc 4.4.

Yes it is the "squeeze".

> OTOH you state that "APQ persistence layer is not supported because
> APQ is not yet packaged.", but APQ packages are available for "testing". So
> I'm a bit confused.

It wasn't there last time I looked for it. Do you have the package names
(bin and dev)? I will take a look.

P.S. In any case in order to use the persistent layer of Simple Components,
the gcc 4.4 must be fixed first. The current version has controlled types
broken and some other severe issues. Unfortunately it is too early to
switch from GNAT GPL 2009/10.

Dmitry A. Kazakov

unread,
Jul 13, 2010, 4:06:52 AM7/13/10
to

Thanks, but regarding APQ it might indeed be broken. Actually I ceased to
support APQ since GNAT 3.14, because APQ was not maintained. I happy to see
that Debian guys want to revive it.

Though I am very disappointed with the present status of DB support in Ada.
There are too many projects, bindings are too low level. None of them
attempt to make it platform independent. On the contrary, authors tend to
be as much DBMS dependent as possible. There was a discussion on this in
comp.lang.ada, people agreed to disagree.

tonyg

unread,
Jul 13, 2010, 4:37:21 AM7/13/10
to
On Jul 13, 9:06 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:

Totally - I found it very hard to find something useful, the odbc api
packages you wrote to use with your persistant objects proved very
useful though and I think they are probably the safest, most usable
and thickest binding ada programmers have available at the moment even
though it was originally written for your persistant objects. It
allows not so talented ada programmers like myself to use the gnade
ODBC binding which lets face it is a pretty intimidating if not
complicated beast.

Ludovic Brenta

unread,
Jul 13, 2010, 8:45:11 AM7/13/10
to
Dmitry A. Kazakov wrote:
> On Mon, 12 Jul 2010 22:36:09 +0200, Dirk Heinrichs wrote:
>> Dmitry A. Kazakov wrote:
>
>>> The version 3.9 has experimental packages for Debian and Fedora linux.
>>> Note that due to gcc 4.4 bugs not all features are available. See release
>>> notes:
>
>>>http://www.dmitry-kazakov.de/distributions/components_debian.htm
>
>> For which debian version are those packages? I assume "testing", because of
>> gcc 4.4.
>
> Yes it is the "squeeze".
>
>> OTOH you state that "APQ persistence layer is not supported because
>> APQ is not yet packaged.", but APQ packages are available for "testing". So
>> I'm a bit confused.
>
> It wasn't there last time I looked for it. Do you have the package names
> (bin and dev)? I will take a look.

libapq1-dev (database-independent part)
libapq-postgresql1-dev (PostgreSQL-specific part)

Thanks to Adrian-Ken Rueegsegger for these packages. Unfortunately no
other database-specific bindings are in Debian yet.

> P.S. In any case in order to use the persistent layer of Simple Components,
> the gcc 4.4 must be fixed first. The current version has controlled types
> broken and some other severe issues.

Wow, that's a pretty grave problem; if what you say is true, a fix in
the stable GCC 4.4 branch is justified. What is the bugzilla number
for this bug?

--
Ludovic Brenta.

Dmitry A. Kazakov

unread,
Jul 13, 2010, 12:35:38 PM7/13/10
to
On Tue, 13 Jul 2010 05:45:11 -0700 (PDT), Ludovic Brenta wrote:

> Dmitry A. Kazakov wrote:
>> On Mon, 12 Jul 2010 22:36:09 +0200, Dirk Heinrichs wrote:
>>> Dmitry A. Kazakov wrote:
>>
>>>> The version 3.9 has experimental packages for Debian and Fedora linux.
>>>> Note that due to gcc 4.4 bugs not all features are available. See release
>>>> notes:
>>
>>>>http://www.dmitry-kazakov.de/distributions/components_debian.htm
>>
>>> For which debian version are those packages? I assume "testing", because of
>>> gcc 4.4.
>>
>> Yes it is the "squeeze".
>>
>>> OTOH you state that "APQ persistence layer is not supported because
>>> APQ is not yet packaged.", but APQ packages are available for "testing". So
>>> I'm a bit confused.
>>
>> It wasn't there last time I looked for it. Do you have the package names
>> (bin and dev)? I will take a look.
>
> libapq1-dev (database-independent part)
> libapq-postgresql1-dev (PostgreSQL-specific part)

Thanks.

>> P.S. In any case in order to use the persistent layer of Simple Components,
>> the gcc 4.4 must be fixed first. The current version has controlled types
>> broken and some other severe issues.
>
> Wow, that's a pretty grave problem; if what you say is true, a fix in
> the stable GCC 4.4 branch is justified. What is the bugzilla number
> for this bug?

There are several. For example this one:

with Ada.Finalization;
with Ada.Unchecked_Deallocation;
with Ada.Text_IO;

procedure Controlled_Array is
type T is new Ada.Finalization.Limited_Controlled with record
C : Natural := 0;
end record;
overriding procedure Finalize (X : in out T);

procedure Finalize (X : in out T) is
begin
if X.C = 0 then
Ada.Text_IO.Put_Line ("Successful finalization");
else
Ada.Text_IO.Put_Line ("Illegal count in finalization" &
Integer'Image (X.C));
raise Program_Error;
end if;
end Finalize;

type T_Ptr is access T'Class;
type H is new Ada.Finalization.Controlled with record
P : T_Ptr;
end record;
overriding procedure Finalize (X : in out H);
overriding procedure Adjust (X : in out H);

procedure Finalize (X : in out H) is
procedure Free is new Ada.Unchecked_Deallocation (T'Class, T_Ptr);
begin
if X.P /= null then
X.P.C := X.P.C - 1;
if X.P.C = 0 then
Free (X.P);
end if;
end if;
end Finalize;
procedure Adjust (X : in out H) is
begin
X.P.C := X.P.C + 1;
end Adjust;

type H_Array is array (Positive range <>) of H;

function Create return H is
Result : H;
begin
Result.P := new T;
Result.P.C := 1;
return Result;
end Create;

List : H_Array := (Create, Create, Create);
First : T_Ptr := List (List'First).P;
begin
Ada.Text_IO.Put_Line ("Count" & Integer'Image (First.C));
end Controlled_Array;

Some others can be found in the Simple Components tests.

I am not sure if I posted any of them there. I did report to AdaCore. Most
of them were fixed prior GNAT GPL 2009 was published.

Is a merge with GPL 2009/10 planned? I am asking because I still don't
understand that complex mechanics governing FSF releases. In particular
merits of posting two-three years old bugs all fixed in GNAT GPL, like the
above bug.

I do have a base of bug reports I sent to AdaCore, but unfortunately I
cannot post most of them, because they contain proprietary code. Then, of
course, there are lots of bugs reported by other AdaCore customers. So my
uneducated guess, would rather be: let them do the merge first, and then
we'll see.

Warren

unread,
Jul 13, 2010, 12:59:13 PM7/13/10
to
Dmitry A. Kazakov expounded in
news:jxughzsu2k7.fi...@40tude.net:

> On Mon, 12 Jul 2010 15:09:26 -0700 (PDT), tonyg wrote:
>> On Jul 12, 9:36 pm, Dirk Heinrichs <dirk.heinri...@online.de> wrote:
>>> Dmitry A. Kazakov wrote:
>>>> The version 3.9 has experimental packages for Debian and Fedora
>>>> linux. Note that due to gcc 4.4 bugs not all features are
>>>> available. See release notes:
>>>
>>>>http://www.dmitry-kazakov.de/distributions/components_debian.htm
>>>
>>> For which debian version are those packages? I assume "testing",
>>> because of gcc 4.4. OTOH you state that "APQ persistence layer is
>>> not supported because APQ is not yet packaged.", but APQ packages
>>> are available for "testing". So I'm a bit confused.

>> I think this is because of the status of APQ rather than Dmitrys


>> code . I have used these component recently to implement a database
>> in odbc and I have to say it is very good and does the job. As to
>> which version, just use the gpr file as part of your gnat-gps project
>> and it works very very nice.
>
> Thanks, but regarding APQ it might indeed be broken. Actually I ceased
> to support APQ since GNAT 3.14, because APQ was not maintained. I
> happy to see that Debian guys want to revive it.

I believe that Marcelo Coraça de Freitas is still maintaining APQ. I
passed the reins over him some time ago and he has since moved his
support to the following site AFAIK:

http://framework.kow.com.br/projects/show/apq

The original (now unmaintained) site was/is here:

https://sourceforge.net/projects/apq

I just ran out of time to keep it up myself. In fact, <cough>,
I even gave up on Ada for a few years.. but I'm back now. ;-)

Warren

Simon Wright

unread,
Jul 13, 2010, 3:20:00 PM7/13/10
to
"Dmitry A. Kazakov" <mai...@dmitry-kazakov.de> writes:

> On Tue, 13 Jul 2010 05:45:11 -0700 (PDT), Ludovic Brenta wrote:

>>> P.S. In any case in order to use the persistent layer of Simple Components,
>>> the gcc 4.4 must be fixed first. The current version has controlled types
>>> broken and some other severe issues.
>>
>> Wow, that's a pretty grave problem; if what you say is true, a fix in
>> the stable GCC 4.4 branch is justified. What is the bugzilla number
>> for this bug?
>
> There are several. For example this one:

With GCC 4.5.0 and with GNAT GPL 2010 (both on Mac OS X Snow Leopard)
this program produces

$ ./controlled_array
Count 1
Successful finalization
Successful finalization
Successful finalization

With GNAT GPL 2010, -gnat05 is required:

GNATMAKE GPL 2010 (20100603)
Copyright (C) 1995-2010, Free Software Foundation, Inc.
gcc -c -O2 controlled_array.adb
controlled_array.adb:9:04: overriding indicator is an Ada 2005 extension
controlled_array.adb:9:04: unit must be compiled with -gnat05 switch
controlled_array.adb:26:04: overriding indicator is an Ada 2005 extension
controlled_array.adb:26:04: unit must be compiled with -gnat05 switch
controlled_array.adb:27:04: overriding indicator is an Ada 2005 extension
controlled_array.adb:27:04: unit must be compiled with -gnat05 switch
End of compilation

Dmitry A. Kazakov

unread,
Jul 13, 2010, 3:55:23 PM7/13/10
to
On Tue, 13 Jul 2010 20:20:00 +0100, Simon Wright wrote:

> "Dmitry A. Kazakov" <mai...@dmitry-kazakov.de> writes:
>
>> On Tue, 13 Jul 2010 05:45:11 -0700 (PDT), Ludovic Brenta wrote:
>
>>>> P.S. In any case in order to use the persistent layer of Simple Components,
>>>> the gcc 4.4 must be fixed first. The current version has controlled types
>>>> broken and some other severe issues.
>>>
>>> Wow, that's a pretty grave problem; if what you say is true, a fix in
>>> the stable GCC 4.4 branch is justified. What is the bugzilla number
>>> for this bug?
>>
>> There are several. For example this one:
>
> With GCC 4.5.0 and with GNAT GPL 2010 (both on Mac OS X Snow Leopard)
> this program produces
>
> $ ./controlled_array
> Count 1
> Successful finalization
> Successful finalization
> Successful finalization

This is how it should be.

Debian's or Fedora's gcc 4.4 spits:

Count 2
Illegal count in finalization 1

raised PROGRAM_ERROR : adjust/finalize raised PROGRAM_ERROR:
controlled_array.adb:18 explicit raise

Ludovic Brenta

unread,
Jul 14, 2010, 10:54:10 AM7/14/10
to
Dmitry A. Kazakov wrote on comp.lang.ada:


Looks like this might be the patch that corrects this bug:

2009-04-17 Thomas Quinot <qui...@adacore.com>

* exp_ch7.adb (Expand_Ctrl_Function_Call): Remove incorrect special
case for the case of an aggregate component, the attach call for the
result is actually needed.

* exp_aggr.adb (Backend_Processing_Possible): Backend processing for
an array aggregate must be disabled if the component type requires
controlled actions.

* exp_ch3.adb: Minor reformatting

I'll add a backport of this patch to my long TODO list.

--
Ludovic Brenta.

Ludovic Brenta

unread,
Aug 3, 2010, 1:44:50 PM8/3/10
to
I wrote on comp.lang.ada:


The backport actually worked and the compiler in Debian unstable is now
fixed. The fix will migrate to testing in a few days. Thank you for
reporting.

--
Ludovic Brenta.

Dmitry A. Kazakov

unread,
Aug 3, 2010, 3:28:33 PM8/3/10
to

Great news, thank you.

0 new messages