comp.lang.ada
 help / color / mirror / Atom feed
* GNAT GPL Edition - on the plus side
@ 2005-10-14  1:41 Steve
  2005-10-14  4:44 ` randomm
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Steve @ 2005-10-14  1:41 UTC (permalink / raw)


My experience:

GNAT GPL Edition includes the first version of GPS I have run on Windows 
that I haven't removed after a few days of frustration.

The compiler seems to just plain work (as usual).

I do find that the pretty-printer gets confused with Ada 2005 code.

IMHO the folks at AdaCore have done a great job.

Steve
(The Duck) 





^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14  1:41 GNAT GPL Edition - on the plus side Steve
@ 2005-10-14  4:44 ` randomm
  2005-10-14 10:12   ` Alex R. Mosteo
  2005-10-19  6:06   ` jussij
  2005-10-14  5:55 ` Simon Wright
  2005-10-14  8:10 ` Dmitry A. Kazakov
  2 siblings, 2 replies; 24+ messages in thread
From: randomm @ 2005-10-14  4:44 UTC (permalink / raw)


Steve wrote:
> My experience:
>
> GNAT GPL Edition includes the first version of GPS I have run on Windows
> that I haven't removed after a few days of frustration.

I think GPS is dreadful; it has an outmoded look and feel and I am
probably missing something, but it never seems to remember the most
recent project, instead defaulting to the BIN installation directory
which is very frustrating.   When it comes time to buy a compiler and
IDE, I'll be looking for a toolset which is a little friendlier and
more modern-looking.

Even though it's not fancy, John English's GnatIDE 1.4 is a lot easier
to use, at least with small projects.  (Thanks, Doc!)  It seems to be
smarter about things like naming Ada body files, etc.

> The compiler seems to just plain work (as usual).

True enough...

I'm new to Ada, but I've been writing code for a long time.  This may
be a testament to Ada standards as much as to GNAT, but I haven't seen
any compiler (aside from GNAT 3.15p) which ate up everything in any
example I cut-and-pasted from any source (online tutorial, text book,
etc.)  That is certainly an extremely valuable aspect of Ada and GNAT-
uniformity is good for beginners and pros alike.

snip

> IMHO the folks at AdaCore have done a great job.

Ditto!  And you can't beat the price.

Rand




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14  1:41 GNAT GPL Edition - on the plus side Steve
  2005-10-14  4:44 ` randomm
@ 2005-10-14  5:55 ` Simon Wright
  2005-10-14  8:10 ` Dmitry A. Kazakov
  2 siblings, 0 replies; 24+ messages in thread
From: Simon Wright @ 2005-10-14  5:55 UTC (permalink / raw)


"Steve" <nospam_steved94@comcast.net> writes:

> GNAT GPL Edition includes the first version of GPS I have run on Windows 
> that I haven't removed after a few days of frustration.

And for Mac OS X, too. (It's an X application, no problem there).

I'm an Emacs person, but GPS is certainly the interface I'd use and
recommend for anything other than the simplest debugging.

> The compiler seems to just plain work (as usual).

Also the debugger. There was an Ada-aware debugger before, a little
old perhaps.

> IMHO the folks at AdaCore have done a great job.

Yes indeed!



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14  1:41 GNAT GPL Edition - on the plus side Steve
  2005-10-14  4:44 ` randomm
  2005-10-14  5:55 ` Simon Wright
@ 2005-10-14  8:10 ` Dmitry A. Kazakov
  2005-10-14  9:36   ` Martin Dowie
                     ` (3 more replies)
  2 siblings, 4 replies; 24+ messages in thread
From: Dmitry A. Kazakov @ 2005-10-14  8:10 UTC (permalink / raw)


On Thu, 13 Oct 2005 18:41:01 -0700, Steve wrote:

> GNAT GPL Edition includes the first version of GPS I have run on Windows 
> that I haven't removed after a few days of frustration.

I tried it and then removed after two days.
 
> The compiler seems to just plain work (as usual).

As usual, you said? I have an impression that the compiler has no less bugs
than 3.15p had, maybe more. This time I was unable to work around its new
bugs in generics (some old ones are still there.) This is different to my
previous [nasty] experience with 3.15p generics. So far I managed to find a
way around. But with GNAT GPL it looks somewhat hopeless. Especially
because of its habit to report errors upon instantiation, do they use C
preprocessor, or what? (:-))

> IMHO the folks at AdaCore have done a great job.

Well, IDE was significantly improved. Though with a crippled compiler it
makes little sense, especially if we are talking about an *Ada* compiler!

I would do appreciate if they redesigned generics from scratch. Generics
never worked right in GNAT. It looks much like an architectural problem...
Maybe then they could finally make generic bodies reusable, error messages
meaningful, generic specifications compilable etc...

Also, I think, they could publish under [GM]GPL their compiler test suite.

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



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14  8:10 ` Dmitry A. Kazakov
@ 2005-10-14  9:36   ` Martin Dowie
  2005-10-14 13:13   ` Marc A. Criley
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 24+ messages in thread
From: Martin Dowie @ 2005-10-14  9:36 UTC (permalink / raw)


Dmitry A. Kazakov wrote:
> Also, I think, they could publish under [GM]GPL their compiler test
> suite.

That's /never/ going to happen. the ACATS tests are freely available but a
_huge_ amount of any compiler vendors tests are built around actual costumer
source code (under appropriate non-disclosure agreements). This is true for
test tools companies, CASE tool vendors, etc.

Cheers

-- Martin





^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14  4:44 ` randomm
@ 2005-10-14 10:12   ` Alex R. Mosteo
  2005-10-14 10:37     ` Martin Dowie
  2005-10-19  6:06   ` jussij
  1 sibling, 1 reply; 24+ messages in thread
From: Alex R. Mosteo @ 2005-10-14 10:12 UTC (permalink / raw)


randomm@mindless.com wrote:
> Steve wrote:
> 
>>My experience:
>>
>>GNAT GPL Edition includes the first version of GPS I have run on Windows
>>that I haven't removed after a few days of frustration.
> 
> 
> I think GPS is dreadful; it has an outmoded look and feel and I am
> probably missing something, but it never seems to remember the most
> recent project, instead defaulting to the BIN installation directory
> which is very frustrating.   When it comes time to buy a compiler and
> IDE, I'll be looking for a toolset which is a little friendlier and
> more modern-looking.

I'm over the fence on GPS. In one hand, it gets better and better with 
each release, but is kind of an "Ada beast", you feel quite alone using 
it. On the other hand, I recently tried Eclipse and was stunned; it's 
amazing. Sometimes I fantasize over the idea that Adacore invested 
effort in a full featured Eclipse plugin*. The idea that you're in the 
same boat with a lot of other developers outside of the Ada world is 
attractive for me.

[*] I know that there's one for sale by <argh, memory fails>, and at 
least two voluntary efforts going on.

> Even though it's not fancy, John English's GnatIDE 1.4 is a lot easier
> to use, at least with small projects.  (Thanks, Doc!)  It seems to be
> smarter about things like naming Ada body files, etc.
> 
> 
>>The compiler seems to just plain work (as usual).
> 
> 
> True enough...
> 
> I'm new to Ada, but I've been writing code for a long time.  This may
> be a testament to Ada standards as much as to GNAT, but I haven't seen
> any compiler (aside from GNAT 3.15p) which ate up everything in any
> example I cut-and-pasted from any source (online tutorial, text book,
> etc.)  That is certainly an extremely valuable aspect of Ada and GNAT-
> uniformity is good for beginners and pros alike.
> 
> snip
> 
> 
>>IMHO the folks at AdaCore have done a great job.
> 
> 
> Ditto!  And you can't beat the price.
> 
> Rand
> 



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14 10:12   ` Alex R. Mosteo
@ 2005-10-14 10:37     ` Martin Dowie
  0 siblings, 0 replies; 24+ messages in thread
From: Martin Dowie @ 2005-10-14 10:37 UTC (permalink / raw)


Alex R. Mosteo wrote:
> [*] I know that there's one for sale by <argh, memory fails>, and at
> least two voluntary efforts going on.

By Aonix - it supports GNAT too though! :-)

Don't now if they have any plans to release it 'free' but it would seem hard
to limit its capabilities if they did release a 'demo' version with the
upcoming 8.x release for Windows. You'd need an 'eclipse-and-ada-aware' GDB
and I'm not sure such a beast exists...

Cheers

-- Martin






^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14  8:10 ` Dmitry A. Kazakov
  2005-10-14  9:36   ` Martin Dowie
@ 2005-10-14 13:13   ` Marc A. Criley
  2005-10-14 17:12     ` Dmitry A. Kazakov
  2005-10-14 13:50   ` Steve
  2005-10-14 17:42   ` Pascal Obry
  3 siblings, 1 reply; 24+ messages in thread
From: Marc A. Criley @ 2005-10-14 13:13 UTC (permalink / raw)


Dmitry A. Kazakov wrote:

> I would do appreciate if they redesigned generics from scratch. Generics
> never worked right in GNAT. It looks much like an architectural problem...
> Maybe then they could finally make generic bodies reusable, error messages
> meaningful, generic specifications compilable etc...

What the Hell kind of code do you write??  :-) :-)

I've used GNAT for a long time, and 3.15p almost since the day it was 
released, and in all those years have run into only a single handful of 
bugs in the compiler--there've been a few in ASIS I've had to work around.

Right now the released version of DTraq is a heavy user of generics, and 
there have been no observed ill effects in that area.  (The next version 
that's under development, though, significantly reduces that use, though 
for a totally unrelated redesign reason.)  DTraq is over 40 KSLOC, so 
it's not a trivial amount of code, plus a few years ago I ported a 90 
KSLOC command and control system to GNAT 3.14, which never encountered 
any problems due to compiler bugs.

-- Marc A. Criley
-- McKae Technologies
-- www.mckae.com
-- DTraq - XPath In Ada - XML EZ Out



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14  8:10 ` Dmitry A. Kazakov
  2005-10-14  9:36   ` Martin Dowie
  2005-10-14 13:13   ` Marc A. Criley
@ 2005-10-14 13:50   ` Steve
  2005-10-14 17:25     ` Dmitry A. Kazakov
  2005-10-14 17:42   ` Pascal Obry
  3 siblings, 1 reply; 24+ messages in thread
From: Steve @ 2005-10-14 13:50 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:1u927xnbmsfw1$.1xg4jk31952ts$.dlg@40tude.net...
> On Thu, 13 Oct 2005 18:41:01 -0700, Steve wrote:
>
>> GNAT GPL Edition includes the first version of GPS I have run on Windows
>> that I haven't removed after a few days of frustration.
>
> I tried it and then removed after two days.
>
>> The compiler seems to just plain work (as usual).
>
> As usual, you said? I have an impression that the compiler has no less 
> bugs
> than 3.15p had, maybe more. This time I was unable to work around its new
> bugs in generics (some old ones are still there.) This is different to my
> previous [nasty] experience with 3.15p generics. So far I managed to find 
> a
> way around. But with GNAT GPL it looks somewhat hopeless. Especially
> because of its habit to report errors upon instantiation, do they use C
> preprocessor, or what? (:-))
>

Did you report these bugs to AdaCore with test cases?

In my experience, even if you're not a supported customer, they eventually 
get fixed.  Sometimes rather quickly.

Steve
(The Duck)


[snip]
>
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de 





^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14 13:13   ` Marc A. Criley
@ 2005-10-14 17:12     ` Dmitry A. Kazakov
  2005-10-14 19:05       ` Georg Bauhaus
  2005-10-15  0:00       ` Randy Brukardt
  0 siblings, 2 replies; 24+ messages in thread
From: Dmitry A. Kazakov @ 2005-10-14 17:12 UTC (permalink / raw)


On Fri, 14 Oct 2005 08:13:16 -0500, Marc A. Criley wrote:

> Dmitry A. Kazakov wrote:
> 
>> I would do appreciate if they redesigned generics from scratch. Generics
>> never worked right in GNAT. It looks much like an architectural problem...
>> Maybe then they could finally make generic bodies reusable, error messages
>> meaningful, generic specifications compilable etc...
> 
> What the Hell kind of code do you write??  :-) :-)

Not a rocket science, I assure you... (:-))

Well, I have posted one trivial example. But it is short, so I believe I
can repeat it here:

generic
   type T is digits <>;
package A is
end A;
-----------------------------
with A;
generic
   with package AA is new A (<>);
package B is
end B;
----------------------------
with B;
generic
   with package BB is new B (<>);
package C is
   X : BB.AA.T; -- So far OK
end C;
---------------------------
with A;
generic
   with package AA is new A (<>);
package E is
end E;
--------------------------
with B, E;
generic
   with package BB is new B (<>);
   with package EE is new E (BB.AA);
package D is
   X : BB.AA.T; -- "T" is not a visible entity of "AA" in GNAT GPL
end D;

The above is successfully compiled by 3.15p, BTW.

> I've used GNAT for a long time, and 3.15p almost since the day it was 
> released, and in all those years have run into only a single handful of 
> bugs in the compiler--there've been a few in ASIS I've had to work around.

I am using it since early 90s. The first case was an Ada 83 program ported
from DEC Ada. Guess what? GNAT failed to compile it because on generics!
(:-))

> Right now the released version of DTraq is a heavy user of generics, and 
> there have been no observed ill effects in that area.  (The next version 
> that's under development, though, significantly reduces that use, though 
> for a totally unrelated redesign reason.)  DTraq is over 40 KSLOC, so 
> it's not a trivial amount of code, plus a few years ago I ported a 90 
> KSLOC command and control system to GNAT 3.14, which never encountered 
> any problems due to compiler bugs.

It is not the size of code which causes problems. It is the visibility
rules and names of formal and actual parameters, as far as I can tell. It
seems that GNAT somehow messes up the names of the actual parameters with
ones of the formal parameters upon instantiation. At least some problems
can be circumventing by avoiding actual and formal parameter having the
same name! (:-))

The example as above is largely a result of Ada's inability to have
multiple package parents (*alas!*) and/or specializations (*alas!*). I
often need awful:

generic
   with type A ...;
   with type B ...;
   with package Foo is new Gen_Foo (A, B);
   with package Foo1 is new Gen_Foo1 (A, B, Foo);
   with package Foo2 is new Get_Foo1 (A, B, Foo, Foo1);  -- One path
   
   with type B ...;
   with package Bar is new Gen_Bar (B);
   with package Bar1 is new Get_Bar1 (B, Bar); -- Another path

   -- etc
package Gen_Baz ...

To reduce instantiation nightmare with above you could take the actual
parameters from other formal parameters:

generic
   with package Foo is new Gen_Foo (<>);
package Gen_Foo1 is ...
   use Foo; -- Got A and B

generic
   with package Foo1 is new Gen_Foo1 (<>);
package Gen_Foo2 is ...
   use Foo1;
   use Foo; -- Got A and B

This is along one path. Alternatively you could use children, but that
would have a sufficient drawback: you could not leave the path because the
following is illegal:

generic
   with package Foo2 is new Gen_Foo.Gen_Foo1.Gen_Foo2 (<>);
package Baz is ...

[*why should it be so?!*]

Now between the paths there is no other choice than:

generic
   with package Foo2 is new Gen_Foo2 (<>); -- One path
   with package Bar is new Gen_Bar (Foo2.Foo1.Foo.B); -- Get what it has
   with package Bar1 is new Gen_Bar1 (Bar); -- Get what it has
package Baz ...

It is still uncomfortable. But much simpler to maintain.

For GNAT it is a great challenge to detect that Foo2.Foo1.Foo.B, Bar.B is
actually the *same* type when both packages are use-d in Baz! Add here
couple of type "renaming" [done through subtypes] to complete the
picture... (:-))

[rant on]

Why Ada generics do not have boxes for individual parameters? Why Ada
generics do not have specializations?

Anyway, generics and templates are inherently a mess, but that is another
story. (:-))

[rant off]

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



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14 13:50   ` Steve
@ 2005-10-14 17:25     ` Dmitry A. Kazakov
  2005-10-14 18:58       ` Georg Bauhaus
  2005-10-15  1:45       ` Steve
  0 siblings, 2 replies; 24+ messages in thread
From: Dmitry A. Kazakov @ 2005-10-14 17:25 UTC (permalink / raw)


On Fri, 14 Oct 2005 06:50:50 -0700, Steve wrote:

> Did you report these bugs to AdaCore with test cases?

Maybe, if I knew where to submit bugs...

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



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14  8:10 ` Dmitry A. Kazakov
                     ` (2 preceding siblings ...)
  2005-10-14 13:50   ` Steve
@ 2005-10-14 17:42   ` Pascal Obry
  3 siblings, 0 replies; 24+ messages in thread
From: Pascal Obry @ 2005-10-14 17:42 UTC (permalink / raw)
  To: mailbox

Dmitry,

> As usual, you said? I have an impression that the compiler has no less bugs
> than 3.15p had, maybe more. This time I was unable to work around its new
> bugs in generics (some old ones are still there.) This is different to my
> previous [nasty] experience with 3.15p generics. So far I managed to find a
> way around. But with GNAT GPL it looks somewhat hopeless. Especially
> because of its habit to report errors upon instantiation, do they use C
> preprocessor, or what? (:-))

Looks like you are trying to use GNAT to compile something else than Ada
to me ;)

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14 17:25     ` Dmitry A. Kazakov
@ 2005-10-14 18:58       ` Georg Bauhaus
  2005-10-15  9:31         ` Dmitry A. Kazakov
  2005-10-15  1:45       ` Steve
  1 sibling, 1 reply; 24+ messages in thread
From: Georg Bauhaus @ 2005-10-14 18:58 UTC (permalink / raw)


Dmitry A. Kazakov wrote:
> On Fri, 14 Oct 2005 06:50:50 -0700, Steve wrote:
> 
> 
>>Did you report these bugs to AdaCore with test cases?
> 
> 
> Maybe, if I knew where to submit bugs...
> 

For AdaCore releases, there is a report-address.
FSF GNAT bugs can be reported following the procedure
described in
http://gcc.gnu.org/bugs.html#gnat

Debian GNAT bugs can be reported using, for example,
the reportbug program contained in the distribution.




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14 17:12     ` Dmitry A. Kazakov
@ 2005-10-14 19:05       ` Georg Bauhaus
  2005-10-15  9:28         ` Dmitry A. Kazakov
  2005-10-15  0:00       ` Randy Brukardt
  1 sibling, 1 reply; 24+ messages in thread
From: Georg Bauhaus @ 2005-10-14 19:05 UTC (permalink / raw)


Dmitry A. Kazakov wrote:

> It
> seems that GNAT somehow messes up the names of the actual parameters with
> ones of the formal parameters upon instantiation. At least some problems
> can be circumventing by avoiding actual and formal parameter having the
> same name! (:-))

Even when GNAT doesn't properly handle the load of overload,
this defect might actually help improve software quality. :-)
A one-name-for-one-thing-rule has made it into a programming
language standard (Eiffel), and I think the rule is justified.


-- Georg 



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14 17:12     ` Dmitry A. Kazakov
  2005-10-14 19:05       ` Georg Bauhaus
@ 2005-10-15  0:00       ` Randy Brukardt
  2005-10-15 14:45         ` Robert A Duff
  1 sibling, 1 reply; 24+ messages in thread
From: Randy Brukardt @ 2005-10-15  0:00 UTC (permalink / raw)



"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:b4p2ksjzkv4m.6ghazx68f8js.dlg@40tude.net...
> [rant on]
>
> Why Ada generics do not have boxes for individual parameters?

Ada 200Y does allow mixing of <> and specified parameters in generic formal
packages. Also, the rules for what's visible were clarified. Probably GNAT's
implementation of these changes is what is causing your troubles.

I tried to get more kinds of default parameters for generics, but that
effort failed (mainly because some people seem to hate defaults of any
kind -- there didn't seem to be any technical objections).

> Why Ada
> generics do not have specializations?
>
> Anyway, generics and templates are inherently a mess, but that is another
> story. (:-))

Perhaps because we haven't seen any crying need. I, for one would prefer to
reduce the need for generics than to pile on more features. You have said in
the past that generics are unnecessary with good OOP, and I tend to agree. I
think pretty much everything should be a tagged type derived from
Controlled, and that fact, combined with decent access-to-subprograms and
interfaces, eliminate much of the need for generics. (Of course, if you
insist on supporting archaic untagged types, then you do need generics.)

> [rant off]

Same here.

                         Randy.







^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14 17:25     ` Dmitry A. Kazakov
  2005-10-14 18:58       ` Georg Bauhaus
@ 2005-10-15  1:45       ` Steve
  2005-10-15 11:18         ` Simon Wright
  1 sibling, 1 reply; 24+ messages in thread
From: Steve @ 2005-10-15  1:45 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:6yg8ewew8yr4.1fheysngk7pa4.dlg@40tude.net...
> On Fri, 14 Oct 2005 06:50:50 -0700, Steve wrote:
>
>> Did you report these bugs to AdaCore with test cases?
>
> Maybe, if I knew where to submit bugs...
>

The last I knew it was:
  report@gnat.com

Steve
(The Duck)


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





^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14 19:05       ` Georg Bauhaus
@ 2005-10-15  9:28         ` Dmitry A. Kazakov
  0 siblings, 0 replies; 24+ messages in thread
From: Dmitry A. Kazakov @ 2005-10-15  9:28 UTC (permalink / raw)


On Fri, 14 Oct 2005 21:05:31 +0200, Georg Bauhaus wrote:

> Dmitry A. Kazakov wrote:
> 
>> It
>> seems that GNAT somehow messes up the names of the actual parameters with
>> ones of the formal parameters upon instantiation. At least some problems
>> can be circumventing by avoiding actual and formal parameter having the
>> same name! (:-))
> 
> Even when GNAT doesn't properly handle the load of overload,
> this defect might actually help improve software quality. :-)

Well, GNAT bugs often forced me to review my designs. It always is a good
idea to review... though I wouldn't give compiler bugs honor for that. Of
course if the error message were: "sorry, at the moment we cannot compile
your legal code, but if you change this and that ..." BTW, GNAT often says
X is invisible (because of ...) but *a* use clause might make it visible.
But it never reveals which one! (:-))

> A one-name-for-one-thing-rule has made it into a programming
> language standard (Eiffel), and I think the rule is justified.

Ooch, do you seriously claim that the following should be outlawed:

   procedure Foo (X : in out Integer);
--------------------------
   X : Integer;
begin
   Foo (X); -- Illegal: the same name for actual and formal! (:-))

BTW, the above is not one name, one thing. It is one name, two things.

If you really wanted to have one name, one thing, you ought to disallow all
sorts of renaming and use-ing. I don't think that would be a good idea. It
is true that renaming in Ada have problems, but those are rather design
problems, which can be relatively easily fixed:

1. Renaming should keep contracts
(Example: renaming that shifts array index shall either be illegal or
indeed shift it)

2. Renaming shall never, under any circumstances be able to hide the thing
it renames.

3. There must be renaming for types. It follows from 2, and anyway,

subtype S is T;

is a fundamentally different thing.

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



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14 18:58       ` Georg Bauhaus
@ 2005-10-15  9:31         ` Dmitry A. Kazakov
  0 siblings, 0 replies; 24+ messages in thread
From: Dmitry A. Kazakov @ 2005-10-15  9:31 UTC (permalink / raw)


On Fri, 14 Oct 2005 20:58:55 +0200, Georg Bauhaus wrote:

> For AdaCore releases, there is a report-address.
> FSF GNAT bugs can be reported following the procedure
> described in
> http://gcc.gnu.org/bugs.html#gnat

Thanks

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



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-15  1:45       ` Steve
@ 2005-10-15 11:18         ` Simon Wright
  0 siblings, 0 replies; 24+ messages in thread
From: Simon Wright @ 2005-10-15 11:18 UTC (permalink / raw)


"Steve" <nospam_steved94@comcast.net> writes:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
> news:6yg8ewew8yr4.1fheysngk7pa4.dlg@40tude.net...
>> On Fri, 14 Oct 2005 06:50:50 -0700, Steve wrote:
>>
>>> Did you report these bugs to AdaCore with test cases?
>>
>> Maybe, if I knew where to submit bugs...
>>
>
> The last I knew it was:
>   report@gnat.com

You (used to) need to include GNAT in the subject line (spam filter
their end).



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-15  0:00       ` Randy Brukardt
@ 2005-10-15 14:45         ` Robert A Duff
  2005-10-15 16:14           ` Dmitry A. Kazakov
  0 siblings, 1 reply; 24+ messages in thread
From: Robert A Duff @ 2005-10-15 14:45 UTC (permalink / raw)


"Randy Brukardt" <randy@rrsoftware.com> writes:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:b4p2ksjzkv4m.6ghazx68f8js.dlg@40tude.net...
> > Anyway, generics and templates are inherently a mess, but that is another
> > story. (:-))
> 
> Perhaps because we haven't seen any crying need. I, for one would prefer to
> reduce the need for generics than to pile on more features. You have said in
> the past that generics are unnecessary with good OOP, and I tend to agree.

Could either or both of you explain why generics are unnecessary
(i.e. what changes to Ada's OOP would make them unnecessary).

In particular, I want to be able to have a container type tied to the
type of its elements (perhaps class-wide).  If I have a "sequence of
T'Class", and I put something in it, and take it back out, I don't want
to lose the fact that this element is somewhere in the T'Class
hierarchy.  Generics seem to work well for that.

How would you define the "sequence" abstraction without generics?

- Bob



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-15 14:45         ` Robert A Duff
@ 2005-10-15 16:14           ` Dmitry A. Kazakov
  2005-10-16  0:48             ` Robert A Duff
  0 siblings, 1 reply; 24+ messages in thread
From: Dmitry A. Kazakov @ 2005-10-15 16:14 UTC (permalink / raw)


On 15 Oct 2005 10:45:39 -0400, Robert A Duff wrote:

> "Randy Brukardt" <randy@rrsoftware.com> writes:
> 
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>> news:b4p2ksjzkv4m.6ghazx68f8js.dlg@40tude.net...
>>> Anyway, generics and templates are inherently a mess, but that is another
>>> story. (:-))
>> 
>> Perhaps because we haven't seen any crying need. I, for one would prefer to
>> reduce the need for generics than to pile on more features.

Absolutely.

>> You have said in
>> the past that generics are unnecessary with good OOP, and I tend to agree.
> 
> Could either or both of you explain why generics are unnecessary
> (i.e. what changes to Ada's OOP would make them unnecessary).
> 
> In particular, I want to be able to have a container type tied to the
> type of its elements (perhaps class-wide).  If I have a "sequence of
> T'Class", and I put something in it, and take it back out, I don't want
> to lose the fact that this element is somewhere in the T'Class
> hierarchy.  Generics seem to work well for that.
> 
> How would you define the "sequence" abstraction without generics?

I am not sure I have understood what you meant, but it seems to me that you
want containers constrained to a particular type. I see no great problem
here. Already Ada 83 handled some constraints without any generics:

type String is ...;
subtype Punch_Card is String (1..80); -- Range constraint

We could extend this idea allowing type constraints:

type Container (...) is array (...) of Element'Class;
type Foo is new Element ...;

subtype Foo_Container is
   Container (some sugar to constrain Element'Class to Foo'Class);

As an additional advantage over generics Foo_Container can be used in all
subprograms expecting Container'Class. Otherwise, Foo_Container can be
declared as:

type Foo_Container is new
   Container (some sugar to constrain Element'Class to Foo'Class);

here "is new" has old, Ada 83 sense: create an anonymous copy of Container,
make a constrained subtype and name it Foo_Container.

[It was very unfortunate that Ada 95 used "is new" for inheritance.]

Generally, I think that in all cases when one type is composed out of some
other types (be it a record, array, access etc type) there should be a
unified language-defined way to create constrained subtypes. Maybe
explicitly via discriminants:

type Ptr (Target : T'Tag) is access T'Class (Target);
subtype Ptr_To_A is Ptr (Target => A'Tag);

Maybe implicitly assuming discriminats or attributes for constraints
everywhere.

I believe, this all is equivalent to having "type discriminants", which is
pretty close to usual intent of a programmer using generics, though on a
completely different basis.

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



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-15 16:14           ` Dmitry A. Kazakov
@ 2005-10-16  0:48             ` Robert A Duff
  2005-10-16  9:56               ` Dmitry A. Kazakov
  0 siblings, 1 reply; 24+ messages in thread
From: Robert A Duff @ 2005-10-16  0:48 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> I am not sure I have understood what you meant,...

From your response, I think you understand exactly what I meant.  You
propose passing type parameters to (generic) types as opposed to passing
type parameters to (generic) packages.  Yes, that's a lot like
discriminants, and I've thought of the same thing myself.

But it's still a lot like generics -- instead of generic packages, we
have generic types.  (In fact, in Eiffel, you have generic classes.)

I don't much like the macro-expansion-like semantics of Ada generics
(though it's better in some ways than C++ templates).  The need is for
"types parameterized by types".  Ada generics do that, and perhaps some
magical discriminants could, too, and perhaps that would be more
convenient.

Are we agreeing or disagreeing, here?

- Bob



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-16  0:48             ` Robert A Duff
@ 2005-10-16  9:56               ` Dmitry A. Kazakov
  0 siblings, 0 replies; 24+ messages in thread
From: Dmitry A. Kazakov @ 2005-10-16  9:56 UTC (permalink / raw)


On 15 Oct 2005 20:48:29 -0400, Robert A Duff wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> 
>> I am not sure I have understood what you meant,...
> 
> From your response, I think you understand exactly what I meant.  You
> propose passing type parameters to (generic) types as opposed to passing
> type parameters to (generic) packages.  Yes, that's a lot like
> discriminants, and I've thought of the same thing myself.
> 
> But it's still a lot like generics -- instead of generic packages, we
> have generic types.  (In fact, in Eiffel, you have generic classes.)

[ Parametric types, Ada has them since its first day, they aren't
"instead". ]

> I don't much like the macro-expansion-like semantics of Ada generics
> (though it's better in some ways than C++ templates).  The need is for
> "types parameterized by types".  Ada generics do that, and perhaps some
> magical discriminants could, too, and perhaps that would be more
> convenient.
> 
> Are we agreeing or disagreeing, here?

Yes we are.

Though to expand on it a bit, the problem as I see it, is not in what
generics do, but in how they do it and what they are. The root of evil in
generics is not even clumsy syntax, unintelligible error messages,
geometric explosion of instances and formal parameters, name space
pollution etc. It is that the generic entity is not a proper object. Only
its instance is. You cannot do anything with a set of different instances
of the *same* generic. What makes OOP so attractive, though it might be far
more limited than generics, is that you can have T'Class. This pays off
all!

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



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNAT GPL Edition - on the plus side
  2005-10-14  4:44 ` randomm
  2005-10-14 10:12   ` Alex R. Mosteo
@ 2005-10-19  6:06   ` jussij
  1 sibling, 0 replies; 24+ messages in thread
From: jussij @ 2005-10-19  6:06 UTC (permalink / raw)


> When it comes time to buy a compiler and IDE, I'll be
> looking for a toolset which is a little friendlier and
> more modern-looking.

For your IDE you should have a look at Zeus:

   http://www.zeusedit.com/features.html
   Note: Zeus is shareware (45 day trial).

Zeus attempts to be language neutral in that it can be
configured for almost any language.

It has features like class browsing, syntax highlighting,
smart indent, code folding, project/workspace management,
integrated version control etc and can be configured
for almost any language and any tool set.

Jussi Jumppanen
Author: Zeus for Windows




^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2005-10-19  6:06 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-14  1:41 GNAT GPL Edition - on the plus side Steve
2005-10-14  4:44 ` randomm
2005-10-14 10:12   ` Alex R. Mosteo
2005-10-14 10:37     ` Martin Dowie
2005-10-19  6:06   ` jussij
2005-10-14  5:55 ` Simon Wright
2005-10-14  8:10 ` Dmitry A. Kazakov
2005-10-14  9:36   ` Martin Dowie
2005-10-14 13:13   ` Marc A. Criley
2005-10-14 17:12     ` Dmitry A. Kazakov
2005-10-14 19:05       ` Georg Bauhaus
2005-10-15  9:28         ` Dmitry A. Kazakov
2005-10-15  0:00       ` Randy Brukardt
2005-10-15 14:45         ` Robert A Duff
2005-10-15 16:14           ` Dmitry A. Kazakov
2005-10-16  0:48             ` Robert A Duff
2005-10-16  9:56               ` Dmitry A. Kazakov
2005-10-14 13:50   ` Steve
2005-10-14 17:25     ` Dmitry A. Kazakov
2005-10-14 18:58       ` Georg Bauhaus
2005-10-15  9:31         ` Dmitry A. Kazakov
2005-10-15  1:45       ` Steve
2005-10-15 11:18         ` Simon Wright
2005-10-14 17:42   ` Pascal Obry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox