From: tonyg on
On Jul 13, 9:06 am, "Dmitry A. Kazakov" <mail...(a)dmitry-kazakov.de>
wrote:
> On Mon, 12 Jul 2010 15:09:26 -0700 (PDT), tonyg wrote:
> > On Jul 12, 9:36 pm, Dirk Heinrichs <dirk.heinri...(a)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.
>
> >> Bye...
>
> >>         Dirk
>
> > 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.
>
> 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.
>
> --
> Regards,
> Dmitry A. Kazakovhttp://www.dmitry-kazakov.de

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.
From: Ludovic Brenta on
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.
From: Dmitry A. Kazakov on
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.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Warren on
Dmitry A. Kazakov expounded in
news:jxughzsu2k7.fihzowngjkpt.dlg(a)40tude.net:

> On Mon, 12 Jul 2010 15:09:26 -0700 (PDT), tonyg wrote:
>> On Jul 12, 9:36�pm, Dirk Heinrichs <dirk.heinri...(a)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
From: Simon Wright on
"Dmitry A. Kazakov" <mailbox(a)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