* Gnat 2013 is out! @ 2013-05-29 13:36 J-P. Rosen 2013-05-29 15:03 ` Simon Wright ` (6 more replies) 0 siblings, 7 replies; 55+ messages in thread From: J-P. Rosen @ 2013-05-29 13:36 UTC (permalink / raw) Just connected to libre and surprise! The site proposed the 2013 edition! -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-29 13:36 Gnat 2013 is out! J-P. Rosen @ 2013-05-29 15:03 ` Simon Wright 2013-05-29 16:13 ` Simon Wright 2013-05-30 0:31 ` Dennis Lee Bieber ` (5 subsequent siblings) 6 siblings, 1 reply; 55+ messages in thread From: Simon Wright @ 2013-05-29 15:03 UTC (permalink / raw) "J-P. Rosen" <rosen@adalog.fr> writes: > Just connected to libre and surprise! The site proposed the 2013 edition! Thank you, AdaCore! And it happily ran the Booch Components test suite .. phew. But it's reporting a problem with my Ada 2005 Math Extensions .. not so good (for me). Ada 2012 is now the default. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-29 15:03 ` Simon Wright @ 2013-05-29 16:13 ` Simon Wright 2013-05-29 22:39 ` Randy Brukardt 0 siblings, 1 reply; 55+ messages in thread From: Simon Wright @ 2013-05-29 16:13 UTC (permalink / raw) Simon Wright <simon@pushface.org> writes: > But it's reporting a problem with my Ada 2005 Math Extensions .. not > so good (for me). Turned out to be a warning new to GNAT GPL 2013 (also in GCC 4.8.0): I had a subprogram with two out parameters that designated the same object. It was a dummy, though, so no harm done. ada_numerics-generic_arrays.adb:325:28: warning: writable actual for "V_L" overlaps with actual for "V_R" ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-29 16:13 ` Simon Wright @ 2013-05-29 22:39 ` Randy Brukardt 2013-05-30 2:01 ` Adam Beneschan 0 siblings, 1 reply; 55+ messages in thread From: Randy Brukardt @ 2013-05-29 22:39 UTC (permalink / raw) "Simon Wright" <simon@pushface.org> wrote in message news:lyd2s99324.fsf@pushface.org... > Simon Wright <simon@pushface.org> writes: > >> But it's reporting a problem with my Ada 2005 Math Extensions .. not >> so good (for me). > > Turned out to be a warning new to GNAT GPL 2013 (also in GCC 4.8.0): I > had a subprogram with two out parameters that designated the same > object. It was a dummy, though, so no harm done. > > ada_numerics-generic_arrays.adb:325:28: warning: writable actual for > "V_L" overlaps with actual for "V_R" You do know that's illegal in some cases in Ada 2012? (A known and intended incompatibility.) I wouldn't be surprised if GNAT is putting out a warning in other modes in order to reduce the incompatibility. (Or, perhaps, they're using the code they had to write to make the Ada 2012 check to issue warnings in other cases.) I'd suggest getting rid of any such code. Randy. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-29 22:39 ` Randy Brukardt @ 2013-05-30 2:01 ` Adam Beneschan 2013-05-30 8:01 ` Bill Findlay ` (2 more replies) 0 siblings, 3 replies; 55+ messages in thread From: Adam Beneschan @ 2013-05-30 2:01 UTC (permalink / raw) On Wednesday, May 29, 2013 3:39:44 PM UTC-7, Randy Brukardt wrote: > >> But it's reporting a problem with my Ada 2005 Math Extensions .. not > >> so good (for me). > > > Turned out to be a warning new to GNAT GPL 2013 (also in GCC 4.8.0): > > had a subprogram with two out parameters that designated the same > > object. It was a dummy, though, so no harm done. > > > ada_numerics-generic_arrays.adb:325:28: warning: writable actual for > > "V_L" overlaps with actual for "V_R" > > You do know that's illegal in some cases in Ada 2012? (A known and intended > incompatibility.) I wouldn't be surprised if GNAT is putting out a warning > in other modes in order to reduce the incompatibility. (Or, perhaps, they're > using the code they had to write to make the Ada 2012 check to issue > warnings in other cases.) I'd suggest getting rid of any such code. Even before Ada 2012, it's been possible to run into a problem with "distinct access paths". A subprogram with two OUT parameters could set a component in one OUT parameter, and then later try reading it back; if it's written something into the other OUT parameter in between, and if the caller uses the same actual for both OUT parameters, it could cause a real problem. I'm guessing that Simon is calling one of his own routines, so he knows that won't happen. But it still seems like bad practice. I've always wanted some kind of feature in Ada that would allow a caller to provide a "dummy" for OUT parameters, without having to declare a new variable. The compiler would allocate a temporary object (and a separate one for each use of a "dummy") and then discard it after the call. It wouldn't work well when parameter types are unconstrained array or discriminant records, though. Now that we have preconditions, and Has_Same_Storage and Overlap_Storage attributes [this is why I was looking into those! :-)], in theory it should be possible for programmers to use this any time there are two not-by-copy parameters (not both IN parameters) that shouldn't overlap. Then it would be safe to use the same dummy variable for both (or other overlapping cases) if there's no such precondition. The programmer has promised that the body of the subprogram is able to handle overlap. But that doesn't seem feasible to me, since I think in *most* cases, the intent of subprograms with OUT or IN OUT parameters is that they're not expected to overlap. Expecting a precondition to be added to all such subprograms seems like too big a burden. I think the best practice here is: don't ever call a subprogram with overlapping parameters (if they're not both IN parameters), unless there is some comment on the subprogram declaration saying that it's OK. (Or an implementation-defined pragma.) -- Adam ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-30 2:01 ` Adam Beneschan @ 2013-05-30 8:01 ` Bill Findlay 2013-05-30 23:09 ` Dennis Lee Bieber 2013-05-30 10:39 ` Simon Wright 2013-05-30 19:53 ` Randy Brukardt 2 siblings, 1 reply; 55+ messages in thread From: Bill Findlay @ 2013-05-30 8:01 UTC (permalink / raw) On 30/05/2013 03:01, in article 32d94173-533a-471e-95a0-abb73a6cdcc2@googlegroups.com, "Adam Beneschan" <adam@irvine.com> wrote: > Even before Ada 2012, it's been possible to run into a problem with "distinct > access paths". Not just in Ada of course. The worst 'program' I ever saw was 'written' in 'FORTRAN'. Yes, those quotes are meant to scare you. In the mid 80s a graduate student visiting Glasgow was sent to me for help. A program, which she had brought with her from an even more ancient seat of learning, would not work on the GU Computing Service computer. This program consisted of many subroutines, each of which referenced all of the many COMMON areas, listing out their contents in toto, whether they were needed or not. Each COMMON area contained many variables. Each subroutine had many parameters, the actual parameters of most calls being being a selection of variables from the COMMON areas. Variables in COMMON were also used directly. Many times. Many, many times. Many times. She assured me that the program did work, back in the Fens. Dear reader, do not rush to judge her! It had been written by her eminent supervisor. So when I offered my considered opinion, that it was the biggest pile of programmatic cack I had ever set eyes on, she was understandably reluctant to communicate that message back to base. I explained the concept of aliasing; suggested that it was very unlikely that such code could be made, with any reasonable amount of effort, to work away from home; and that it very probably did not really work even there, no matter how lofty her supervisor's ivory tower, and no matter how many papers in prestigious journals he had published that were based on its output. This won me no brownie points whatsoever. 8-) -- Bill Findlay with blueyonder.co.uk; use surname & forename; ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-30 8:01 ` Bill Findlay @ 2013-05-30 23:09 ` Dennis Lee Bieber 2013-05-31 5:02 ` J-P. Rosen 2013-05-31 18:35 ` Bill Findlay 0 siblings, 2 replies; 55+ messages in thread From: Dennis Lee Bieber @ 2013-05-30 23:09 UTC (permalink / raw) On Thu, 30 May 2013 09:01:17 +0100, Bill Findlay <yaldnif.w@blueyonder.co.uk> declaimed the following in comp.lang.ada: > > The worst 'program' I ever saw was 'written' in 'FORTRAN'. > Yes, those quotes are meant to scare you. > > In the mid 80s a graduate student visiting Glasgow was sent to me for help. > A program, which she had brought with her from an even more ancient seat of > learning, would not work on the GU Computing Service computer. <snip> > Each subroutine had many parameters, the actual parameters of most calls > being being a selection of variables from the COMMON areas. > > Variables in COMMON were also used directly. > Many times. Many, many times. Many times. > Ouch! While FORTRAN's pass-by-reference could be dangerous (the infamous [and maybe urban legend] non-constant constant in some early compilers) when the same actual is provided to multiple arguments, mixing COMMON and argument passing at the same time is something I never encountered. And the Xerox Sigma FORTRAN-IV masked some dangers with a GLOBAL statement (working from memory, the statement keyword may have been different) -- basically GLOBAL X, Y, Z expanded into COMMON /X/ X COMMON /Y/ Y COMMON /Z/ Z IE; each named variable became part of a named common block with the same name. No chance of implicitly equivalencing variables when a common block was used with different data types. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/ ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-30 23:09 ` Dennis Lee Bieber @ 2013-05-31 5:02 ` J-P. Rosen 2013-05-31 18:35 ` Bill Findlay 1 sibling, 0 replies; 55+ messages in thread From: J-P. Rosen @ 2013-05-31 5:02 UTC (permalink / raw) Le 31/05/2013 01:09, Dennis Lee Bieber a écrit : > Ouch! While FORTRAN's pass-by-reference could be dangerous (the > infamous [and maybe urban legend] non-constant constant Not a urban legend. I had that bug when a student, on a 10070 (a France-made Sigma/7). -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-30 23:09 ` Dennis Lee Bieber 2013-05-31 5:02 ` J-P. Rosen @ 2013-05-31 18:35 ` Bill Findlay 1 sibling, 0 replies; 55+ messages in thread From: Bill Findlay @ 2013-05-31 18:35 UTC (permalink / raw) Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote: > On Thu, 30 May 2013 09:01:17 +0100, Bill Findlay > <yaldnif.w@blueyonder.co.uk> declaimed the following in comp.lang.ada: > >> >> The worst 'program' I ever saw was 'written' in 'FORTRAN'. >> Yes, those quotes are meant to scare you. >> >> In the mid 80s a graduate student visiting Glasgow was sent to me for help. >> A program, which she had brought with her from an even more ancient seat of >> learning, would not work on the GU Computing Service computer. > > <snip> > >> Each subroutine had many parameters, the actual parameters of most calls >> being being a selection of variables from the COMMON areas. >> >> Variables in COMMON were also used directly. >> Many times. Many, many times. Many times. >> > > Ouch! While FORTRAN's pass-by-reference could be dangerous (the > infamous [and maybe urban legend] non-constant constant in some early > compilers) when the same actual is provided to multiple arguments, > mixing COMMON and argument passing at the same time is something I never > encountered. The non-constant constant actually happened to me in my first real FORTRAN program. I called a routine that took a desired error parameter, which I wrote as 0.0; not noticing that the same parameter was used to return an achieved error estimate. The following arithmetic IF malfunctioned bafflingly until I realised that 0.0 was being redefined! -- Bill Findlay ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-30 2:01 ` Adam Beneschan 2013-05-30 8:01 ` Bill Findlay @ 2013-05-30 10:39 ` Simon Wright 2013-05-30 16:21 ` Adam Beneschan 2013-05-30 19:53 ` Randy Brukardt 2 siblings, 1 reply; 55+ messages in thread From: Simon Wright @ 2013-05-30 10:39 UTC (permalink / raw) Adam Beneschan <adam@irvine.com> writes: > On Wednesday, May 29, 2013 3:39:44 PM UTC-7, Randy Brukardt wrote: > >> >> But it's reporting a problem with my Ada 2005 Math Extensions >> >> .. not so good (for me). >> >> > Turned out to be a warning new to GNAT GPL 2013 (also in GCC 4.8.0): >> > had a subprogram with two out parameters that designated the same >> > object. It was a dummy, though, so no harm done. >> >> > ada_numerics-generic_arrays.adb:325:28: warning: writable actual for >> > "V_L" overlaps with actual for "V_R" >> >> You do know that's illegal in some cases in Ada 2012? (A known and >> intended incompatibility.) I wouldn't be surprised if GNAT is putting >> out a warning in other modes in order to reduce the >> incompatibility. (Or, perhaps, they're using the code they had to >> write to make the Ada 2012 check to issue warnings in other cases.) >> I'd suggest getting rid of any such code. > > Even before Ada 2012, it's been possible to run into a problem with > "distinct access paths". A subprogram with two OUT parameters could > set a component in one OUT parameter, and then later try reading it > back; if it's written something into the other OUT parameter in > between, and if the caller uses the same actual for both OUT > parameters, it could cause a real problem. I'm guessing that Simon is > calling one of his own routines, so he knows that won't happen. But > it still seems like bad practice. If I read the RM right (I probably don't), then because in this case I don't read the values assigned (they are dummies, after all) I should be OK. (ARM 6.2 (12/3)). I tried declaring the dummy matrices as of zero size, but they are passed to Fortran (LAPACK) which couldn't cope with the idea; at least it returned "illegal value for parameter 12", better than an access violation! And it didn't suppress GNAT's warning anyway. So the code now has distinct writable actuals. Thanks for the discussion. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-30 10:39 ` Simon Wright @ 2013-05-30 16:21 ` Adam Beneschan 0 siblings, 0 replies; 55+ messages in thread From: Adam Beneschan @ 2013-05-30 16:21 UTC (permalink / raw) On Thursday, May 30, 2013 3:39:46 AM UTC-7, Simon Wright wrote: > If I read the RM right (I probably don't), then because in this case I > don't read the values assigned (they are dummies, after all) I should be > OK. (ARM 6.2 (12/3)). They may be dummies from the caller's point of view, but I'm concerned about the callee's. The callee doesn't know that it's going to get passed "dummy" variables. If it reads its own OUT parameters after it sets them, then there could be aliasing problems. If the callee is a subprogram in a different package, then you really shouldn't assume anything about what's in the body of the callee, other than what's in the "contract" (whether the contract is expressed as Ada preconditions or just comments). To me, this means that if the contract doesn't say it's OK for the parameters to overlap, then you should assume that the callee *could* do something that will go wrong if the parameters overlap. However, if this is your own subprogram in your own package body calling another subprogram in the same package body, it's more acceptable (IMHO) to assume that overlapping is OK. -- Adam ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-30 2:01 ` Adam Beneschan 2013-05-30 8:01 ` Bill Findlay 2013-05-30 10:39 ` Simon Wright @ 2013-05-30 19:53 ` Randy Brukardt 2013-05-31 7:41 ` Dmitry A. Kazakov 2013-05-31 11:30 ` Stefan.Lucks 2 siblings, 2 replies; 55+ messages in thread From: Randy Brukardt @ 2013-05-30 19:53 UTC (permalink / raw) "Adam Beneschan" <adam@irvine.com> wrote in message news:32d94173-533a-471e-95a0-abb73a6cdcc2@googlegroups.com... On Wednesday, May 29, 2013 3:39:44 PM UTC-7, Randy Brukardt wrote: >I've always wanted some kind of feature in Ada that would allow a caller to >provide a >"dummy" for OUT parameters, without having to declare a new variable. The >compiler >would allocate a temporary object (and a separate one for each use of a >"dummy") and >then discard it after the call. It wouldn't work well when parameter types >are >unconstrained array or discriminant records, though. Hmm, that seems like a good idea to me. But what would the syntax be? <> maybe? My_Proc (Obj1, Obj2, Result => <>); Someone should seriously propose something on this line on Ada-Comment. I can see objections about making it too easy to ignore errors -- but errors shouldn't be returned in parameters in the first place, so I don't find that terribly compelling. Anyway, this problem was a significant annoyance in the design of Claw. We have routines that return rarely used values that would normally just be discarded. That's especially an issue for call-back routines, where we have to provide all of the parameters that you could possibly use, even if you have no need for half of them. (And the typical solutions using overloading and/or default parameters is impractical.) I tried to work out a solution based on default parameters for all modes (which would provide your dummy result along with other uses), but it didn't work out very well. The main problem was that the default objects usually had to be globals, and that could cause an unsafe use of shared variables in a tasking environment. The <> solution doesn't suffer from this, and it also would make the dummy--ness of the parameter visible to the reader, which would reduce two of the major objections. (The latter means that style checkers could prevent the use of such dummies if it was considered a problem -- and it would make the fact that they're dummies much more visible than a regular declaration does.) Randy. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-30 19:53 ` Randy Brukardt @ 2013-05-31 7:41 ` Dmitry A. Kazakov 2013-05-31 11:30 ` Stefan.Lucks 1 sibling, 0 replies; 55+ messages in thread From: Dmitry A. Kazakov @ 2013-05-31 7:41 UTC (permalink / raw) On Thu, 30 May 2013 14:53:43 -0500, Randy Brukardt wrote: > "Adam Beneschan" <adam@irvine.com> wrote in message > news:32d94173-533a-471e-95a0-abb73a6cdcc2@googlegroups.com... > On Wednesday, May 29, 2013 3:39:44 PM UTC-7, Randy Brukardt wrote: > >>I've always wanted some kind of feature in Ada that would allow a caller to >>provide a >>"dummy" for OUT parameters, without having to declare a new variable. The >>compiler >>would allocate a temporary object (and a separate one for each use of a >>"dummy") and >>then discard it after the call. It wouldn't work well when parameter types >>are >>unconstrained array or discriminant records, though. > > Hmm, that seems like a good idea to me. But what would the syntax be? <> > maybe? > > My_Proc (Obj1, Obj2, Result => <>); As well as function results: <> := My_Func (Obj1, Obj2); -- I do this for side effects! Back in 90's I thought about null statement: null My_Func (Obj1, Obj2); But for procedures it won't work: My_Proc (Obj1, Obj2, Result => null); -- Ambiguous > I tried to work out a solution based on default parameters for all modes > (which would provide your dummy result along with other uses), but it didn't > work out very well. The main problem was that the default objects usually > had to be globals, and that could cause an unsafe use of shared variables in > a tasking environment. These are two different cases. One is when the default is a named object, another is when the default is an anonymous object allocated on the stack. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-30 19:53 ` Randy Brukardt 2013-05-31 7:41 ` Dmitry A. Kazakov @ 2013-05-31 11:30 ` Stefan.Lucks 2013-05-31 12:03 ` Niklas Holsti 2013-05-31 22:07 ` Randy Brukardt 1 sibling, 2 replies; 55+ messages in thread From: Stefan.Lucks @ 2013-05-31 11:30 UTC (permalink / raw) [-- Attachment #1: Type: TEXT/PLAIN, Size: 1647 bytes --] On Thu, 30 May 2013, Randy Brukardt wrote: > "Adam Beneschan" <adam@irvine.com> wrote in message > >> I've always wanted some kind of feature in Ada that would allow a >> caller to provide a "dummy" for OUT parameters, without having to >> declare a new variable. The compiler would allocate a temporary object >> (and a separate one for each use of a "dummy") and then discard it >> after the call. It wouldn't work well when parameter types are >> unconstrained array or discriminant records, though. > > Hmm, that seems like a good idea to me. But what would the syntax be? <> > maybe? > > My_Proc (Obj1, Obj2, Result => <>); > This has two issues: 1. This won't work if the type of Result is unconstrained, as, e.g., in procedure My_Proc(Obj1, Obj2: String; Result : String); 2. This would sometimes break overload resolution -- which procedure should be called by "My_Proc (Obj1, Obj2, Result => <>);" if there happens to be another procedure in scope, such as procedure My_Proc(Obj1, Obj2: String; Result : Unbounded_String); I'd suggest My_Proc (Obj1, Obj2, Result => String(1 .. 80)); or in general My_Proc (Obj1, Obj2, Result => type Name_of_Type); as syntactic sugar for declare Dummy : Name_Of_Type; begin My_Proc (Obj1, Obj2, Result => type Name_of_Type); end; ------ I love the taste of Cryptanalysis in the morning! ------ <http://www.uni-weimar.de/cms/medien/mediensicherheit/home.html> --Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universität Weimar, Germany-- ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-31 11:30 ` Stefan.Lucks @ 2013-05-31 12:03 ` Niklas Holsti 2013-05-31 22:07 ` Randy Brukardt 1 sibling, 0 replies; 55+ messages in thread From: Niklas Holsti @ 2013-05-31 12:03 UTC (permalink / raw) On 13-05-31 13:30 , Stefan.Lucks@uni-weimar.de wrote: > On Thu, 30 May 2013, Randy Brukardt wrote: > >> "Adam Beneschan" <adam@irvine.com> wrote in message >> >>> I've always wanted some kind of feature in Ada that would allow a >>> caller to provide a "dummy" for OUT parameters, without having to >>> declare a new variable. The compiler would allocate a temporary >>> object (and a separate one for each use of a "dummy") and then >>> discard it after the call. It wouldn't work well when parameter >>> types are unconstrained array or discriminant records, though. >> >> Hmm, that seems like a good idea to me. To me too, but only of the "nice to have" priority. >> But what would the syntax be? <> >> maybe? >> >> My_Proc (Obj1, Obj2, Result => <>); >> > > This has two issues: > > 1. This won't work if the type of Result is unconstrained, as, e.g., in > > procedure My_Proc(Obj1, Obj2: String; Result : String); This is probably a very rare case. > > 2. This would sometimes break overload resolution -- which procedure > should be called by "My_Proc (Obj1, Obj2, Result => <>);" if there > happens to be another procedure in scope, such as > > procedure My_Proc(Obj1, Obj2: String; Result : Unbounded_String); > > I'd suggest > > My_Proc (Obj1, Obj2, Result => String(1 .. 80)); > > or in general > > My_Proc (Obj1, Obj2, Result => type Name_of_Type); It seems more consistent with the present language to allow type qualification of the box, as in My_Proc (Obj1, Obj2, Result => Name_of_Type'(<>)); > as syntactic sugar for > > declare > Dummy : Name_Of_Type; > begin > My_Proc (Obj1, Obj2, Result => type Name_of_Type); You probable meant this to be: My_Proc (Obj1, Obj2, Result => Dummy); > end; If this proposal is taken up, I would like it to be extended with some mechanism by which the called subprogram can query if a given out parameter is actually a dummy <>, so that the subprogram can avoid computing a useless value into that out parameter. However, that could easily lead to distributed overhead. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ . ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-31 11:30 ` Stefan.Lucks 2013-05-31 12:03 ` Niklas Holsti @ 2013-05-31 22:07 ` Randy Brukardt 2013-06-01 11:51 ` Georg Bauhaus 1 sibling, 1 reply; 55+ messages in thread From: Randy Brukardt @ 2013-05-31 22:07 UTC (permalink / raw) <Stefan.Lucks@uni-weimar.de> wrote in message news:alpine.DEB.2.02.1305311319150.13043@debian... >On Thu, 30 May 2013, Randy Brukardt wrote: >> "Adam Beneschan" <adam@irvine.com> wrote in message >> >>> I've always wanted some kind of feature in Ada that would allow a >>> caller to provide a "dummy" for OUT parameters, without having to >>> declare a new variable. The compiler would allocate a temporary object >>> (and a separate one for each use of a "dummy") and then discard it >>> after the call. It wouldn't work well when parameter types are >>> unconstrained array or discriminant records, though. >> >> Hmm, that seems like a good idea to me. But what would the syntax be? <> >> maybe? >> >> My_Proc (Obj1, Obj2, Result => <>); >> > >This has two issues: > > 1. This won't work if the type of Result is unconstrained, as, e.g., in > > procedure My_Proc(Obj1, Obj2: String; Result : String); That's not an issue, that's a feature. I would not expect this to work, because the "dummy" needs bounds/discriminants. <> means "default initialized", and if that is illegal, it should be illegal here, too. (Niklas had a suggested way to allow that, but honestly, I find that overkill. This is almost exclusively used to discard scalar results (at least in the cases I've encountered the need) and as such, I'd prefer it to be as simple as possible. > 2. This would sometimes break overload resolution -- which procedure > should be called by "My_Proc (Obj1, Obj2, Result => <>);" if there > happens to be another procedure in scope, such as > > procedure My_Proc(Obj1, Obj2: String; Result : Unbounded_String); That's ambiguous, of course. (And lousy subprogram design, too, but that's another story.) There's nothing new here, you get similar effects with class-wide objects, literals, and the like. This would resolve like a kind of super-literal. And keep in mind this is a convinient short-hand, not something that has to work. You can always declare an explicit dummy object if this doesn't work. >I'd suggest > > My_Proc (Obj1, Obj2, Result => String(1 .. 80)); That's ambiguous with type conversions, especially for discriminated types: My_Record(1) vs. My_Integer(1) This is a "nice-to-have" feature, and making resolution much, much harder is not worth it. Additionally, I think it is important that this syntactically stands out -- it should not look anything like a normal parameter. >or in general > > My_Proc (Obj1, Obj2, Result => type Name_of_Type); That's a bit better, but it doesn't evoke the usage of a dummy parameter at all. (And it would be hell on syntax error recovery algorithms.) My original message noted that the choice of syntax for this would be critical as to whether this would be adopted (because readability is so important to Ada, and this is not a critical feature). I toned that down when I thought of using <> for the parameter, because it seemed like a sensible choice. Unless the syntax makes it pretty obvious that this is a dummy, discarded parameter, this idea is going nowhere. (And it might very well go nowhere even if the syntax is perfect.) Randy. Randy. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-31 22:07 ` Randy Brukardt @ 2013-06-01 11:51 ` Georg Bauhaus 2013-06-03 14:52 ` Adam Beneschan 0 siblings, 1 reply; 55+ messages in thread From: Georg Bauhaus @ 2013-06-01 11:51 UTC (permalink / raw) On 01.06.13 00:07, Randy Brukardt wrote: > Unless the syntax makes it pretty obvious that this is a dummy, discarded > parameter, this idea is going nowhere. (And it might very well go nowhere > even if the syntax is perfect.) Can you perhaps employ the new subpools mechanism? To provide constraints for an anonymous, "boxed object", we'd write My_Proc (Obj1, Obj2, Result => <> String'(1..80 => <>)); Then, if __ stands for a subpool known only to the compiler such as, ahem, the stack, the expansion is the impossible My_Proc (Obj1, Obj2, Result => (new(__) String'(1..80 => <>)).all); ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-01 11:51 ` Georg Bauhaus @ 2013-06-03 14:52 ` Adam Beneschan 2013-06-04 17:42 ` Wesley Pan 2013-06-11 2:39 ` Randy Brukardt 0 siblings, 2 replies; 55+ messages in thread From: Adam Beneschan @ 2013-06-03 14:52 UTC (permalink / raw) On Saturday, June 1, 2013 4:51:01 AM UTC-7, Georg Bauhaus wrote: > On 01.06.13 00:07, Randy Brukardt wrote: > > > Unless the syntax makes it pretty obvious that this is a dummy, discarded > > parameter, this idea is going nowhere. (And it might very well go nowhere > > even if the syntax is perfect.) > > Can you perhaps employ the new subpools mechanism? To provide > constraints for an anonymous, "boxed object", we'd write > > My_Proc (Obj1, Obj2, Result => <> String'(1..80 => <>)); > > Then, if __ stands for a subpool known only to the compiler > such as, ahem, the stack, the expansion is the impossible > > My_Proc (Obj1, Obj2, Result => (new(__) String'(1..80 => <>)).all); I'm beginning to regret opening this subject up. -- Adam ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-03 14:52 ` Adam Beneschan @ 2013-06-04 17:42 ` Wesley Pan 2013-06-04 18:34 ` Adam Beneschan 2013-06-05 15:40 ` Eryndlia Mavourneen 2013-06-11 2:39 ` Randy Brukardt 1 sibling, 2 replies; 55+ messages in thread From: Wesley Pan @ 2013-06-04 17:42 UTC (permalink / raw) On Monday, June 3, 2013 7:52:07 AM UTC-7, Adam Beneschan wrote: > On Saturday, June 1, 2013 4:51:01 AM UTC-7, Georg Bauhaus wrote: > > > On 01.06.13 00:07, Randy Brukardt wrote: > > > > > > > Unless the syntax makes it pretty obvious that this is a dummy, discarded > > > > parameter, this idea is going nowhere. (And it might very well go nowhere > > > > even if the syntax is perfect.) > > > > > > Can you perhaps employ the new subpools mechanism? To provide > > > constraints for an anonymous, "boxed object", we'd write > > > > > > My_Proc (Obj1, Obj2, Result => <> String'(1..80 => <>)); > > > > > > Then, if __ stands for a subpool known only to the compiler > > > such as, ahem, the stack, the expansion is the impossible > > > > > > My_Proc (Obj1, Obj2, Result => (new(__) String'(1..80 => <>)).all); > > > > I'm beginning to regret opening this subject up. > > > > -- Adam I apologize if this sounds really naive. My Ada skills is quite rusty at the moment (trying to slowly re-learn it). Why not simply make 'dummy' a new keyword? I imagine many people would call their throw away variable something like "Dummy". I definitely tend to do this for any language I am using. Assuming dummy is the keyword we would have the following: My_Proc(Obj1, Obj2, Result => dummy String(1..80)); My_Proc(Obj1, Obj2, Result => dummy String_80); My_Proc(Obj1, Obj2, Result => dummy Unbounded_String(1..80)); My_Proc(Obj1, Obj2, Result => dummy UString_80); My_Proc(Obj1, Obj2, Result => dummy Some_Type); My_Proc(Obj1, Obj2, Result => dummy Some_Type(1)); My_Proc(Obj1, Obj2, Result => dummy access Record_Type); My_Proc(Obj1, Obj2, Result => dummy Record_Type_Access); You can also consider using throw_away as the keyword instead of dummy. Another alternative idea is to make a new attribute 'Temp. So we would have: My_Proc(Obj1, Obj2, Result => String'Temp(1..80)); My_Proc(Obj1, Obj2, Result => String_80'Temp); My_Proc(Obj1, Obj2, Result => Unbounded_String'Temp(1..80)); My_Proc(Obj1, Obj2, Result => UString_80'Temp); My_Proc(Obj1, Obj2, Result => Some_Type'Temp); My_Proc(Obj1, Obj2, Result => Some_Type'Temp(1)); My_Proc(Obj1, Obj2, Result => access Record_Type'Temp); My_Proc(Obj1, Obj2, Result => Record_Type_Access'Temp); That's my 2 cents... -Wesley ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-04 17:42 ` Wesley Pan @ 2013-06-04 18:34 ` Adam Beneschan 2013-06-04 19:00 ` Wesley Pan 2013-06-05 15:40 ` Eryndlia Mavourneen 1 sibling, 1 reply; 55+ messages in thread From: Adam Beneschan @ 2013-06-04 18:34 UTC (permalink / raw) On Tuesday, June 4, 2013 10:42:53 AM UTC-7, Wesley Pan wrote: > > I apologize if this sounds really naive. My Ada skills is quite rusty at the moment (trying to slowly re-learn it). Why not simply make 'dummy' a new keyword? I imagine many people would call their throw away variable something like "Dummy". We already do. That's why we can't make it a new keyword. It would make a ton of existing code illegal. The idea makes sense; too bad they didn't think of it way back in 1983. -- Adam ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-04 18:34 ` Adam Beneschan @ 2013-06-04 19:00 ` Wesley Pan 0 siblings, 0 replies; 55+ messages in thread From: Wesley Pan @ 2013-06-04 19:00 UTC (permalink / raw) On Tuesday, June 4, 2013 11:34:55 AM UTC-7, Adam Beneschan wrote: > On Tuesday, June 4, 2013 10:42:53 AM UTC-7, Wesley Pan wrote: > > I apologize if this sounds really naive. My Ada skills is quite rusty at the moment (trying to slowly re-learn it). Why not simply make 'dummy' a new keyword? I imagine many people would call their throw away variable something like "Dummy". > > > > We already do. That's why we can't make it a new keyword. It would make a ton of existing code illegal. The idea makes sense; too bad they didn't think of it way back in 1983. > > > > -- Adam The new attribute idea would avoid any clashing of new keywords since the apostrophe helps to clearly distinguish it. We can also consider: disposable, expendable, momentary, and ephemeral. Guys writing cryptographic software might complain about the last word since they probably use it a lot. =) -Wesley ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-04 17:42 ` Wesley Pan 2013-06-04 18:34 ` Adam Beneschan @ 2013-06-05 15:40 ` Eryndlia Mavourneen 1 sibling, 0 replies; 55+ messages in thread From: Eryndlia Mavourneen @ 2013-06-05 15:40 UTC (permalink / raw) On Tuesday, June 4, 2013 12:42:53 PM UTC-5, Wesley Pan wrote: > ... > Another alternative idea is to make a new attribute 'Temp. So we would have: > My_Proc(Obj1, Obj2, Result => String'Temp(1..80)); > ... > -Wesley I *like* 'Temp. :-) -- Eryndlia ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-03 14:52 ` Adam Beneschan 2013-06-04 17:42 ` Wesley Pan @ 2013-06-11 2:39 ` Randy Brukardt 2013-06-11 6:31 ` Georg Bauhaus 1 sibling, 1 reply; 55+ messages in thread From: Randy Brukardt @ 2013-06-11 2:39 UTC (permalink / raw) "Adam Beneschan" <adam@irvine.com> wrote in message news:33025e6c-b893-4c66-98f6-0fb469016583@googlegroups.com... > On Saturday, June 1, 2013 4:51:01 AM UTC-7, Georg Bauhaus wrote: >> On 01.06.13 00:07, Randy Brukardt wrote: >> >> > Unless the syntax makes it pretty obvious that this is a dummy, >> > discarded >> > parameter, this idea is going nowhere. (And it might very well go >> > nowhere >> > even if the syntax is perfect.) >> >> Can you perhaps employ the new subpools mechanism? To provide >> constraints for an anonymous, "boxed object", we'd write >> >> My_Proc (Obj1, Obj2, Result => <> String'(1..80 => <>)); >> >> Then, if __ stands for a subpool known only to the compiler >> such as, ahem, the stack, the expansion is the impossible >> >> My_Proc (Obj1, Obj2, Result => (new(__) String'(1..80 => <>)).all); > > I'm beginning to regret opening this subject up. I feel your pain, after I encouraged it. What part of "really simple" don't people understand? Randy. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-11 2:39 ` Randy Brukardt @ 2013-06-11 6:31 ` Georg Bauhaus 2013-06-19 21:57 ` Randy Brukardt 0 siblings, 1 reply; 55+ messages in thread From: Georg Bauhaus @ 2013-06-11 6:31 UTC (permalink / raw) On 11.06.13 04:39, Randy Brukardt wrote: > "Adam Beneschan" <adam@irvine.com> wrote in message > news:33025e6c-b893-4c66-98f6-0fb469016583@googlegroups.com... >> On Saturday, June 1, 2013 4:51:01 AM UTC-7, Georg Bauhaus wrote: >>> On 01.06.13 00:07, Randy Brukardt wrote: >>> >>>> Unless the syntax makes it pretty obvious that this is a dummy, >>>> discarded >>>> parameter, this idea is going nowhere. (And it might very well go >>>> nowhere >>>> even if the syntax is perfect.) >>> >>> Can you perhaps employ the new subpools mechanism? To provide >>> constraints for an anonymous, "boxed object", we'd write >>> >>> My_Proc (Obj1, Obj2, Result => <> String'(1..80 => <>)); >>> >>> Then, if __ stands for a subpool known only to the compiler >>> such as, ahem, the stack, the expansion is the impossible >>> >>> My_Proc (Obj1, Obj2, Result => (new(__) String'(1..80 => <>)).all); >> >> I'm beginning to regret opening this subject up. > > I feel your pain, after I encouraged it. What part of "really simple" don't > people understand? Two parts (and please note that the subpools are inessential): First, "really simple" is always a little suspicious when the author of a compiler emphasizes simplicity. ;-) ;-) ;-) Second, concerning the constraints that need to be supplied, is there *any* way in Ada that allows them to be stated "really simply"? If the dummy syntax is for expressions of substitutes of a regular declaration, how can a dummy expression be so much more simple than a dummy declaration? About the only thing I can imagine towards simplified syntax is inference of type *and* range constraints, with the help of context (the subprograms' declarations). Is that double inference part of Ada right now? If not, the closest level of syntactic simplicity would be that of aggregates, with constraints, wouldn't it? ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-11 6:31 ` Georg Bauhaus @ 2013-06-19 21:57 ` Randy Brukardt 0 siblings, 0 replies; 55+ messages in thread From: Randy Brukardt @ 2013-06-19 21:57 UTC (permalink / raw) "Georg Bauhaus" <rm.dash-bauhaus@futureapps.de> wrote in message news:51b6c424$0$6633$9b4e6d93@newsspool2.arcor-online.net... ... > Second, concerning the constraints that need to be supplied, > is there *any* way in Ada that allows them to be stated > "really simply"? If you need constraints, that is not an appropriate use of this feature. It's really for discarding error codes from non-Ada APIs, and those should be some discrete type (either integer or enumeration). The base type is good enough for those cases. It would be usable for some composites, but not all. But that's OK, the entire point is to have a simple shorthand for a discarded parameter. If it gets at all complex, it no longer has much benefit in readability (I'd much rather see an explicit declaration rather than some strange magic syntax). And discarding of composite parameters is slightly suspicious. > If the dummy syntax is for expressions of substitutes of a regular > declaration, how can a dummy expression be so much more simple > than a dummy declaration? The syntax I proposed was "<>". That's it, there is no declaration, constraint, range, or any of that. It's readable, can easily be read to mean "discard" in this case, and it doesn't look much like a legal parameter expression. If it gets much more complex than that, then it simply isn't worth it. Compare what I write today: declare Dummy : Code_Type; -- Not used in the following begin Some_Call (Param_A, Param_B, Dummy); end; That's 5 lines, 8 extra tokens for the Dummy declaration. That's a very small amount of writing to save, so whatever replaces it had better be very small or there is no point: Some_Call (Param_A, Param_B, <>); qualifies. The more complex suggestions I have seen simply don't simplify enough to justify the complexity. > About the only thing I can imagine towards simplified syntax > is inference of type *and* range constraints, with the help > of context (the subprograms' declarations). Is that double > inference part of Ada right now? There is (or should be) no need to constraints on dummy temporaries that are going to be discarded anyway. Why would anyone want something discarded to be range checked (thus introducing a point of failure)? If you need that, that's *not* a discarded dummy. Since you don't *want* constraints on dummies, there is no need to infer them. Just use the base type of the parameter, and be done with it. If there is any ambiguity, or you can't have an object of the base type, then you'll have to write those 8 extra tokens. How awful. :-) But I think you've convinced me this feature isn't worth the work. It just doesn't save enough, and the slippery slope of people trying to expand it (so it saves nothing in either dimension) completely kills any value. And that's before anyone does a detailed semantic analysis on it, which often kills apparently good ideas anyway. Randy. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-29 13:36 Gnat 2013 is out! J-P. Rosen 2013-05-29 15:03 ` Simon Wright @ 2013-05-30 0:31 ` Dennis Lee Bieber 2013-05-31 16:12 ` dptrash ` (4 subsequent siblings) 6 siblings, 0 replies; 55+ messages in thread From: Dennis Lee Bieber @ 2013-05-30 0:31 UTC (permalink / raw) On Wed, 29 May 2013 15:36:31 +0200, "J-P. Rosen" <rosen@adalog.fr> declaimed the following in comp.lang.ada: > Just connected to libre and surprise! The site proposed the 2013 edition! Lovely... Something else to add to the list of software to install on the new computer (along with a firewire card, moving over two 1TB drives [and finding a power cable splitter -- only one spare power connector], etc...) -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/ ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-29 13:36 Gnat 2013 is out! J-P. Rosen 2013-05-29 15:03 ` Simon Wright 2013-05-30 0:31 ` Dennis Lee Bieber @ 2013-05-31 16:12 ` dptrash 2013-06-01 5:10 ` Stephen Leake ` (3 more replies) 2013-06-07 2:41 ` gautier_niouzes ` (3 subsequent siblings) 6 siblings, 4 replies; 55+ messages in thread From: dptrash @ 2013-05-31 16:12 UTC (permalink / raw) May I ask, how you debug Ada programs? Do you use GNATbench 2.7 for that? I need a good debugging tool :-) ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-31 16:12 ` dptrash @ 2013-06-01 5:10 ` Stephen Leake 2013-06-01 6:00 ` Per Sandberg ` (2 subsequent siblings) 3 siblings, 0 replies; 55+ messages in thread From: Stephen Leake @ 2013-06-01 5:10 UTC (permalink / raw) dptrash@arcor.de writes: > May I ask, how you debug Ada programs? Do you use GNATbench 2.7 for > that? I need a good debugging tool :-) gdb in Emacs -- -- Stephe ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-31 16:12 ` dptrash 2013-06-01 5:10 ` Stephen Leake @ 2013-06-01 6:00 ` Per Sandberg 2013-06-01 6:46 ` J-P. Rosen 2013-08-27 14:08 ` Yannick Duchêne (Hibou57) 3 siblings, 0 replies; 55+ messages in thread From: Per Sandberg @ 2013-06-01 6:00 UTC (permalink / raw) On Fri, 31 May 2013 09:12:29 -0700 (PDT) dptrash@arcor.de wrote: > May I ask, how you debug Ada programs? Do you use GNATbench 2.7 for > that? I need a good debugging tool :-) Exactly as you would debug any program compiled with gcc, with gdb using a graphical interface like gps, eclipse (gnatbench on top of cdt), emacs, ddd or bare commandline. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-31 16:12 ` dptrash 2013-06-01 5:10 ` Stephen Leake 2013-06-01 6:00 ` Per Sandberg @ 2013-06-01 6:46 ` J-P. Rosen 2013-06-01 15:22 ` Bill Findlay 2013-08-27 14:08 ` Yannick Duchêne (Hibou57) 3 siblings, 1 reply; 55+ messages in thread From: J-P. Rosen @ 2013-06-01 6:46 UTC (permalink / raw) Le 31/05/2013 18:12, dptrash@arcor.de a écrit : > May I ask, how you debug Ada programs? Do you use GNATbench 2.7 for > that? I need a good debugging tool :-) > I study my code carefully. Sometimes, I add traces to give me hints. There is an outstanding debugger in GPS (based on gdb, of course), but each time I used it, I concluded that it didn't bring me much. Ada protects you from all stupid errors, what remains are logical errors, and you find logical errors by reasonning on your logic. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-01 6:46 ` J-P. Rosen @ 2013-06-01 15:22 ` Bill Findlay 0 siblings, 0 replies; 55+ messages in thread From: Bill Findlay @ 2013-06-01 15:22 UTC (permalink / raw) On 01/06/2013 07:46, in article koc55m$at7$1@dont-email.me, "J-P. Rosen" <rosen@adalog.fr> wrote: > Le 31/05/2013 18:12, dptrash@arcor.de a écrit : >> May I ask, how you debug Ada programs? Do you use GNATbench 2.7 for >> that? I need a good debugging tool :-) >> > I study my code carefully. Sometimes, I add traces to give me hints. > > There is an outstanding debugger in GPS (based on gdb, of course), but > each time I used it, I concluded that it didn't bring me much. Ada > protects you from all stupid errors, what remains are logical errors, > and you find logical errors by reasonning on your logic. Yup. I have never used a debugger on my Ada projects. In fact, I once raced a guy who was using his favoured debugger on his Ada program, and I found his error (by looking at his code) before he did. That's Ada. -- Bill Findlay with blueyonder.co.uk; use surname & forename; ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-31 16:12 ` dptrash ` (2 preceding siblings ...) 2013-06-01 6:46 ` J-P. Rosen @ 2013-08-27 14:08 ` Yannick Duchêne (Hibou57) 2013-08-27 20:05 ` wilson 3 siblings, 1 reply; 55+ messages in thread From: Yannick Duchêne (Hibou57) @ 2013-08-27 14:08 UTC (permalink / raw) Le Fri, 31 May 2013 18:12:29 +0200, <dptrash@arcor.de> a écrit: > May I ask, how you debug Ada programs? Do you use GNATbench 2.7 for > that? I need a good debugging tool :-) I personally did not used a debugger since Borland Turbo Pascal. I first missed it (at that time GDB for C programs had issues on Windows 3.1), but quickly figured a debugger only show you one particular path in your logic, and above all, consume a lot of your time to just follow this path, a lot of time which is not used to understand the properties of the whole. So instead of trying to fix something in a particular path — ignoring the whole and so probably introducing a new bug elsewhere in the while — I would say it's surely better to understand the whole and so not rely on a debugger. A debugger never gives you such a picture, only analysis and understand gives this to you. When something really drives me crazy, I just add a “sentinel” which prints out some information (just requires an “with Ada.Text_IO” and a line added somewhere to print an “Element'Image”) I fill to not track correctly, to help me a bit. Then, back to global understanding as soon as possible. A program is not a single path and a particular property of a particular state as exposed by a debugger, it's multitude of possible paths and general properties common to a multitude of possible states (that's what you have to track, not a single path). In short, a debugger gives you a wrong picture, except if you are at the very beginning and try to figure out what's a programming language and how a state machine (like a computer is) works. Another issue, is that a program is not always running in a debugger, and so what when something went wrong while it was not running in a debugger and you don't have a complete and exact snapshot of the program's state when it get wrong? Here, a logger surely help more than a debugger, as it may be active all the time (most platform provides an API to help automatically manage logs and avoid these logs to fill all of your storage space). -- “Syntactic sugar causes cancer of the semi-colons.” [1] “Structured Programming supports the law of the excluded muddle.” [1] [1]: Epigrams on Programming — Alan J. — P. Yale University ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-08-27 14:08 ` Yannick Duchêne (Hibou57) @ 2013-08-27 20:05 ` wilson 2013-08-27 22:59 ` Dennis Lee Bieber 0 siblings, 1 reply; 55+ messages in thread From: wilson @ 2013-08-27 20:05 UTC (permalink / raw) On Tue, 27 Aug 2013 10:08:34 -0400, Yannick Duchêne (Hibou57) <yannick_duchene@yahoo.fr> wrote: > Le Fri, 31 May 2013 18:12:29 +0200, <dptrash@arcor.de> a écrit: > >> May I ask, how you debug Ada programs? Do you use GNATbench 2.7 for >> that? I need a good debugging tool :-) > > I personally did not used a debugger since Borland Turbo Pascal. I first > missed it (at that time GDB for C programs had issues on Windows 3.1), > but quickly figured a debugger only show you one particular path in your > logic, and above all, consume a lot of your time to just follow this > path, a lot of time which is not used to understand the properties of > the whole. > > So instead of trying to fix something in a particular path — ignoring > the whole and so probably introducing a new bug elsewhere in the while — > I would say it's surely better to understand the whole and so not rely > on a debugger. A debugger never gives you such a picture, only analysis > and understand gives this to you. > > When something really drives me crazy, I just add a “sentinel” which > prints out some information (just requires an “with Ada.Text_IO” and a > line added somewhere to print an “Element'Image”) I fill to not track > correctly, to help me a bit. Then, back to global understanding as soon > as possible. > > A program is not a single path and a particular property of a particular > state as exposed by a debugger, it's multitude of possible paths and > general properties common to a multitude of possible states (that's what > you have to track, not a single path). In short, a debugger gives you a > wrong picture, except if you are at the very beginning and try to figure > out what's a programming language and how a state machine (like a > computer is) works. > > Another issue, is that a program is not always running in a debugger, > and so what when something went wrong while it was not running in a > debugger and you don't have a complete and exact snapshot of the > program's state when it get wrong? Here, a logger surely help more than > a debugger, as it may be active all the time (most platform provides an > API to help automatically manage logs and avoid these logs to fill all > of your storage space). > > Thank you for saying something I have felt for years. I always felt odd man out for this approach and it is good to have someone else say the same thing. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-08-27 20:05 ` wilson @ 2013-08-27 22:59 ` Dennis Lee Bieber 2013-08-28 7:35 ` Dmitry A. Kazakov 0 siblings, 1 reply; 55+ messages in thread From: Dennis Lee Bieber @ 2013-08-27 22:59 UTC (permalink / raw) On Tue, 27 Aug 2013 16:05:20 -0400, wilson <winslole@udayton.edu> declaimed the following: >On Tue, 27 Aug 2013 10:08:34 -0400, Yannick Duchêne (Hibou57) ><yannick_duchene@yahoo.fr> wrote: > >> I personally did not used a debugger since Borland Turbo Pascal. I first >> missed it (at that time GDB for C programs had issues on Windows 3.1), >> but quickly figured a debugger only show you one particular path in your >> logic, and above all, consume a lot of your time to just follow this >> path, a lot of time which is not used to understand the properties of >> the whole. >> <snip> >> >> When something really drives me crazy, I just add a “sentinel” which >> prints out some information (just requires an “with Ada.Text_IO” and a >> line added somewhere to print an “Element'Image”) I fill to not track >> correctly, to help me a bit. Then, back to global understanding as soon >> as possible. >> <snip> >> Another issue, is that a program is not always running in a debugger, >> and so what when something went wrong while it was not running in a >> debugger and you don't have a complete and exact snapshot of the >> program's state when it get wrong? Here, a logger surely help more than >> a debugger, as it may be active all the time (most platform provides an >> API to help automatically manage logs and avoid these logs to fill all >> of your storage space). > >Thank you for saying something I have felt for years. I always felt odd >man out for this approach and it is good to have someone else say the same >thing. I've only made significant use of one debugger -- the one on DEC VMS. The VMS debugger is basically one big exception handler with ties to embedded debug information (mainly tags for source file/version/line number, and symbol table). The only other debugger I even touched was the one in LS-DOS (TRS-80). And that was mainly because the "advanced" debugger mode included commands to do raw sector I/O on the floppy drives (including command to write the special directory block disk header). Why? I received an O/S update disk that had a bad sector. With some work I was able to determine which file was bad. I then compared the sectors of my working O/S disk to the bad one, WRT that file. I determined the sectors before and after the bad one had one or two bytes different -- namely, the bytes that changed the default layout for the directory display. So I used the debugger to duplicate all of the update disk except for the bad sector, which I then copied over from my working disk. The new disk worked well, and I sent the bad disk back to the maker with a description of the problem. (I believe the update was to handle larger date ranges -- the original LS-DOS/TRS-DOS used a 3-bit YEAR, essentially 1977 [78?] to 1984 [85?]; the update removed user-passwords from directory entries to expand the date... Y2K had nothing on the TRS-80 <G> Files had owner and user passwords, but how many people are going to use owner password to set a file read-only, AND then require a user password just to read the file...) -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/ ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-08-27 22:59 ` Dennis Lee Bieber @ 2013-08-28 7:35 ` Dmitry A. Kazakov 2013-08-28 23:39 ` Dennis Lee Bieber 0 siblings, 1 reply; 55+ messages in thread From: Dmitry A. Kazakov @ 2013-08-28 7:35 UTC (permalink / raw) On Tue, 27 Aug 2013 18:59:25 -0400, Dennis Lee Bieber wrote: > On Tue, 27 Aug 2013 16:05:20 -0400, wilson <winslole@udayton.edu> declaimed > the following: > >>Thank you for saying something I have felt for years. I always felt odd >>man out for this approach and it is good to have someone else say the same >>thing. > > I've only made significant use of one debugger -- the one on DEC VMS. Yes, that was the best debugger ever. GDB is trash. There are bugs which are easier to catch using tracing, but also there are some much easier to do with a visual debugger. It is difficult to say in which relation they are. I suspect that Ada eliminates more bugs of the second kind than of the first kind. On top of that comes the misery of GDB. I remember, in ObjectAda times, which had more or less decent debugger, I used it time to time. But I never managed to track any bug with GDB (under AdaGIDE and GPS). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-08-28 7:35 ` Dmitry A. Kazakov @ 2013-08-28 23:39 ` Dennis Lee Bieber 0 siblings, 0 replies; 55+ messages in thread From: Dennis Lee Bieber @ 2013-08-28 23:39 UTC (permalink / raw) On Wed, 28 Aug 2013 09:35:03 +0200, "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> declaimed the following: > >On top of that comes the misery of GDB. I remember, in ObjectAda times, >which had more or less decent debugger, I used it time to time. But I never >managed to track any bug with GDB (under AdaGIDE and GPS). Given the various languages and systems I've had to work with -- I was more productive using "wolf-fences"*. This may change with my current employment -- avionics isn't very conducive to "modify the source file to debug". * the simple "PRINT" statement or equivalent. As it was described in an ancient CACM (as I recall): There is a wolf in Alaska that you have to catch. You build a fence across the state and then listen for the wolf to howl -- that tells you which half of the state the wolf is in. Build a second fence that bisects the half with the wolf and repeat... Of course, it may be faster to quarter the state and listen for which quarter the howl comes from ... -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/ ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-29 13:36 Gnat 2013 is out! J-P. Rosen ` (2 preceding siblings ...) 2013-05-31 16:12 ` dptrash @ 2013-06-07 2:41 ` gautier_niouzes 2013-06-07 15:52 ` mjsilva ` (2 subsequent siblings) 6 siblings, 0 replies; 55+ messages in thread From: gautier_niouzes @ 2013-06-07 2:41 UTC (permalink / raw) > Just connected to libre and surprise! The site proposed the 2013 edition! That's a good one! Some observations: - noticeable gain in performance for number crunching - GPS/Windows: moving marked text with the mouse now... moves the text as expected (by pushing Ctrl text is copied), but be careful if you are not aware of the change! _________________________ Gautier's Ada programming http://gautiersblog.blogspot.com/search/label/Ada NB: follow the above link for a valid e-mail address ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-29 13:36 Gnat 2013 is out! J-P. Rosen ` (3 preceding siblings ...) 2013-06-07 2:41 ` gautier_niouzes @ 2013-06-07 15:52 ` mjsilva 2013-06-07 20:15 ` Dmitry A. Kazakov ` (2 more replies) 2013-06-11 7:52 ` Maciej Sobczak 2013-06-12 7:58 ` Maciej Sobczak 6 siblings, 3 replies; 55+ messages in thread From: mjsilva @ 2013-06-07 15:52 UTC (permalink / raw) On Wednesday, May 29, 2013 6:36:31 AM UTC-7, J-P. Rosen wrote: > Just connected to libre and surprise! The site proposed the 2013 edition! I was disappointed to see that their ARM Cortex version is not available. I was looking forward to using it and evangelizing Ada with it. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-07 15:52 ` mjsilva @ 2013-06-07 20:15 ` Dmitry A. Kazakov 2013-06-09 18:51 ` MatthiasR 2013-06-08 6:22 ` Simon Wright 2013-06-10 11:07 ` Rego, P. 2 siblings, 1 reply; 55+ messages in thread From: Dmitry A. Kazakov @ 2013-06-07 20:15 UTC (permalink / raw) On Fri, 7 Jun 2013 08:52:27 -0700 (PDT), mjsilva@scriptoriumdesigns.com wrote: > On Wednesday, May 29, 2013 6:36:31 AM UTC-7, J-P. Rosen wrote: >> Just connected to libre and surprise! The site proposed the 2013 edition! > > I was disappointed to see that their ARM Cortex version is not available. AFAIK, GNAT Pro for Linux ARM is not even planed. I heard that VxWorks ARM would be more likely to happen. > I was looking forward to using it and evangelizing Ada with it. Yes, we have applications for that too. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-07 20:15 ` Dmitry A. Kazakov @ 2013-06-09 18:51 ` MatthiasR 0 siblings, 0 replies; 55+ messages in thread From: MatthiasR @ 2013-06-09 18:51 UTC (permalink / raw) Dmitry A. Kazakov wrote: > On Fri, 7 Jun 2013 08:52:27 -0700 (PDT), mjsilva@scriptoriumdesigns.com > wrote: > >> On Wednesday, May 29, 2013 6:36:31 AM UTC-7, J-P. Rosen wrote: >>> Just connected to libre and surprise! The site proposed the 2013 >>> edition! >> >> I was disappointed to see that their ARM Cortex version is not available. > > AFAIK, GNAT Pro for Linux ARM is not even planed. I heard that VxWorks ARM > would be more likely to happen. Who knows? Definitely existing is the version for ARM Cortex M3 / R4 bareboard: http://www.arm.com/community/partners/display_product/rw/ProductId/5620/ On the Adacore homepage I couldn't find anything about this port - except the press release. Whether a 'libre' version of this port is planned - that's another question... For people wanting to make some experiments with an 'inofficial' port (based on the Mindstorms Version), https://github.com/telrob/stm32-ada may be a good starting point. A buildscript for a compiler and a ravenscar runtime for the STM32F4-Discovery board can be found there. Matthias ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-07 15:52 ` mjsilva 2013-06-07 20:15 ` Dmitry A. Kazakov @ 2013-06-08 6:22 ` Simon Wright 2013-06-08 23:23 ` mjsilva 2013-06-10 11:07 ` Rego, P. 2 siblings, 1 reply; 55+ messages in thread From: Simon Wright @ 2013-06-08 6:22 UTC (permalink / raw) mjsilva@scriptoriumdesigns.com writes: > On Wednesday, May 29, 2013 6:36:31 AM UTC-7, J-P. Rosen wrote: >> Just connected to libre and surprise! The site proposed the 2013 edition! > > I was disappointed to see that their ARM Cortex version is not > available. I was looking forward to using it and evangelizing Ada > with it. There were announcements around 28 Feb (e.g. [1]), but nothing to see now at adacore.com. [1] http://goo.gl/JR0Po ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-08 6:22 ` Simon Wright @ 2013-06-08 23:23 ` mjsilva 0 siblings, 0 replies; 55+ messages in thread From: mjsilva @ 2013-06-08 23:23 UTC (permalink / raw) On Friday, June 7, 2013 11:22:10 PM UTC-7, Simon Wright wrote: > mjsilva@scriptoriumdesigns.com writes: > > > > > On Wednesday, May 29, 2013 6:36:31 AM UTC-7, J-P. Rosen wrote: > > >> Just connected to libre and surprise! The site proposed the 2013 edition! > > > > > > I was disappointed to see that their ARM Cortex version is not > > > available. I was looking forward to using it and evangelizing Ada > > > with it. > > > > There were announcements around 28 Feb (e.g. [1]), but nothing to see > > now at adacore.com. > > [1] http://goo.gl/JR0Po Yes, odd that it's been announced but still isn't listed as a platform. I've really been chomping at the bit to get Ada on some Cortex M3 hardware. Hope it happens soon. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-07 15:52 ` mjsilva 2013-06-07 20:15 ` Dmitry A. Kazakov 2013-06-08 6:22 ` Simon Wright @ 2013-06-10 11:07 ` Rego, P. 2013-06-13 13:30 ` Rego, P. 2 siblings, 1 reply; 55+ messages in thread From: Rego, P. @ 2013-06-10 11:07 UTC (permalink / raw) On Friday, June 7, 2013 12:52:27 PM UTC-3, mjs...@scriptoriumdesigns.com wrote: > On Wednesday, May 29, 2013 6:36:31 AM UTC-7, J-P. Rosen wrote: > > > Just connected to libre and surprise! The site proposed the 2013 edition! > > > > I was disappointed to see that their ARM Cortex version is not available. I was looking forward to using it and evangelizing Ada with it. Also the avr-elf-windows is not available. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-10 11:07 ` Rego, P. @ 2013-06-13 13:30 ` Rego, P. 2013-06-17 6:35 ` Jacob Sparre Andersen 0 siblings, 1 reply; 55+ messages in thread From: Rego, P. @ 2013-06-13 13:30 UTC (permalink / raw) Does someone know if the lacking versions will be available still in 2013? Even more, if not, are they going to be discontinued? avr-elf-windows and mindstorms-nxt-windows are very good incentive to the academia to stimulate the use of Ada for students since the beginning. It worries me if they are not going to be available in near future. Rego. On Monday, June 10, 2013 8:07:56 AM UTC-3, Rego, P. wrote: > On Friday, June 7, 2013 12:52:27 PM UTC-3, mjs...@scriptoriumdesigns.com wrote: > > > On Wednesday, May 29, 2013 6:36:31 AM UTC-7, J-P. Rosen wrote: > > > > > > > Just connected to libre and surprise! The site proposed the 2013 edition! > > > > > > > > > > > > I was disappointed to see that their ARM Cortex version is not available. I was looking forward to using it and evangelizing Ada with it. > > > > Also the avr-elf-windows is not available. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-13 13:30 ` Rego, P. @ 2013-06-17 6:35 ` Jacob Sparre Andersen 2013-06-22 8:17 ` MatthiasR 0 siblings, 1 reply; 55+ messages in thread From: Jacob Sparre Andersen @ 2013-06-17 6:35 UTC (permalink / raw) "Rego, P." <pvrego@gmail.com> writes: > Does someone know if the lacking versions will be available still in > 2013? Even more, if not, are they going to be discontinued? > avr-elf-windows and mindstorms-nxt-windows are very good incentive to > the academia to stimulate the use of Ada for students since the > beginning. It worries me if they are not going to be available in near > future. The common procedure of AdaCore seems to be to have the two most recent GPL releases available all the time. IIRC the 2011 releases were available until the 2013 releases went public. Greetings, Jacob -- "The current state of knowledge can be summarised thus: In the beginning, there was nothing, which exploded." ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-17 6:35 ` Jacob Sparre Andersen @ 2013-06-22 8:17 ` MatthiasR 2014-03-18 0:04 ` Rego, P. 0 siblings, 1 reply; 55+ messages in thread From: MatthiasR @ 2013-06-22 8:17 UTC (permalink / raw) Jacob Sparre Andersen wrote: > "Rego, P." <pvrego@gmail.com> writes: > >> Does someone know if the lacking versions will be available still in >> 2013? Even more, if not, are they going to be discontinued? >> avr-elf-windows and mindstorms-nxt-windows are very good incentive to >> the academia to stimulate the use of Ada for students since the >> beginning. It worries me if they are not going to be available in near >> future. > > The common procedure of AdaCore seems to be to have the two most recent > GPL releases available all the time. IIRC the 2011 releases were > available until the 2013 releases went public. More exactly speaking, the releases of the two last years. There are no 2013 releases of avr-elf-windows and mindstorms-nxt-windows. At the moment, there are only the 2012 releases available. One could speculate about the question "what will happen in 2014?"... Greetings Matthias ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-22 8:17 ` MatthiasR @ 2014-03-18 0:04 ` Rego, P. 0 siblings, 0 replies; 55+ messages in thread From: Rego, P. @ 2014-03-18 0:04 UTC (permalink / raw) On Saturday, June 22, 2013 5:17:06 AM UTC-3, MatthiasR wrote: > More exactly speaking, the releases of the two last years. There are no 2013 > releases of avr-elf-windows and mindstorms-nxt-windows. At the moment, there > are only the 2012 releases available. One could speculate about the question > "what will happen in 2014?"... Well... we got this point. I am facing to a gcc bug which is supposed to be corrected in newer versions of gcc (see thread https://groups.google.com/d/topic/comp.lang.ada/kIO399fd-gc/discussion), so 2013 avr-elf-windows release would have the problem fixed. avr-elf-windows from 2012 release is built on gcc-4.5.4, far away from the current version (I guess gcc-4.8.2). So the question remains... "what will happen in 2014?". ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-29 13:36 Gnat 2013 is out! J-P. Rosen ` (4 preceding siblings ...) 2013-06-07 15:52 ` mjsilva @ 2013-06-11 7:52 ` Maciej Sobczak 2013-06-11 9:35 ` J-P. Rosen 2013-06-11 12:09 ` John Doe 2013-06-12 7:58 ` Maciej Sobczak 6 siblings, 2 replies; 55+ messages in thread From: Maciej Sobczak @ 2013-06-11 7:52 UTC (permalink / raw) W dniu środa, 29 maja 2013 15:36:31 UTC+2 użytkownik J-P. Rosen napisał: > Just connected to libre and surprise! The site proposed the 2013 edition! And still the Windows package for GNAT (+GPS) comes without AWS already installed. The AWS installation breaks GPS (that is, after make install of AWS the GPS program crashes at the start). I had to reinstall GPS after that to get it working again. And still I would like to encourage my friend on Windows to try AWS as a way to get introduced to Ada and I don't want to force him to install Cygwin. He has some website development experience and I'm sure that AWS would be a jaw-dropping show for him, but under one condition: It Must Work Out Of The Box. Is it really so difficult to make more inclusive package for Windows users? Like, you know, so that the marketing phrase "Get started today!" actually makes sense? GPS already comes with some libraries prepackaged - why not the flagship AWS, which is a great way to preach Ada to newcomers? (Still perplexed with the marketing clumsiness of the Ada vendors.) -- Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-11 7:52 ` Maciej Sobczak @ 2013-06-11 9:35 ` J-P. Rosen 2013-06-11 12:09 ` John Doe 1 sibling, 0 replies; 55+ messages in thread From: J-P. Rosen @ 2013-06-11 9:35 UTC (permalink / raw) Le 11/06/2013 09:52, Maciej Sobczak a écrit : > And still the Windows package for GNAT (+GPS) comes without AWS > already installed. > > The AWS installation breaks GPS (that is, after make install of AWS > the GPS program crashes at the start). I had to reinstall GPS after > that to get it working again. And still I would like to encourage my > friend on Windows to try AWS as a way to get introduced to Ada and I > don't want to force him to install Cygwin. He has some website > development experience and I'm sure that AWS would be a jaw-dropping > show for him, but under one condition: It Must Work Out Of The Box. > I don't think it should be included with the basic GNAT (I think the "build you own download package" is nice), but I do agree that it should work out of the box, preferably with an installer for Windows user. By all means, please complain to AdaCore. I already did, and I will do it again for GPL2013, but only if many people complain will they consider it. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-11 7:52 ` Maciej Sobczak 2013-06-11 9:35 ` J-P. Rosen @ 2013-06-11 12:09 ` John Doe 1 sibling, 0 replies; 55+ messages in thread From: John Doe @ 2013-06-11 12:09 UTC (permalink / raw) Le mardi 11 juin 2013 09:52:20 UTC+2, Maciej Sobczak a écrit : > W dniu środa, 29 maja 2013 15:36:31 UTC+2 użytkownik J-P. Rosen napisał: > > > Just connected to libre and surprise! The site proposed the 2013 edition! > > > > And still the Windows package for GNAT (+GPS) comes without AWS already installed. > > > > The AWS installation breaks GPS (that is, after make install of AWS the GPS program crashes at the start). I had to reinstall GPS after that to get it working again. > As far I remember, when I installed AWS on Windows (one year ago) I had the same crash of GPS after AWS install. I found that the cause of the crash was a discrepancy in the libz.dll. AWS and GPS were using different versions of libz.dll I don't know if is still true, as I have not installed AWS recently. To avoid GPS crash : save somewhere the libz.dll from GPS / install AWS / restore the old libz.dll ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-05-29 13:36 Gnat 2013 is out! J-P. Rosen ` (5 preceding siblings ...) 2013-06-11 7:52 ` Maciej Sobczak @ 2013-06-12 7:58 ` Maciej Sobczak 2013-06-12 11:01 ` G.B. 2013-06-12 20:01 ` Robert A Duff 6 siblings, 2 replies; 55+ messages in thread From: Maciej Sobczak @ 2013-06-12 7:58 UTC (permalink / raw) W dniu środa, 29 maja 2013 15:36:31 UTC+2 użytkownik J-P. Rosen napisał: > Just connected to libre and surprise! The site proposed the 2013 edition! So I have downloaded the Linux version, followed the installation procedure and... the gcc and g++ compilers that are part of the package do not work (the standard header files do not seem to form a complete set and even the hello world program in C and C++ reach out to system header files and from there they cannot find their dependencies - this is on Ubuntu). Unfortunately it is not only header files - after downloading AWS and running make setup, the scripts try to build some little test program (xoscons) that fails to link due to missing crtp.o, which breaks the whole procedure. Did anybody try to install GNAT GPL 2013 on a Linux box? -- Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-12 7:58 ` Maciej Sobczak @ 2013-06-12 11:01 ` G.B. 2013-06-12 20:01 ` Robert A Duff 1 sibling, 0 replies; 55+ messages in thread From: G.B. @ 2013-06-12 11:01 UTC (permalink / raw) On 12.06.13 09:58, Maciej Sobczak wrote: > W dniu środa, 29 maja 2013 15:36:31 UTC+2 użytkownik J-P. Rosen napisał: >> Just connected to libre and surprise! The site proposed the 2013 edition! > > So I have downloaded the Linux version, followed the installation procedure and... the gcc and g++ compilers that are part of the package do not work (the standard header files do not seem to form a complete set and even the hello world program in C and C++ reach out to system header files and from there they cannot find their dependencies - this is on Ubuntu). Unfortunately it is not only header files - after downloading AWS and running make setup, the scripts try to build some little test program (xoscons) that fails to link due to missing crtp.o, which breaks the whole procedure. > > Did anybody try to install GNAT GPL 2013 on a Linux box? > Yes (Ubuntu 12.04 LTS), and I may have been able to supply suitable libraries to make gsp_exe load successfully; however, hopefully due to the X server running on a different, somehow blocked, system, I did not see any output. More on that, and on the compiler proper, later. (The missing C library dependence rings a bell; I recall something similar in a more general, not GNAT specific setting. Needed to install some additional runtime support.) ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-12 7:58 ` Maciej Sobczak 2013-06-12 11:01 ` G.B. @ 2013-06-12 20:01 ` Robert A Duff 2013-06-12 20:36 ` Georg Bauhaus 2013-06-13 7:38 ` Maciej Sobczak 1 sibling, 2 replies; 55+ messages in thread From: Robert A Duff @ 2013-06-12 20:01 UTC (permalink / raw) Maciej Sobczak <see.my.homepage@gmail.com> writes: > So I have downloaded the Linux version, followed the installation > procedure and... the gcc and g++ compilers that are part of the > package do not work (the standard header files do not seem to form a > complete set and even the hello world program in C and C++ reach out > to system header files and from there they cannot find their > dependencies - this is on Ubuntu). Unfortunately it is not only header > files - after downloading AWS and running make setup, the scripts try > to build some little test program (xoscons) that fails to link due to > missing crtp.o, which breaks the whole procedure. I think you might need something like this: export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu - Bob ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-12 20:01 ` Robert A Duff @ 2013-06-12 20:36 ` Georg Bauhaus 2013-06-13 7:38 ` Maciej Sobczak 1 sibling, 0 replies; 55+ messages in thread From: Georg Bauhaus @ 2013-06-12 20:36 UTC (permalink / raw) On 12.06.13 22:01, Robert A Duff wrote: > Maciej Sobczak <see.my.homepage@gmail.com> writes: > >> So I have downloaded the Linux version, followed the installation >> procedure and... the gcc and g++ compilers that are part of the >> package do not work (the standard header files do not seem to form a >> complete set and even the hello world program in C and C++ reach out >> to system header files and from there they cannot find their >> dependencies - this is on Ubuntu). Unfortunately it is not only header >> files - after downloading AWS and running make setup, the scripts try >> to build some little test program (xoscons) that fails to link due to >> missing crtp.o, which breaks the whole procedure. > > I think you might need something like this: > > export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu > export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu Yes, the LIBRARY_PATH, and also the C_INCLUDE_PATH, they are effective, and needed, on Ubuntu 12.04. May I humbly suggest that a note be added to both README and doinstall mentioning these? ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Gnat 2013 is out! 2013-06-12 20:01 ` Robert A Duff 2013-06-12 20:36 ` Georg Bauhaus @ 2013-06-13 7:38 ` Maciej Sobczak 1 sibling, 0 replies; 55+ messages in thread From: Maciej Sobczak @ 2013-06-13 7:38 UTC (permalink / raw) W dniu środa, 12 czerwca 2013 22:01:41 UTC+2 użytkownik Robert A Duff napisał: > I think you might need something like this: > > export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu > export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu Yes, the complete set that worked for me was: export PATH=/usr/gnat/2013/bin:$PATH export LD_LIBRARY_PATH=/usr/gnat/2013/lib:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH export LIBRARY_PATH=/usr/gnat/2013/lib:/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu export GPR_PROJECT_PATH=/usr/gnat/2013/lib/gnat:/opt/gtkada3/lib/gnat Thanks to Francois Fabien for sending me these hints, hopefully they will be useful to others as well. Still GPS cannot start due to mismatchin libjpeg shared library version, but this is not a critical problem. -- Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com ^ permalink raw reply [flat|nested] 55+ messages in thread
end of thread, other threads:[~2014-03-18 0:04 UTC | newest] Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-05-29 13:36 Gnat 2013 is out! J-P. Rosen 2013-05-29 15:03 ` Simon Wright 2013-05-29 16:13 ` Simon Wright 2013-05-29 22:39 ` Randy Brukardt 2013-05-30 2:01 ` Adam Beneschan 2013-05-30 8:01 ` Bill Findlay 2013-05-30 23:09 ` Dennis Lee Bieber 2013-05-31 5:02 ` J-P. Rosen 2013-05-31 18:35 ` Bill Findlay 2013-05-30 10:39 ` Simon Wright 2013-05-30 16:21 ` Adam Beneschan 2013-05-30 19:53 ` Randy Brukardt 2013-05-31 7:41 ` Dmitry A. Kazakov 2013-05-31 11:30 ` Stefan.Lucks 2013-05-31 12:03 ` Niklas Holsti 2013-05-31 22:07 ` Randy Brukardt 2013-06-01 11:51 ` Georg Bauhaus 2013-06-03 14:52 ` Adam Beneschan 2013-06-04 17:42 ` Wesley Pan 2013-06-04 18:34 ` Adam Beneschan 2013-06-04 19:00 ` Wesley Pan 2013-06-05 15:40 ` Eryndlia Mavourneen 2013-06-11 2:39 ` Randy Brukardt 2013-06-11 6:31 ` Georg Bauhaus 2013-06-19 21:57 ` Randy Brukardt 2013-05-30 0:31 ` Dennis Lee Bieber 2013-05-31 16:12 ` dptrash 2013-06-01 5:10 ` Stephen Leake 2013-06-01 6:00 ` Per Sandberg 2013-06-01 6:46 ` J-P. Rosen 2013-06-01 15:22 ` Bill Findlay 2013-08-27 14:08 ` Yannick Duchêne (Hibou57) 2013-08-27 20:05 ` wilson 2013-08-27 22:59 ` Dennis Lee Bieber 2013-08-28 7:35 ` Dmitry A. Kazakov 2013-08-28 23:39 ` Dennis Lee Bieber 2013-06-07 2:41 ` gautier_niouzes 2013-06-07 15:52 ` mjsilva 2013-06-07 20:15 ` Dmitry A. Kazakov 2013-06-09 18:51 ` MatthiasR 2013-06-08 6:22 ` Simon Wright 2013-06-08 23:23 ` mjsilva 2013-06-10 11:07 ` Rego, P. 2013-06-13 13:30 ` Rego, P. 2013-06-17 6:35 ` Jacob Sparre Andersen 2013-06-22 8:17 ` MatthiasR 2014-03-18 0:04 ` Rego, P. 2013-06-11 7:52 ` Maciej Sobczak 2013-06-11 9:35 ` J-P. Rosen 2013-06-11 12:09 ` John Doe 2013-06-12 7:58 ` Maciej Sobczak 2013-06-12 11:01 ` G.B. 2013-06-12 20:01 ` Robert A Duff 2013-06-12 20:36 ` Georg Bauhaus 2013-06-13 7:38 ` Maciej Sobczak
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox