HDTenEightyP/NetNews huggingface dataset:
From: crispen@efftoo.boeing.com (crispen)
Newsgroups: comp.lang.ada
Subject: Re: Using Global Variables
Date: 28 Sep 92 12:52:52 GMT
Organization: The Internet

alvin@eyepoint.com (Alvin Starr) asks:

Me>Which is why I wonder about designs that use common memory "for speed".
Me>Did these designs begin as data-flow-controlled designs, and the
Me>common memory was retrofitted when the speed *actually* was too slow?

AS> Is it possible that you are confusing static variables with variables 
AS> that are keep on a stack or display. 

I was taking as my two alternatives: (a) variables which are declared
in package specs, and (b) parameters which are passed with function
calls.  Obviously, there are more alternatives, but let's use these
for now.

In the latter ("data-flow-controlled") mechanism, there is a requirement
to copy variables onto the stack, call the subprogram, and copy them off
the stack.  In the former, most compilers I know of simply declare the
variable as global, in which case, there's simply a memory fetch or store.

That's the reason that people have said that data-flow-controlled
designs "waste CPU cycles".

In fact, every time I have done a data-flow-controlled design, it
has executed *faster* than the global-data design it replaced.  There
seem to be three reasons for this:

	(a) Data on the stack is generally in cache, while global
	data generally isn't.

	(b) When I go to redevelop the earlier design, I find that
	the programmer (often me) did some dumb things (slow
	algorithms, meaningless variable stores, etc.) that I can
	avoid this time.  I'll restate a point I made earlier: to
	speed up your code, get rid of the dumb things you're doing
	before you get rid of the smart things you're doing.

	(c) Because I'm highly prejudiced toward a data-flow-
	controlled design, I'm highly motivated to make it fast
	to confound my enemies.

And, of course, I get the payoffs of reduced integration time, greater
maintainability, and lack of mysterious glitches for free.
+-------------------------------+--------------------------------------+
| Bob Crispen                   |   The owls are not what they seem    |
| crispen@foxy.boeing.com       +--------------------------------------+
| (205) 461-3296                |Opinions expressed here are mine alone|
+-------------------------------+--------------------------------------+
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.ada
Subject: Re: INFO-ADA Digest V92 #299
Date: 2 Oct 92 07:56:31 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <2AAE10C8@ncgate.ccscnet.af.mil>, BUSHMAN@MITECMAIL.CCSCNET.AF.MIL writes:
> The problem with is Ada is that it is 
> a very large language ...  There are many other groups out there using
> Ada, but its use is not nearly as common as other languages that you would
> probably be more apt to use in your field (like COBOL, unfortunately).

>  As I stated
> in the last paragraph, Ada is a very large language.  For someone wanting to
> get some programming experience, as your first language to tackle, Ada would
> be much harder to learn than others, such as COBOL.

I recently hunted up all the programming language standards I could find and
read them (our library _still_ hasn't got the C standard I asked for).  It
was illuminating.  COBOL 85 is a very large language and the standard is
ENORMOUS.  Let's keep a sense of perspective here:
	Ada is smaller than COBOL.
	Ada is smaller than C++.
	Ada is smaller than Common Lisp (wow, the draft is _incredibly_ large)
	Ada is larger than C.
	Ada is larger than Pascal.
	Ada is larger than Scheme.
I reckon it's easier to get started with Ada than Pascal.  What counts is
not "how big is the whole language" but "how much do you have to know to
get stuff done".  If it comes to that, I am continually surprised by how
little C many of the C programmers I speak to know, and it's not large.

-- 
RMIT policy requires the use of Gender Inclusive Language in all publications
and in all information conveyed to students, staff, and potential job
applicants.  Lapses into English are the sole responsibility of the author.
The Constitution of Australia does _not_ guarantee Freedom of Speech.
From: dag@control.lth.se (Dag Bruck)
Subject: Re: INFO-ADA Digest V92 #299
Organization: Department of Automatic Control, Lund, Sweden
Date: Fri, 2 Oct 1992 10:42:50 GMT

In <comp.lang.ada> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
>Let's keep a sense of perspective here:
>	Ada is smaller than COBOL.
>	Ada is smaller than C++.
>	Ada is smaller than Common Lisp (wow, the draft is _incredibly_ large)
>	Ada is larger than C.
>	Ada is larger than Pascal.
>	Ada is larger than Scheme.

Excellent advice.  How do you measure size?

>....  What counts is
>not "how big is the whole language" but "how much do you have to know to
>get stuff done".

Very true.  A burden on any programmer regardless of language is to
know what feature not to use for a particular task.

>....  If it comes to that, I am continually surprised by how
>little C many of the C programmers I speak to know, and it's not large.

Do you mean that C is a good language (in some sense) because it is
small to start with and you don't even have to know much of that to
get useful work done?
From: alex@dset.UUCP (Dr. Alex Kuo)
Newsgroups: comp.lang.ada
Subject: ADA Compilers information wanted
Date: 30 Sep 92 15:41:01 GMT
Distribution: usa
Organization: DSET Corporation, Lebanon, NJ
Keywords: ADA


Hello! ADA Users,

I have some questions about ADA Compilers.  Since I don't have any
experience with ADA maybe you can kindly give me some information.

[1] How do you call C functions in ADA? Is it possible with any ADA
	Compiler? Any restrictions?

[2] Recommendations for a good ADA Compiler, vendors information,
	are welcome.

Thank you in advance

Alex Kuo

----------------------------------------------------------------
Alex Kuo                        UUCP:   uunet!dset!alex
DSET Corp.                      INTERNET: dset!alex@uunet.UU.NET
440D County Road 513            TEL:    +1-908-832-6533
Califon, NJ 07830               FAX:    +1-908-832-6523
U.S.A.
-----------------------------------------------------------------
Newsgroups: comp.lang.ada
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: FAX NUMBER FOR MERIDIAN
Organization: George Washington University
Date: Thu, 1 Oct 1992 04:08:44 GMT

In article <01GPCB02MGMQDWOO7W@BITNET.CC.CMU.EDU> GBODSO1@NUSVM.BITNET (Jerry Seah) writes:
>Hello world,
>   Can somebody pass me the fax number of Meridian - the company that
>sells a compiler for PCs.  Thanks.

714-727-3583

Good luck!

Mike Feldman

Newsgroups: comp.lang.ada
From: vtg@mitre.org (Victor Giddings)
Subject: Re: Using Global Variables
Followup-To: comp.lang.ada
Organization: D072 - The MITRE Corporation
Date: Mon, 28 Sep 1992 15:53:39 GMT

In article <1992Sep22.201420.25962@swlvx2.msd.ray.com>, lms@swl.msd.ray.com
(LEE MARDEN) wrote:
> 
> 
>   At the risk of being flamed for continuing to beat a dead horse, could some
> summarize the methods available (good and bad) for using shared memory.  I
> just started to monitor comp.lang.ada and have a specific problem I'm trying
> to solve.  Here goes:  I have a 4D/240 Power series Silicon Graphics computer
> running Irix 4.0.1 (Unix) and the Verdix Ada compiler (on order).  The computer
> has 4 processors.  The plan is to reuse code as much as possible so I'm 
> stuck with one processor running C, another Fortran and the other two Ada.
> Each processor needs to communicate with the others.  I'm not sure on the
> amount of data, but my first guess would be tons(>1k variables).  My initial
> investigate has only lead me to the conclusion that I would have to write
> some Ada wrappers around the C routines (shmctl, shmop, shmget) to control
> a shared memory chunk, 

We actually experimented with this with some success (although I still
think it was a bad idea).  We did, however, have unexplained intermittent
crashes.  We speculated that the shmat (using shmaddr:= 0) was returning an
address that the run-time system was re-using for a dynamic allocation. 
Any SGI and/or Verdix gurus wish to comment?

> and that all I would get is a pointer to the data
> space.  That would make data access very clumsy. 
The indirection can be accomplished using one qualification, e.g.
Global_Pool.Data_Element.  Doesn't strike me as any more clumsy than trying
to maintain the data space in the first place.  :-)

> I've heard of some Pragmas
> on other systems that allow you to specify that an entire package of variables
> be shared, and utilities to perform the maintance thereof.  I hope that's
> enough info for someone to respond.  If not, let me know and I'll elaborate
> (no pun intended).
> 
>  AdvThanksance, Lee Marden
>  
> -- 
>   AdvThanksance,
> 
>   Lee S. Marden, lms@swlray.msd.ray.com
>   Raytheon Company, Missile Systems Division, Tewksbury, MA 01876
Newsgroups: comp.lang.ada
From: dag@control.lth.se (Dag Bruck)
Subject: Re: Ada's (in)visibility
Organization: Department of Automatic Control, Lund, Sweden
Date: Mon, 28 Sep 1992 18:29:15 GMT

In <comp.lang.ada> michael.hagerty@nitelog.com (Michael Hagerty)  writes:
>
>The most coneheaded response I've heard to the question, "Why didn't you
>do it in Ada, the mandated language?" was, "We had to be compatible with
>X-windows, the Navy standard, and there was no requirement for Ada."

What _is_ the preferred Ada interface to X11R5?  Can you use Ada
tasking and X11 callbacks in the same program?

People I have reasonable confidence in have told me that there are
problems, but I would be grateful for some more detailed comments.

		-- Dag
Newsgroups: comp.lang.ada
From: rcaliari@su5v.ess.harris.com (Richard Caliari)
Subject: Ada on PC and Sun
Date: Wed, 30 Sep 1992 18:02:45 GMT
Organization: Harris GCSD

We are trying to identify an ada development environment which will
run on both DOS/Windows PC's and Sun SPARCstations. I would like to
get feedback from the user community on the merits/shortcomings of the
environments available including performnace, vendor support, pricing,
interface to CASE tools, etc. Please e-mail me inputs and I will post
a summary. If a FAQ exists which covers this, let me know that also.

Thanks in advance,

Rich Caliari
email: rcaliari@su5v.ess.harris.com

Newsgroups: comp.lang.ada
From: rcaliari@su5v.ess.harris.com (Richard Caliari)
Subject: PC & Sun Environments
Date: Wed, 30 Sep 1992 18:31:45 GMT
Organization: Harris GCSD

We are looking at ada development envrionments for DOS/Windows and Sun 
platforms. Our ideal would be to use the same environment on both
platforms. I would like feedback from the user community on the
pacakges available, bot positive and negative. Information on,
performance, capabilities provided by the environment, vendor support,
cost, etc. would be useful. Please e-mail me responses and I will post a summary.

Thanks in advance,

Rich Caliari
email: rcaliari@su5v.ess.harris.com
From: Randy.Baer@f310.n3603.z1.FIDONET.ORG (Randy Baer)
Newsgroups: comp.lang.ada
Subject: Re: Ada's (in)visibility in the engineering community
Date: Sun, 20 Sep 92 20:54:18 EDT
Organization: FidoNet node 1:3603/310 - Tetragrammatton, St Petersburg FL

> :
> : "Ada was not developed by Ichbiah, Firth, et. al as the result of
> : a conscious engineering effort.  In fact, Ada was hacked together
> : by a couple of guys who needed a real-time OS for their PDP-8.  The
> : real-time OS was needed so they could play games, and do a little
> : programming on the side..."
 
        Sounds like the same story about how UNIX was devloped. 

--  
Internet: Randy.Baer@f310.n3603.z1.FIDONET.ORG
UUCP: ...!myrddin!tct!psycho!310!Randy.Baer
Note:psycho is a free gateway between Usenet & Fidonet. For info write to
     root@psycho.fidonet.org.
From: rlk@VisiCom.COM (Bob Kitzberger)
Newsgroups: comp.lang.ada
Subject: Re: Any RPC for Ada?
Date: 28 Sep 92 21:44:55 GMT

bortz@CNAM.CNAM.FR writes:

>I'm looking for any information/pointers about implementations of RPC
>(Remote Procedure Call) in/for Ada. I'm specially interested in Unix solutions.

TeleSoft has an RPC implementation for both Unix systems and embedded 
targets.  It is interoperable with Sun's implementation, as far as I know.
It's part of a larger networking toolset called TeleAda-LAN, and includes
XDR, socket interface, etc.

Call Gary Cato, +1 619 457-2700 (gec@telesoft.com).

Give my regards to the Musee d'Orsay,

	.Bob.
----------------
Bob Kitzberger          VisiCom Laboratories, Inc.
rlk@visicom.com         10052 Mesa Ridge Court, San Diego CA 92121 USA
                        +1 619 457 2111    FAX +1 619 457 0888
Newsgroups: comp.lang.ada
From: LJ10891@LMSC5.IS.LMSC.LOCKHEED.COM
Subject: Re: Using Global Variables
Organization: Lockheed Missiles & Space Company, Inc.
Date: Fri, 25 Sep 92 22:58:00 GMT

------------------------- Original Article -------------------------
>    With the result that anybody who needs to access anything in shared
>memory now has full access to everything in shared memory.  Ah, informa-
>tion hiding, what has happened to you?
                                                          >             Charlie

   True, but the problem domain under discussion seemed centered around
large memory areas with common access requirements.  For a more discriminating,
less refined (yes, I do believe that parameter passing is more refined and
controllable), method one could open the pandora's box of:

package GLOBAL_1 is ...   -- regionals associated with some functionality
package GLOBAL_2 is ...   -- regionals associated with another functionality
..  -- etc.

   Synchronization is left as an exercise for the masochist.  :-)

   Trey Haddad (ghaddad@lmsc.lockheed.com)
These opinions were left on my doorstep, would you give them a good home?
Newsgroups: comp.lang.ada
From: eachus@Dr_No.mitre.org (Robert I. Eachus)
Subject: Re: converting (limited) private types?
Organization: The Mitre Corp., Bedford, MA.
Date: Tue, 29 Sep 1992 20:00:57 GMT


     The most elegant way to solve this problem, and I do it every
time I have to do a lot of text file manipulation is to take your
favorite text editor and edit the specification of TEXT_IO.  I usually
change the name to NICE_IO and build in whatever processing is
necessary to print out meaningful error messages when opening a file
fails, etc.  In your case, redefine FILE_TYPE as a private type, and
then make it an access to TEXT_IO.FILE_TYPE.  (If FILE_TYPE is already
an access type, there is an obvious optimization...I won't tell.)

     Now write the body for the most part as calls through to TEXT_IO.
Slather pragma INLINE around liberally and you are ready to start
cooking.  If you want to be a little more adventurous add functions
PUSH_CURRENT_IN, etc. to the package.  See how easy that was? :-)

     Seriously this does turn out to be a long term timesaver, since I
can and do add dozens of mixed output procedures, GET functions, etc.
to the mix.

--

					Robert I. Eachus

with STANDARD_DISCLAIMER;
use  STANDARD_DISCLAIMER;
function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...
From: tne@world.std.com (Thomas N Erickson)
Newsgroups: comp.lang.ada
Subject: Re: ADA Compilers information wanted
Keywords: ADA
Date: 4 Oct 92 13:15:28 GMT
Distribution: usa
Organization: The World Public Access UNIX, Brookline, MA


>[1] How do you call C functions in ADA? Is it possible with any ADA
>	Compiler? Any restrictions?

Calls to C are done using C pragmas.  Most Ada compilers have these
implemented.


>[2] Recommendations for a good ADA Compiler, vendors information,
>	are welcome.

I welcome you to contact us, Alsys.  Our phone is (617)270-0030, fax
(617)270-6882.  Please ask for Scott Dorman.


Tom Erickson
Alsys 
tne@world.std.com
Newsgroups: comp.lang.ada
From: rtorres@convex.com (Randy Torres)
Subject: Variant Records from Ada to C
Summary: Is it safe to pass variant records from Ada to C
Keywords: Variant Records
Organization: CONVEX Computer Corporation, Richardson, Tx., USA
Distribution: comp.lang.ada
Date: Thu, 1 Oct 1992 14:23:09 GMT
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.


Would the following be safe.  I have a variant record and want to pass
it to a C routine.  I currently know what the data structures will look
like when past to C.  However, will this data structure change with
releases of Ada compilers, as well as different compilers?


with system;

procedure a is
   procedure pass_string_array( str : system.address);
   pragma interface(c, pass_string_array);
   procedure pass_record( rec : system.address);
   pragma interface(c, pass_record);
   type xrec (p1 : integer; p2: integer) is
   record
      b  : integer;
      s1 : string(1..p1);
      c  : integer;
      s2 : string(1..p2);
      case p1 is
         when 7 =>
            fld1 : integer;
         when others =>
            fld2 : integer;
      end case;
   end record;
   myrec : xrec(7,8);
begin
   myrec.b := 66;
   myrec.c := 77;
   myrec.s1 := "AAAAABB";
   myrec.s2 := "CCCCCDDD";
   myrec.fld1 := 88;
   pass_string_array(myrec.s1'address);
   pass_string_array(myrec.s2'address);
   pass_record(myrec'address);
end;




C file.



#include <stdio.h>
   typedef struct xrec {      
      int p1;
      int p2;
      int b;
      unsigned s1_offset;
      struct {
         int element_size;    /* s1(1)'size */
         int lower;           /* s1'first */
         int upper;           /* s1'last */
         int total;           /* s1'size */
      } dv1;
      int c;
      unsigned s2_offset;
      struct {
         int element_size;    /* s2(1)'size */
         int lower;           /* s2'first */
         int upper;           /* s2'last */
         int total;           /* s2'size */
      } dv2;
      union {
         int fld1;
         int fld2;
      } n;
   } *xrec_t;

void pass_record(xrec_t my)
{
   char *s1, *s2;
   s1 = (char *)&(my->s1_offset);
   s1 += my->s1_offset;
   s2 = (char *)&(my->s2_offset);
   s2 += my->s2_offset;
   printf("p1 = %d\n",my->p1);
   printf("p2 = %d\n",my->p2);
   printf("b = %d\n",my->b);
   printf("c = %d\n",my->c);
   printf("fld1 = %d\n", my->n.fld1);
   printf("s1 = %s\n",s1);   
   printf("s2 = %s\n",s2);   
}

void pass_string_array(char *s)
{
   printf("s = %s\n",s);   
}




Sharon Shaw			
CONVEX Systems Integration and Support		

Newsgroups: comp.lang.ada
From: eachus@Dr_No.mitre.org (Robert I. Eachus)
Subject: Re: Problem with inefficiency and records with variant parts
Organization: The Mitre Corp., Bedford, MA.
Distribution: comp
Date: Tue, 6 Oct 1992 15:58:18 GMT

In article <SIDOU.92Oct5232754@litsun.epfl.ch> sidou@litsun.epfl.ch (Dominique Sidou) writes:

   We have a big problem with records variant an efficiency...
   we now need to do the following...

   v.s := 2;
   fill(v.c2);

   with: procedure fill (c : in out BigStruct2);

   We want to avoid casting v in the following way before
   the call to fill:

   declare
     bigstruct2var : BigStruct2;
   begin
     v := (2, bigstruct2var); -- very inefficient and useless in our case
     fill(v.c2);
   end;


   Any Comments, Ideas...???

   The problem is one of different levels of abstraction.  Procedure
fill expects objects of type BigStruct2, and you want to operate on on
objects of type t.  Two possible solution approaches:

   First approach is to wrap fill to return a value of type t:

   function Fill return T is 
     Temp: t(2);
   begin
     fill(Temp.c2)
     return Temp;
   end Fill;
   ...
   v := Fill;

   (You could make it a procedure if you like, in that case you have
to depend on your optimizer to be more sophisticated than in this case.)

   Second approach is to redefine fill to return a value of type
BigStruct2, to be a procedure with an in out parameter of type, or to
match the template above.  Any of these should work without depending
on the optimizer.

   You may have simplified things in this example to eliminate things
like bounds on the component types which are in fact unconstrained
array types.  In that case it is probably easier on the reader of the
code to have function calls with explicit size parameters, but poor
optimizers will work better with in out parameters.


--

					Robert I. Eachus

with STANDARD_DISCLAIMER;
use  STANDARD_DISCLAIMER;
function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...
From: sidou@litsun.epfl.ch (Dominique Sidou)
Newsgroups: comp.lang.ada
Subject: Problem with inefficiency and records with variant parts
Date: 5 Oct 92 22:27:54 GMT
Distribution: comp
Organization: Ecole Polytechnique Federale de Lausanne


We have a big problem with records variant an efficiency:

Suppose:

subtype st is integer range 1..3;

type t (s : st := 1) is record
  case s is
    when 1 => c1 : BigStruct1;
    when 2 => c2 : BigStruct2;
    when 3 => c3 : BigStruct3;
  end case;
end record;

v : t; -- assumes v.s = 1

we now need to do the following:

v.s := 2;
fill(v.c2);

with: procedure fill (c : in out BigStruct2);

We want to avoid casting v in the following way before
the call to fill:

declare
  bigstruct2var : BigStruct2;
begin
  v := (2, bigstruct2var); -- very inefficient and useless in our case
  fill(v.c2);
end;


Any Comments, Ideas...???

Thanks in advance /DS.

Sidou Dominique, Ecole Polytechnique Federale de Lausanne,
DI-LIT-INN138, Ecublens, CH-1015 Lausanne, Suisse
tel: 693.26.48. e-mail: sidou@litsun.epfl.ch
--

Sidou Dominique, Ecole Polytechnique Federale de Lausanne,
DI-LIT-INN138, Ecublens, CH-1015 Lausanne, Suisse
tel: 693.26.48. e-mail: sidou@litsun.epfl.ch
From: eriks@lin.foa.se (Erik Svensson FOA2)
Newsgroups: comp.lang.ada
Subject: Telesoft RISCAda
Date: 1 Oct 92 15:09:22 GMT
Distribution: comp
Organization: FOA, Linkoping, Sweden

I recently got a flyer from Telesoft where they plug a compiler called RSICAda.
Anybody used it?


--
Erik Svensson			Research Officer
Guided Weapons Division		National Defense Research Establishment (FOA)
Stockholm			Sweden

net.address: 	eriks@fenix.lin.foa.se

"I've got LOT's of common sense. I just choose to ignore it." -- Calvin
From: erickson@atlas.cs.nps.navy.mil (David Erickson)
Newsgroups: comp.lang.ada
Subject: Ada task visibility
Date: 29 Sep 92 15:37:36 GMT
Reply-To: erickson@taurus.cs.nps.navy.mil (David Erickson)
Organization: Naval Postgraduate School, Monterey CA

I would like to write a server process in Ada which is always running,
and which can communicate with any other Ada program using normal
rendezvous semantics.  Is there a way that this can be done?

If not, is this one of the changes that Ada9x will contain?

-Dave Erickson