comp.lang.ada
 help / color / mirror / Atom feed
* Placement of pragma Import
@ 2002-12-08 10:23 Michal Nowak
  2002-12-08 12:26 ` Simon Wright
  2002-12-08 18:44 ` Jeffrey Carter
  0 siblings, 2 replies; 22+ messages in thread
From: Michal Nowak @ 2002-12-08 10:23 UTC (permalink / raw)


Hello all,

I have a little question coming out of curiosity.

I have an assembly routine (in fact it may be a C code,
or something other, it does not matter).
I'm importing this subroutine in a package. It is possible
to place pragma Import in two (maybe more?) places:

-- Possibility 1:

package Import_Test is
   
   procedure Asm_Coded;

   pragma Import (Assembler, Asm_Coded, "donothing");   
   pragma Linker_Options ("nothing_asm.s");      
   
end Import_Test;

-- Possibility 2:
package Import_Test is
   
   procedure Asm_Coded;

private   -- Imported in private section

   pragma Import (Assembler, Asm_Coded, "donothing");
   pragma Linker_Options ("nothing_asm.s");      
   
end Import_Test;

And a simple program which makes use of the above package:
---------------------------------
with Import_Test;

procedure Test is
begin
   Import_Test.Asm_Coded;
end Test;
---------------------------------

The generated assembly source for Import_Test and Test subprogram 
is the same in both cases. The program behaves and links in the
same way in both cases, but such test is not a proper way to say
if something is correct (?) or not.
I disassembled the main executable file with objdump and there are
some differences. However, this analysis didn't gave me answer to
what I want to know:
- what is the difference between 1st and 2nd possibility (from Ada
  point of view)?
- if there is a difference, how does it affect program behavior,
  visibility rules, etc.?
- if there is no difference, why?

Thanks for any info,
   - Michal


-- -----------------------------------------------------------------
--   ___        _
--  / _ \      | |                      I Choose Ada:
-- | |_| |  ___| |   _____   The Most Trusted Name in Software (TM)
-- |  _  | | __  |  | __  | 
-- |_| |_| |_____|_ |_____|_ http://www.adaic.org/whyada/choose.html
--
-- -----------------------------------------------------------------




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

* Re: Placement of pragma Import
       [not found] <200212081123160930.0047D332@smtp-po.inetia.pl>
@ 2002-12-08 11:12 ` David C. Hoos, Sr.
  2002-12-08 18:49   ` tmoran
       [not found] ` <053001c29eaa$ad9b72f0$6500000a@dhoos>
  1 sibling, 1 reply; 22+ messages in thread
From: David C. Hoos, Sr. @ 2002-12-08 11:12 UTC (permalink / raw)


In my opinion, the best place to put it would be in the package
body.  After all, what you're declaring with the pragma Import
is the _implementation_ of the procedure Asm_Coded.

The fact that you're importing the implementation has nothing
whatever to do with the specification, so it should not
appear there.

David C. Hoos

----- Original Message ----- 
From: "Michal Nowak" <vinnie@inetia.pl>
To: "comp.lang.ada usegroup->mailing list gateway" <comp.lang.ada@ada.eu.org>
Sent: December 08, 2002 4:23 AM
Subject: Placement of pragma Import


> Hello all,
> 
> I have a little question coming out of curiosity.
> 
> I have an assembly routine (in fact it may be a C code,
> or something other, it does not matter).
> I'm importing this subroutine in a package. It is possible
> to place pragma Import in two (maybe more?) places:
> 
> -- Possibility 1:
> 
> package Import_Test is
>    
>    procedure Asm_Coded;
> 
>    pragma Import (Assembler, Asm_Coded, "donothing");   
>    pragma Linker_Options ("nothing_asm.s");      
>    
> end Import_Test;
> 
> -- Possibility 2:
> package Import_Test is
>    
>    procedure Asm_Coded;
> 
> private   -- Imported in private section
> 
>    pragma Import (Assembler, Asm_Coded, "donothing");
>    pragma Linker_Options ("nothing_asm.s");      
>    
> end Import_Test;
> 
> And a simple program which makes use of the above package:
> ---------------------------------
> with Import_Test;
> 
> procedure Test is
> begin
>    Import_Test.Asm_Coded;
> end Test;
> ---------------------------------
> 
> The generated assembly source for Import_Test and Test subprogram 
> is the same in both cases. The program behaves and links in the
> same way in both cases, but such test is not a proper way to say
> if something is correct (?) or not.
> I disassembled the main executable file with objdump and there are
> some differences. However, this analysis didn't gave me answer to
> what I want to know:
> - what is the difference between 1st and 2nd possibility (from Ada
>   point of view)?
> - if there is a difference, how does it affect program behavior,
>   visibility rules, etc.?
> - if there is no difference, why?
> 
> Thanks for any info,
>    - Michal
> 
> 
> -- -----------------------------------------------------------------
> --   ___        _
> --  / _ \      | |                      I Choose Ada:
> -- | |_| |  ___| |   _____   The Most Trusted Name in Software (TM)
> -- |  _  | | __  |  | __  | 
> -- |_| |_| |_____|_ |_____|_ http://www.adaic.org/whyada/choose.html
> --
> -- -----------------------------------------------------------------
> 
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
> 
> 




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

* Re: Placement of pragma Import
  2002-12-08 10:23 Michal Nowak
@ 2002-12-08 12:26 ` Simon Wright
  2002-12-08 15:08   ` Michal Nowak
  2002-12-08 18:44 ` Jeffrey Carter
  1 sibling, 1 reply; 22+ messages in thread
From: Simon Wright @ 2002-12-08 12:26 UTC (permalink / raw)


Michal Nowak <vinnie@inetia.pl> writes:

> -- Possibility 1:
> 
> package Import_Test is
>    
>    procedure Asm_Coded;
> 
>    pragma Import (Assembler, Asm_Coded, "donothing");   
>    pragma Linker_Options ("nothing_asm.s");      
>    
> end Import_Test;
> 
> -- Possibility 2:
> package Import_Test is
>    
>    procedure Asm_Coded;
> 
> private   -- Imported in private section
> 
>    pragma Import (Assembler, Asm_Coded, "donothing");
>    pragma Linker_Options ("nothing_asm.s");      
>    
> end Import_Test;

I would certainly use the second choice; it probably makes no
difference to the generated code, but it removes complication from the
public part of the spec.

By the way, I think you meant nothing_asm.o, not nothing_asm.s?



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

* Re: Placement of pragma Import
       [not found] ` <053001c29eaa$ad9b72f0$6500000a@dhoos>
@ 2002-12-08 15:07   ` Michal Nowak
  0 siblings, 0 replies; 22+ messages in thread
From: Michal Nowak @ 2002-12-08 15:07 UTC (permalink / raw)


On 2002-12-08 at 05:12 David C. Hoos, Sr. wrote:

>In my opinion, the best place to put it would be in the package
>body.  After all, what you're declaring with the pragma Import
>is the _implementation_ of the procedure Asm_Coded.
>
>The fact that you're importing the implementation has nothing
>whatever to do with the specification, so it should not
>appear there.

Do you mean something like this:

------------- SPEC ---------------
package Import_Test is
   
   procedure Asm_Coded;
   
end Import_Test;

----------------------------------

------------- BODY ---------------

package body Import_Test is

   pragma Import (Assembler, Asm_Coded, "donothing");   
   pragma Linker_Options ("nothing_asm.o");
   
end Import_Test;

----------------------------------

I thought about it also as it sounds like a good idea, but this will
not compile. So it still remains in spec.

   - Michal


-- -----------------------------------------------------------------
--   ___        _
--  / _ \      | |                      I Choose Ada:
-- | |_| |  ___| |   _____   The Most Trusted Name in Software (TM)
-- |  _  | | __  |  | __  | 
-- |_| |_| |_____|_ |_____|_ http://www.adaic.org/whyada/choose.html
--
-- -----------------------------------------------------------------




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

* Re: Placement of pragma Import
  2002-12-08 12:26 ` Simon Wright
@ 2002-12-08 15:08   ` Michal Nowak
  2002-12-08 18:46     ` Jeffrey Carter
  2002-12-09 14:34     ` Wes Groleau
  0 siblings, 2 replies; 22+ messages in thread
From: Michal Nowak @ 2002-12-08 15:08 UTC (permalink / raw)


On 2002-12-08 at 12:26 Simon Wright wrote:

>Michal Nowak <vinnie@inetia.pl> writes:
>
>> -- Possibility 1:
>> 
>> package Import_Test is
>>    
>>    procedure Asm_Coded;
>> 
>>    pragma Import (Assembler, Asm_Coded, "donothing");   
>>    pragma Linker_Options ("nothing_asm.s");      
>>    
>> end Import_Test;
>> 
>> -- Possibility 2:
>> package Import_Test is
>>    
>>    procedure Asm_Coded;
>> 
>> private   -- Imported in private section
>> 
>>    pragma Import (Assembler, Asm_Coded, "donothing");
>>    pragma Linker_Options ("nothing_asm.s");      
>>    
>> end Import_Test;
>
>I would certainly use the second choice; it probably makes no
>difference to the generated code, but it removes complication from the
>public part of the spec.

Yes, I agree, that it looks better to put it in private section. 
However I want to be aware what I'm doing and what consequences it
may have. The disassembled main executable differs a bit in these
two cases. I'll try to analyze it a more deeper, although I'm not
an assembly guru, so I'm not sure if I understand it properly.

>By the way, I think you meant nothing_asm.o, not nothing_asm.s?

Well, yes and...no. When you pointed me this I recalled, that 
in my work some time ago I did it by passing the ".o" file as
an argument (under ObjectAda). But the posted code I compiled
under GNAT and it worked. Now I read RM and it says B.1 (37):

37    Pragma Linker_Options has the effect of passing its string
argument as a parameter to the system linker (if one exists), if
the immediately enclosing compilation unit is included in the 
partition being linked. The interpretation of the string argument,
and the way in which the string arguments from multiple Linker_Options
pragmas are combined, is implementation defined.

So if I understood it correctly, it depends from implementation
how it is processed. Seems GNAT compilation system is intelligent
enough to compile the assembly source first and then link it.

   - Michal


"<<Over 50,000 lines of code, 
   you probably should be programming in Ada.>>
Whoever said that, he's right."





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

* Re: Placement of pragma Import
  2002-12-08 10:23 Michal Nowak
  2002-12-08 12:26 ` Simon Wright
@ 2002-12-08 18:44 ` Jeffrey Carter
  2002-12-09 21:55   ` Michal Nowak
  1 sibling, 1 reply; 22+ messages in thread
From: Jeffrey Carter @ 2002-12-08 18:44 UTC (permalink / raw)


Michal Nowak wrote:
> Hello all,
> 
> I have a little question coming out of curiosity.
> 
> I have an assembly routine (in fact it may be a C code,
> or something other, it does not matter).
> I'm importing this subroutine in a package. It is possible
> to place pragma Import in two (maybe more?) places:
> 
> -- Possibility 1:
> 
> package Import_Test is
>    
>    procedure Asm_Coded;
> 
>    pragma Import (Assembler, Asm_Coded, "donothing");   
>    pragma Linker_Options ("nothing_asm.s");      
>    
> end Import_Test;
> 
> -- Possibility 2:
> package Import_Test is
>    
>    procedure Asm_Coded;
> 
> private   -- Imported in private section
> 
>    pragma Import (Assembler, Asm_Coded, "donothing");
>    pragma Linker_Options ("nothing_asm.s");      
>    
> end Import_Test;
> 

As far as I can see, it makes absolutely no difference. Things in the 
private part are not visible to clients in the Ada sense, but clients 
cannot refer to the pragmata even if they are visible. The human reader 
can see the private part, so putting them there does not hide them in 
any way.

If you could put them in the body, that would hide them from the human 
reader, who should only have to refer to the spec to learn what the 
package does and how to use it. But you can't do that, so it seems to 
make no difference at all.

Perhaps putting them in the private part will signal to human readers 
that the information is not needed to understand the package. That is 
the only reason I can see to prefer one over the other.

-- 
Jeff Carter
"Death awaits you all, with nasty, big, pointy teeth!"
Monty Python & the Holy Grail




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

* Re: Placement of pragma Import
  2002-12-08 15:08   ` Michal Nowak
@ 2002-12-08 18:46     ` Jeffrey Carter
  2002-12-08 19:46       ` Dennis Lee Bieber
                         ` (2 more replies)
  2002-12-09 14:34     ` Wes Groleau
  1 sibling, 3 replies; 22+ messages in thread
From: Jeffrey Carter @ 2002-12-08 18:46 UTC (permalink / raw)


Michal Nowak wrote:
> 
> "<<Over 50,000 lines of code, 
>    you probably should be programming in Ada.>>
> Whoever said that, he's right."

I think you'll find that that was Dennis Ritchie.

-- 
Jeff Carter
"Death awaits you all, with nasty, big, pointy teeth!"
Monty Python & the Holy Grail




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

* Re: Placement of pragma Import
  2002-12-08 11:12 ` Placement of pragma Import David C. Hoos, Sr.
@ 2002-12-08 18:49   ` tmoran
  0 siblings, 0 replies; 22+ messages in thread
From: tmoran @ 2002-12-08 18:49 UTC (permalink / raw)


> In my opinion, the best place to put it would be in the package
> body.  After all, what you're declaring with the pragma Import
> is the _implementation_ of the procedure Asm_Coded.
  "If a completion is a pragma Import, then it shall appear in
the same declarative part, package specification, ... as the
declaration." RM B.1(22)
  "The convention represents the calling convention..." ARM B.1(30)
A caller, which has access only to the spec, clearly needs to know
the calling convention.



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

* Re: Placement of pragma Import
  2002-12-08 18:46     ` Jeffrey Carter
@ 2002-12-08 19:46       ` Dennis Lee Bieber
  2002-12-08 21:08         ` James S. Rogers
                           ` (2 more replies)
  2002-12-08 22:40       ` Martin Dowie
  2002-12-09 21:55       ` Michal Nowak
  2 siblings, 3 replies; 22+ messages in thread
From: Dennis Lee Bieber @ 2002-12-08 19:46 UTC (permalink / raw)


Jeffrey Carter fed this fish to the penguins on Sunday 08 December 2002 
10:46 am:

> Michal Nowak wrote:
>> 
>> "<<Over 50,000 lines of code,
>>    you probably should be programming in Ada.>>
>> Whoever said that, he's right."
> 
> I think you'll find that that was Dennis Ritchie.
> 

        <heh> The PERL folks would probably suggest you could do the same in 
10K lines of PERL...

-- 
 > ============================================================== <
 >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed@dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >        Bestiaria Home Page: http://www.beastie.dm.net/         <
 >            Home Page: http://www.dm.net/~wulfraed/             <




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

* Re: Placement of pragma Import
  2002-12-08 19:46       ` Dennis Lee Bieber
@ 2002-12-08 21:08         ` James S. Rogers
  2002-12-09  1:21         ` Jeffrey Carter
  2002-12-09 21:56         ` Michal Nowak
  2 siblings, 0 replies; 22+ messages in thread
From: James S. Rogers @ 2002-12-08 21:08 UTC (permalink / raw)



"Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message
news:8i70ta.ud3.ln@beastie.ix.netcom.com...
> Jeffrey Carter fed this fish to the penguins on Sunday 08 December 2002
> 10:46 am:
>
> > Michal Nowak wrote:
> >>
> >> "<<Over 50,000 lines of code,
> >>    you probably should be programming in Ada.>>
> >> Whoever said that, he's right."
> >
> > I think you'll find that that was Dennis Ritchie.
> >
>
>         <heh> The PERL folks would probably suggest you could do the same
in
> 10K lines of PERL...

Please reference the successful safety critical real time systems written
in PERL.

Jim Rogers





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

* Re: Placement of pragma Import
  2002-12-08 18:46     ` Jeffrey Carter
  2002-12-08 19:46       ` Dennis Lee Bieber
@ 2002-12-08 22:40       ` Martin Dowie
  2002-12-09  1:42         ` Jeffrey Carter
  2002-12-09 21:55       ` Michal Nowak
  2 siblings, 1 reply; 22+ messages in thread
From: Martin Dowie @ 2002-12-08 22:40 UTC (permalink / raw)


"Jeffrey Carter" <jrcarter@acm.org> wrote in message
news:3DF393AA.6040709@acm.org...
> Michal Nowak wrote:
> > "<<Over 50,000 lines of code,
> >    you probably should be programming in Ada.>>
> > Whoever said that, he's right."
>
> I think you'll find that that was Dennis Ritchie.

It was actually P J Plauger (of Dinkumware) who, I believe sits
on the ANSI C & C++ committees. I have a reference to this
quote in a '97 DISA and JIEO presentation where the SLOC
is given as 100,000.

I understand that he has been quizzed on this infamous quote
by at least one of the regular poster/readers to this newsgroup
and it seems he really did say this or at least something so close
to it as not to be slanderous!








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

* Re: Placement of pragma Import
  2002-12-08 19:46       ` Dennis Lee Bieber
  2002-12-08 21:08         ` James S. Rogers
@ 2002-12-09  1:21         ` Jeffrey Carter
  2002-12-09  4:47           ` Dennis Lee Bieber
  2002-12-09 21:56         ` Michal Nowak
  2 siblings, 1 reply; 22+ messages in thread
From: Jeffrey Carter @ 2002-12-09  1:21 UTC (permalink / raw)


Dennis Lee Bieber wrote:
 > Jeffrey Carter fed this fish to the penguins on Sunday 08 December
 > 2002 10:46 am:

I don't remember any penguins. Did they eat it?

 >
 >> Michal Nowak wrote:
 >>
 >>> "<<Over 50,000 lines of code, you probably should be programming
 >>> in Ada.>> Whoever said that, he's right."
 >>
 >> I think you'll find that that was Dennis Ritchie.
 >>
 >
 >
 > <heh> The PERL folks would probably suggest you could do the same in
 >  10K lines of PERL...

Or 1 line of APL ...

-- 
Jeff Carter
"My brain hurts!"
Monty Python's Flying Circus




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

* Re: Placement of pragma Import
  2002-12-08 22:40       ` Martin Dowie
@ 2002-12-09  1:42         ` Jeffrey Carter
  2002-12-09  7:00           ` Martin Dowie
  2002-12-10  2:04           ` Randy Brukardt
  0 siblings, 2 replies; 22+ messages in thread
From: Jeffrey Carter @ 2002-12-09  1:42 UTC (permalink / raw)


Martin Dowie wrote:
> "Jeffrey Carter" <jrcarter@acm.org> wrote in message
> news:3DF393AA.6040709@acm.org...
> 
>>Michal Nowak wrote:
>>
>>>"<<Over 50,000 lines of code,
>>>   you probably should be programming in Ada.>>
>>>Whoever said that, he's right."
>>
>>I think you'll find that that was Dennis Ritchie.
> 
> 
> It was actually P J Plauger (of Dinkumware) who, I believe sits
> on the ANSI C & C++ committees. I have a reference to this
> quote in a '97 DISA and JIEO presentation where the SLOC
> is given as 100,000.

Interesting. Is there a URL for this reference?

-- 
Jeff Carter
"My brain hurts!"
Monty Python's Flying Circus




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

* Re: Placement of pragma Import
  2002-12-09  1:21         ` Jeffrey Carter
@ 2002-12-09  4:47           ` Dennis Lee Bieber
  0 siblings, 0 replies; 22+ messages in thread
From: Dennis Lee Bieber @ 2002-12-09  4:47 UTC (permalink / raw)


Jeffrey Carter fed this fish to the penguins on Sunday 08 December 2002 
05:21 pm:

> Dennis Lee Bieber wrote:
>  > Jeffrey Carter fed this fish to the penguins on Sunday 08 December
>  > 2002 10:46 am:
> 
> I don't remember any penguins. Did they eat it?
>
        Considering what comes with most distributions, Tux will eat anything 
<G>
> 
> Or 1 line of APL ...

        I'm not sure I'd go that far <G>; especially if one doesn't have an 
APL keyboard and is using keywords instead.... 4 5 $rho 20 ? 52 
(someday I'll have to dig up my text and add the conversion to human 
readable card IDs).

-- 
 > ============================================================== <
 >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed@dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >        Bestiaria Home Page: http://www.beastie.dm.net/         <
 >            Home Page: http://www.dm.net/~wulfraed/             <




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

* Re: Placement of pragma Import
  2002-12-09  1:42         ` Jeffrey Carter
@ 2002-12-09  7:00           ` Martin Dowie
  2002-12-10  2:04           ` Randy Brukardt
  1 sibling, 0 replies; 22+ messages in thread
From: Martin Dowie @ 2002-12-09  7:00 UTC (permalink / raw)


"Jeffrey Carter" <jrcarter@acm.org> wrote in message
news:3DF3F4F8.5000303@acm.org...
> Martin Dowie wrote:
> > It was actually P J Plauger (of Dinkumware) who, I believe sits
> > on the ANSI C & C++ committees. I have a reference to this
> > quote in a '97 DISA and JIEO presentation where the SLOC
> > is given as 100,000.
>
> Interesting. Is there a URL for this reference?

Not that I can find! I can't for the life of me remember where I found
this paper but it must have been 'out there' at some point. I would
have thought it would be in "adaic" somewhere, but I can't see it...

It's about 400KBytes zipped - anyone who wants it, just email me
directly. :-)






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

* Re: Placement of pragma Import
  2002-12-08 15:08   ` Michal Nowak
  2002-12-08 18:46     ` Jeffrey Carter
@ 2002-12-09 14:34     ` Wes Groleau
  2002-12-09 21:56       ` Michal Nowak
  1 sibling, 1 reply; 22+ messages in thread
From: Wes Groleau @ 2002-12-09 14:34 UTC (permalink / raw)



> Yes, I agree, that it looks better to put it in private section. 

Please, no.  The private section is for things you
don't want client code to access directly (but
that can't go in the body).

No client code can access the pragma, so the
only reason to not put it right next to what
it affects is to avoid clutter.  BUT, putting
things like this and rep-clauses at a distance
from what they affect invites forgetting to
update them during maintenance.  Or worse,
being forced to rearrange them due to maintenance
introducing a "freezing" construct.

I had to re-organize a hundred files for an Ada 95
port because folks back in the 1980s thought that
putting rep-specs in the private section was
"information hiding."




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

* Re: Placement of pragma Import
  2002-12-08 18:44 ` Jeffrey Carter
@ 2002-12-09 21:55   ` Michal Nowak
  0 siblings, 0 replies; 22+ messages in thread
From: Michal Nowak @ 2002-12-09 21:55 UTC (permalink / raw)


On 2002-12-08 at 18:44 Jeffrey Carter wrote:

>As far as I can see, it makes absolutely no difference. Things in the 
>private part are not visible to clients in the Ada sense, but clients 
>cannot refer to the pragmata even if they are visible. The human reader 
>can see the private part, so putting them there does not hide them in 
>any way.
>
>If you could put them in the body, that would hide them from the human 
>reader, who should only have to refer to the spec to learn what the 
>package does and how to use it. But you can't do that, so it seems to 
>make no difference at all.
>
>Perhaps putting them in the private part will signal to human readers 
>that the information is not needed to understand the package. That is 
>the only reason I can see to prefer one over the other.

Thank you. That sheds some light on the problem.

  - Michal

-- -----------------------------------------------------------------
--   ___        _
--  / _ \      | |                      I Choose Ada:
-- | |_| |  ___| |   _____   The Most Trusted Name in Software (TM)
-- |  _  | | __  |  | __  | 
-- |_| |_| |_____|_ |_____|_ http://www.adaic.org/whyada/choose.html
--
-- -----------------------------------------------------------------




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

* Re: Placement of pragma Import
  2002-12-08 18:46     ` Jeffrey Carter
  2002-12-08 19:46       ` Dennis Lee Bieber
  2002-12-08 22:40       ` Martin Dowie
@ 2002-12-09 21:55       ` Michal Nowak
  2002-12-10  1:32         ` Jeffrey Carter
  2 siblings, 1 reply; 22+ messages in thread
From: Michal Nowak @ 2002-12-09 21:55 UTC (permalink / raw)


On 2002-12-08 at 18:46 Jeffrey Carter wrote:

>Michal Nowak wrote:
>> 
>> "<<Over 50,000 lines of code, 
>>    you probably should be programming in Ada.>>
>> Whoever said that, he's right."
>
>I think you'll find that that was Dennis Ritchie.

I took it from GNU Ada homepage (http://www.gnuada.org/).
That is why I put two different qutation marks - the << >>
to quote the quotation and the " " to quote the whole 
sentence. 

Two days ago I was looking for an article by Gavin Smyth
"Is Ada a better C"
(http://www.beesknees.freeserve.co.uk/articles/ada-vs-cpp.html),
but because I did not remember the exact title I asked google
to find me "Is Ada better than C". One of the top links took
me to http://www.sysprog.net/quotada.html
where I found that the author is P.J. Plauger.

Finally I found what I was looking for, but I forgot to
update this in my signature. Time to do it now!

   - Michal


"Beyond 100,000 lines of code you
should probably be coding in Ada"
   - P. J. Plauger






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

* Re: Placement of pragma Import
  2002-12-08 19:46       ` Dennis Lee Bieber
  2002-12-08 21:08         ` James S. Rogers
  2002-12-09  1:21         ` Jeffrey Carter
@ 2002-12-09 21:56         ` Michal Nowak
  2 siblings, 0 replies; 22+ messages in thread
From: Michal Nowak @ 2002-12-09 21:56 UTC (permalink / raw)


On 2002-12-08 at 11:46 Dennis Lee Bieber wrote:

>Jeffrey Carter fed this fish to the penguins on Sunday 08 December 2002 
>10:46 am:
>
>> Michal Nowak wrote:
>>> 
>>> "<<Over 50,000 lines of code,
>>>    you probably should be programming in Ada.>>
>>> Whoever said that, he's right."
>> 
>> I think you'll find that that was Dennis Ritchie.
>> 
>
>        <heh> The PERL folks would probably suggest you could do the same
>in 
>10K lines of PERL...

Well, what about "No more than 10 lines of code, you may program it in
PERL"
:-)

   - Michal

PS. Do not treat this as an offence and take it with a smiley. I do not
want
to hurt anyone neither to drop a spark to cause another war. It's enough
that we're quite close to III world war.


-- -----------------------------------------------------------------
--   ___        _
--  / _ \      | |                      I Choose Ada:
-- | |_| |  ___| |   _____   The Most Trusted Name in Software (TM)
-- |  _  | | __  |  | __  | 
-- |_| |_| |_____|_ |_____|_ http://www.adaic.org/whyada/choose.html
--
-- -----------------------------------------------------------------




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

* Re: Placement of pragma Import
  2002-12-09 14:34     ` Wes Groleau
@ 2002-12-09 21:56       ` Michal Nowak
  0 siblings, 0 replies; 22+ messages in thread
From: Michal Nowak @ 2002-12-09 21:56 UTC (permalink / raw)


On 2002-12-09 at 09:34 Wes Groleau wrote:

>> Yes, I agree, that it looks better to put it in private section. 
>
>Please, no.  The private section is for things you
>don't want client code to access directly (but
>that can't go in the body).
>
>No client code can access the pragma, so the
>only reason to not put it right next to what
>it affects is to avoid clutter.  BUT, putting
>things like this and rep-clauses at a distance
>from what they affect invites forgetting to
>update them during maintenance.  Or worse,
>being forced to rearrange them due to maintenance
>introducing a "freezing" construct.
>
>I had to re-organize a hundred files for an Ada 95
>port because folks back in the 1980s thought that
>putting rep-specs in the private section was
>"information hiding."

I was thinking about this little snippet of code I posted
when replying, my fault that I was not precise enough.
Yes, you're right that it depends from the construction of
spec where this pragma should be placed. I had also a problem
when some days ago I was doing sort of code review. The requirement
was saying, that specified subprogram should be imported with
intrinsic. The function was, but I saw no pragma. Finally I found
it - two screens below in private section mixed between two
records...

   - Michal


"In the world of machines, virtual machines,
dominated by software ...
                  ... a new culture is born"




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

* Re: Placement of pragma Import
  2002-12-09 21:55       ` Michal Nowak
@ 2002-12-10  1:32         ` Jeffrey Carter
  0 siblings, 0 replies; 22+ messages in thread
From: Jeffrey Carter @ 2002-12-10  1:32 UTC (permalink / raw)


Michal Nowak wrote:
> Two days ago I was looking for an article by Gavin Smyth
> "Is Ada a better C"
> (http://www.beesknees.freeserve.co.uk/articles/ada-vs-cpp.html),
> but because I did not remember the exact title I asked google
> to find me "Is Ada better than C". One of the top links took
> me to http://www.sysprog.net/quotada.html
> where I found that the author is P.J. Plauger.

Thanks for the link. Now we all know who said it and what he said (I hope).

-- 
Jeff Carter
"Often times we're given rhymes that are quite unsingable."
Monty Python and the Holy Grail




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

* Re: Placement of pragma Import
  2002-12-09  1:42         ` Jeffrey Carter
  2002-12-09  7:00           ` Martin Dowie
@ 2002-12-10  2:04           ` Randy Brukardt
  1 sibling, 0 replies; 22+ messages in thread
From: Randy Brukardt @ 2002-12-10  2:04 UTC (permalink / raw)


Jeffrey Carter wrote in message <3DF3F4F8.5000303@acm.org>...
>Martin Dowie wrote:
>> "Jeffrey Carter" <jrcarter@acm.org> wrote in message
>> news:3DF393AA.6040709@acm.org...
>>
>> It was actually P J Plauger (of Dinkumware) who, I believe sits
>> on the ANSI C & C++ committees. I have a reference to this
>> quote in a '97 DISA and JIEO presentation where the SLOC
>> is given as 100,000.
>
>Interesting. Is there a URL for this reference?


The AdaIC reference is
http://archive.adaic.com/docs/present/ajpo/pll-cost/html/tsld071.htm.
This the the HTML version of a Powerpoint presentation. Unfortunately, I
don't see any source for the comment in this presentation.

The comment is referenced repeatly here (going back to 1991), but I
didn't see any source there either.

                 Randy Brukardt.






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

end of thread, other threads:[~2002-12-10  2:04 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200212081123160930.0047D332@smtp-po.inetia.pl>
2002-12-08 11:12 ` Placement of pragma Import David C. Hoos, Sr.
2002-12-08 18:49   ` tmoran
     [not found] ` <053001c29eaa$ad9b72f0$6500000a@dhoos>
2002-12-08 15:07   ` Michal Nowak
2002-12-08 10:23 Michal Nowak
2002-12-08 12:26 ` Simon Wright
2002-12-08 15:08   ` Michal Nowak
2002-12-08 18:46     ` Jeffrey Carter
2002-12-08 19:46       ` Dennis Lee Bieber
2002-12-08 21:08         ` James S. Rogers
2002-12-09  1:21         ` Jeffrey Carter
2002-12-09  4:47           ` Dennis Lee Bieber
2002-12-09 21:56         ` Michal Nowak
2002-12-08 22:40       ` Martin Dowie
2002-12-09  1:42         ` Jeffrey Carter
2002-12-09  7:00           ` Martin Dowie
2002-12-10  2:04           ` Randy Brukardt
2002-12-09 21:55       ` Michal Nowak
2002-12-10  1:32         ` Jeffrey Carter
2002-12-09 14:34     ` Wes Groleau
2002-12-09 21:56       ` Michal Nowak
2002-12-08 18:44 ` Jeffrey Carter
2002-12-09 21:55   ` Michal Nowak

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