comp.lang.ada
 help / color / mirror / Atom feed
* Success: Ada versus C
@ 1997-06-04  0:00 RC
  1997-06-06  0:00 ` Arthur Schwarz
  0 siblings, 1 reply; 10+ messages in thread
From: RC @ 1997-06-04  0:00 UTC (permalink / raw)




As I have been given to understand, C became popular by the back door by 
being given away as part of Unix which was itself sold for $1 to 
universities.  The commercial world then gained an unlimited supply of 
Unix fans who were C programmers, a powerful force towards commercial 
acceptance.

Commercial success has led to the development of C and Unix which are 
now very large oak trees in comparison to the little acorns they started 
as and I would suggest, much less affordable to students.

Ada started as a large, expensive project funded by a large, well funded 
end user.  There has been little reason for suppliers to introduce Ada 
as an inexpensive loss-leader.  The restriction that Ada compilers 
should all be fully compliant to a comprehensive specification is also a 
set-back for would be vendors.

Had Ada been around when C and Unix were developed, I'm sure it would 
have had a better head start.  Suppose Unix had been written in Ada and 
someone had subsequently tried to introduce C, it could only have been 
meant as a joke.

Fortran is still going strong although C is really a descendant from it 
which effectively has all of its good points and omits some (many?) of 
the bad.

By the time C has enough in the way of libraries and add ons to provide 
all of the functionality claimed for it there must be little difference 
in size between it and Ada.  There are some nasty little bad habits, 
inherent in the way C is specified which Ada attempts to improve on.  
Hopefully Ada won't die of its grandiose vision and C won't swamp it 
with its Bindweed like insistence.

RC1




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

* Re: Success: Ada versus C
  1997-06-04  0:00 Success: Ada versus C RC
@ 1997-06-06  0:00 ` Arthur Schwarz
  1997-06-06  0:00   ` Brian Rogoff
                     ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Arthur Schwarz @ 1997-06-06  0:00 UTC (permalink / raw)



RC wrote:
> 
> <snip> 
> 
> Had Ada been around when C and Unix were developed, I'm sure it would
> have had a better head start.  

Ada 'was' around when C started, tho' in another form. The immediate
predecessor to Ada was Pascal. At the time that Pascal was introduced
it was immediately hailed as an innovation over existing languages and
was in general felt to be superior to it's competitors, Fortran and
Cobol. During the beginning 80's, fast, cheap, and relatively good
compilers for Pascal were available (ala Borland). Despite its
deficiencies, it was gradually being expanded in capability, supplanted
by other 'better' languages (Ada and Modula for two), and then it
died. I've heard reasons why. I don't understand them. But it died
as it appears that Ada might.


> 
> Ada started as a large, expensive project funded by a large, well funded
> end user.  There has been little reason for suppliers to introduce Ada
> as an inexpensive loss-leader.  

Cobol was started by DoD in the 60's. It is a widely successful language
and I believ to this day, more software is written and available in
Cobol than any other single computer languages. If I remember correctly,
the Communications of the ACM (or SIGPLAN) published a survey of 
languages used sometime during the 80's. At that time (if memory serves
me correctly - it really never does), Cobol programming exceeded 80%
of all programming done. I believe that a survey done in the 90's showed
that although it's lead was dropping, it still has a commanding lead.

So go figure. Ada lookalike languages die (Pascal) and DoD / Gov'n
funded projects don't. This is to say that it appears that for any
valid example there is an equally valid counter-example, and vice-
versa.

I don't mean to poke fun at you but I can't understand it either. I
do know that from a 'rabid supporter' for Ada in the 80's, I'm only
lukewarm now. I do find learning the language tortuous and compiling,
linking a real burden. For 'simple' projects it is seems undually 
complex. For long-term, large scale projects I believe the Ada
advocates, it is good. But very often, small inconsequential projects
done within a larger framework become major future efforts. Maybe
this is where Ada fails to have a 'draw'. Being geared to projects
which start large and continue, it is not able to attract projects
which start small and grow. I don't know, when I read the Ada news-
groups I see a lot of stridency for a viewpoint without many concessions
for success. So I personally don't see a large future for the language.

As a non-sequitor, when I tried to learn rather than just admire the
language (in the 80's) I had a great deal of difficulty. Being an
experienced (and arrogant) programmer, I really didn't want a tutorial
and didn't want to spend time with the LRM. I couldn't find books
which were not tutorial and I did find that the LRM was all but
impenetrable. In terms of C (now, not then), I use a book by Harbison
and Steele, "C, A Reference Manual". For me it is an unqualified
success. To this day I don't know of a comparable book in Ada.

My feeling is that it is time to stop congratulating ourselves. It is
time to develop an appreciation for our potential audience. The language
won't sell itself and strong advocacy is not the same as many and
enthusiastic user's. The articles that I see telling about Ada's
successes and its future seem to be a cry of desparation. "Why can't
people see the superiority of Ada over C/C++?". Good question. What's
the answer.

So go figure. One of the best languages of the times seems destined
for a footnote in history - used by the Government, abandoned by the
people.

(sorry for the speach).

art schwarz
aschwarz@acm.org




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

* Re: Success: Ada versus C
  1997-06-06  0:00 ` Arthur Schwarz
  1997-06-06  0:00   ` Brian Rogoff
@ 1997-06-06  0:00   ` Dale Pontius
  1997-06-07  0:00     ` Robert Dewar
  1997-06-07  0:00   ` Robert Dewar
  1997-06-08  0:00   ` RC
  3 siblings, 1 reply; 10+ messages in thread
From: Dale Pontius @ 1997-06-06  0:00 UTC (permalink / raw)



In article <33984686.9A8@gdls.com>,
        Arthur Schwarz <schwarza@gdls.com> writes:
>...
> compilers for Pascal were available (ala Borland). Despite its
> deficiencies, it was gradually being expanded in capability, supplanted
> by other 'better' languages (Ada and Modula for two), and then it
> died. I've heard reasons why. I don't understand them. But it died
> as it appears that Ada might.
>...
IMHO:

I suspect that the real issue here is that C and C++ are "good
enough" to get the job done. So people go out and do jobs with
them.

By contrast, the 'purist' languages of Pascal-descent wind up
arguing over purity issues, not doing real work. That's not to
say that real work isn't done with Pascal-descent languages,
but that the evolution of the language is wrapped up and held
up in purity discussions. By the time Modula2 got through its
standardization, it was irrelevant as a language. The last time
I looked at its successor Oberon2, people were insisting that
interoperation with legacy tools was unneccessary - I should
move everything I do to Oberon2. More "language purism."

Another aspect is language origin. Pascal began as a teaching
language. As such, it got a 'toy' library, that wasn't up to
doing real work. Borland came along with a better library, but
on the PC only, and with apparently no concern for Unix. That
was probably the single biggest death-blow to the Pascal family.
Borland took the mass market that drives cost and splintered
it from the Unix market that had much-needed sophistication.
Since C began as a Unix tool, it began with a decent library,
and C++ sat on it's shoulders.

This leaves Ada...

Really, in better shape than Pascal. While there is no shortage
of Language Lawyers on Ada, the standard is in place and isn't
holding up any development. I guess the time to get Ada95 ISO
hurt, but in the meantime Ada83 was out and doing Real Work.

I think that's the biggest factor - Ada does Real Work. The
standard library set that comes with it is considerably more
"industrial strength" than the original Pascal or Modula2
libraries. (Especially considering libraries weren't in Pascal
in the first place.)

I can think of two (certainly more) thinks holding Ada95 back
now:
1) It's still "not C", and doesn't quite work the way the "regular"
   stuff does. There are more bindings to common C libraries
   appearing, though it would be nice to see a general technique
   to bind to C++ libraries. (I know it's C++'s fault, but still...)
   It would also be good to see an Ada-GUI library that doesn't
   taste like warmed-over C.
2) There is a "Purity" emphasis to the language that leaves you
   (or at least me) fearing that it "CAN'T" be fast. For instance,
   the whole discussion of copying IN and OUT the parameter list
   leaves a taste of poor performance. Read further and you see
   that pass-by-reference is allowed in this case for structures.
   There's also the insistance of folks like Mr. Dewar that GNAT
   generates code just like gcc. (Obviously!) The default inclusion
   of runtime checking in Pascal and its default exclusion in C add
   to this perception.

Dale Pontius
(NOT speaking for IBM)




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

* Re: Success: Ada versus C
  1997-06-06  0:00 ` Arthur Schwarz
@ 1997-06-06  0:00   ` Brian Rogoff
  1997-06-06  0:00     ` Corey Minyard
  1997-06-06  0:00   ` Dale Pontius
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Brian Rogoff @ 1997-06-06  0:00 UTC (permalink / raw)



On Fri, 6 Jun 1997, Arthur Schwarz wrote:
> RC wrote:
> > Had Ada been around when C and Unix were developed, I'm sure it would
> > have had a better head start.  
> 
> Ada 'was' around when C started, tho' in another form. The immediate
> predecessor to Ada was Pascal. At the time that Pascal was introduced
> it was immediately hailed as an innovation over existing languages and
> was in general felt to be superior to it's competitors, Fortran and
> Cobol. During the beginning 80's, fast, cheap, and relatively good
> compilers for Pascal were available (ala Borland). Despite its
> deficiencies, it was gradually being expanded in capability, supplanted
> by other 'better' languages (Ada and Modula for two), and then it
> died. I've heard reasons why. I don't understand them. But it died
> as it appears that Ada might.

I disagree with your fundamental premises. Pascal is not "dead", it spawned 
successors (Ada 83/95, The Modulas (1,2,3), Oberon, Delphi,
Object-Pascal...). Programming languages evolve. If you look at Pascal and 
say it is dead because ISO Pascal is not popular, I could claim that Lisp 
is dead because (almost) no one uses Lisp 1.5. 

> I don't mean to poke fun at you but I can't understand it either. I
> do know that from a 'rabid supporter' for Ada in the 80's, I'm only
> lukewarm now. I do find learning the language tortuous and compiling,
> linking a real burden. 

Ada is big, and I certainly wish that a simplified Ada could be developed, 
but I am unhappy with the alternatives (Modula 3 and Oberon). I don't 
find learning Ada "tortuous", especially compared to C++. 

> For 'simple' projects it is seems undually complex. 

(I believe you mean "unduly")

I disagree. You can definitely "hack" with Ada 95. In fact, it is more fun 
for me to hack with Ada 95 than with C, because I'm one of those dummies 
who makes mistakes and Ada usually catches them up front, so I don't use a
debugger. Hacking without debugging is great! The problem is that there 
aren't always usable interfaces to libraries that I want, which is more 
of an "environment" problem than a language one. 

> For long-term, large scale projects I believe the Ada
> advocates, it is good. But very often, small inconsequential projects
> done within a larger framework become major future efforts. Maybe
> this is where Ada fails to have a 'draw'. Being geared to projects
> which start large and continue, it is not able to attract projects
> which start small and grow. I don't know, when I read the Ada news-
> groups I see a lot of stridency for a viewpoint without many concessions
> for success. So I personally don't see a large future for the language.

I don't follow this last paragraph...
 
> As a non-sequitor, when I tried to learn rather than just admire the
> language (in the 80's) I had a great deal of difficulty. Being an
> experienced (and arrogant) programmer, I really didn't want a tutorial
> and didn't want to spend time with the LRM. I couldn't find books
> which were not tutorial and I did find that the LRM was all but
> impenetrable. In terms of C (now, not then), I use a book by Harbison
> and Steele, "C, A Reference Manual". For me it is an unqualified
> success. To this day I don't know of a comparable book in Ada.

Ada as a second language, 2nd Edition, Norman Cohen. (Somehow I lucked 
out and bought this book for $32, now I see it for > $60 US). This is 
my favorite Ada book.

Programming in Ada 95 by Barnes

What would really be useful to me is an advanced Ada 95 programming book, 
like Coplien's C++ book.

> My feeling is that it is time to stop congratulating ourselves. It is
> time to develop an appreciation for our potential audience. The language
> won't sell itself and strong advocacy is not the same as many and
> enthusiastic user's. The articles that I see telling about Ada's
> successes and its future seem to be a cry of desparation. "Why can't
> people see the superiority of Ada over C/C++?". Good question. What's
> the answer.

Write Ada code and make it available for use. 

-- Brian






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

* Re: Success: Ada versus C
  1997-06-06  0:00   ` Brian Rogoff
@ 1997-06-06  0:00     ` Corey Minyard
  0 siblings, 0 replies; 10+ messages in thread
From: Corey Minyard @ 1997-06-06  0:00 UTC (permalink / raw)



Brian Rogoff <bpr@shellx.best.com> writes:
> Ada as a second language, 2nd Edition, Norman Cohen. (Somehow I lucked 
> out and bought this book for $32, now I see it for > $60 US). This is 
> my favorite Ada book.

Just a completely off-topic note: I just bought this from
www.barnesandnoble.com for $37.

-- 
Corey Minyard               Internet:  minyard@acm.org
  Work: minyard@nortel.ca       UUCP:  minyard@wf-rch.cirr.com




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

* Re: Success: Ada versus C
  1997-06-06  0:00   ` Dale Pontius
@ 1997-06-07  0:00     ` Robert Dewar
  1997-06-09  0:00       ` Dale Pontius
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Dewar @ 1997-06-07  0:00 UTC (permalink / raw)



Dale says

<< There is a "Purity" emphasis to the language that leaves you
   (or at least me) fearing that it "CAN'T" be fast. For instance,
   the whole discussion of copying IN and OUT the parameter list
   leaves a taste of poor performance. Read further and you see
>>

What are you saying here? That call by reference is preferable from an
efficiency point of view to call by value return for scalars? Surely
not (most Fortran compilers also pass scalars by value).





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

* Re: Success: Ada versus C
  1997-06-06  0:00 ` Arthur Schwarz
  1997-06-06  0:00   ` Brian Rogoff
  1997-06-06  0:00   ` Dale Pontius
@ 1997-06-07  0:00   ` Robert Dewar
  1997-06-08  0:00   ` RC
  3 siblings, 0 replies; 10+ messages in thread
From: Robert Dewar @ 1997-06-07  0:00 UTC (permalink / raw)



Arthur says

<<Ada 'was' around when C started, tho' in another form. The immediate
predecessor to Ada was Pascal. At the time that Pascal was introduced
it was immediately hailed as an innovation over existing languages and
was in general felt to be superior to it's competitors, Fortran and
Cobol. During the beginning 80's, fast, cheap, and relatively good
compilers for Pascal were available (ala Borland). Despite its
deficiencies, it was gradually being expanded in capability, supplanted
by other 'better' languages (Ada and Modula for two), and then it
died. I've heard reasons why. I don't understand them. But it died
as it appears that Ada might.
>>

To claim that Pascal has died is uninformed nonsense. Delphi has a very
substantial following, and is used on a large number of serious projects
(Ada would be pleased to have its penetration in the PC world!) It is
surprising how many people gaily make this statement without knowing
anything about it (at a recent department meeting, where the chairman
decided Java was a good think without knowing much about it :-) several
people made the claim that Pascal was not used in serious projects any
more, including the poople currently teaching Pascal.

For an antidote, visit www.borland.com, and you will quite easily find you
way to a nice page that talks about Delphi projects.





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

* Re: Success: Ada versus C
  1997-06-06  0:00 ` Arthur Schwarz
                     ` (2 preceding siblings ...)
  1997-06-07  0:00   ` Robert Dewar
@ 1997-06-08  0:00   ` RC
  3 siblings, 0 replies; 10+ messages in thread
From: RC @ 1997-06-08  0:00 UTC (permalink / raw)



In <33984686.9A8@gdls.com> by Arthur Schwarz <schwarza@gdls.com>
>RC wrote:
>> Had Ada been around when C and Unix were developed, I'm sure it would
>> have had a better head start.  

>Ada 'was' around when C started, tho' in another form. The immediate
>predecessor to Ada was Pascal. At the time that Pascal was introduced
>it was immediately hailed as an innovation over existing languages and
>was in general felt to be superior to it's competitors, Fortran and
>Cobol. During the beginning 80's, fast, cheap, and relatively good
>compilers for Pascal were available (ala Borland). Despite its
>deficiencies, it was gradually being expanded in capability, supplanted
>by other 'better' languages (Ada and Modula for two), and then it
>died. I've heard reasons why. I don't understand them. But it died
>as it appears that Ada might.

People are supposed to thrive on adversity, perhaps they feel that Ada
just would make life too easy to be interesting any more?

I always took Pascal and Fortran to be joint ancestors of C, I wasn't in
K's or R's head at the time but the io formatting always seemed to taste
of Fortran and the general structure too similar to Pascal to be a
coincidence.  Pascal grew out of Algol which was designed by a committee
and had inherent shortcommings (special symbols needing a special
keyboard for instance), Algol paved the way for Pascal, 'C', Modula (n),
Ada and so on and deserves its place in history but not to live beyond
its years.

C is better now than it was then (I'm not talking about C++) and I feel
Pascal will live on if only in that mutant form.

Pascal was intended as a teaching language so many desirable features of
a real working language were deliberately excluded from it (the horrible
restrictions on the character set for instance).  Compiler designers
added functionality into Pascal which thereby lost its portability
although being more useable.

Modula (n?) was a valid and necessary development of the Pascal
specification to address many of its shortcommings and include low level
systems facilities.  It is still a valid and useful working language
with many of the good features of Ada in a smaller box and with
affordable implementations widely available.

>> Ada started as a large, expensive project funded by a large, well funded
>> end user.  There has been little reason for suppliers to introduce Ada
>> as an inexpensive loss-leader.  

>Cobol was started by DoD in the 60's. It is a widely successful language
>and I believ to this day, more software is written and available in
>Cobol than any other single computer languages. If I remember correctly,
>the Communications of the ACM (or SIGPLAN) published a survey of 
>languages used sometime during the 80's. At that time (if memory serves
>me correctly - it really never does), Cobol programming exceeded 80%
>of all programming done. I believe that a survey done in the 90's showed
>that although it's lead was dropping, it still has a commanding lead.

Interesting, reminds me of the advert about statistics,  85.3% of all
statistics are made up on the spur of the moment to prove a point.  (I'm
sure yours are quoted from verifiable sources.)

There has to be a balancing statement though, how about...
"Cobol does 20% of all the work done by computers using 80% of all the
code?"  That ought to get me into trouble with someone.

>So go figure. Ada lookalike languages die (Pascal) and DoD / Gov'n
>funded projects don't. This is to say that it appears that for any
>valid example there is an equally valid counter-example, and vice-
>versa.

>I don't mean to poke fun at you but I can't understand it either. I
>do know that from a 'rabid supporter' for Ada in the 80's, I'm only
>lukewarm now.

> I do find learning the language tortuous
It has its own style but I can't really understand why, I find it stands
in the way of expressing the solution to a problem much less than any
other language which is why I like it.
> and compiling and linking a real burden.
Compilers and linkers are tools not part of the language.

> For 'simple' projects it is seems unduly complex. For long-term,
> large scale projects I believe Ada advocates, it is good.

> But very often, small inconsequential projects
>done within a larger framework become major future efforts. Maybe
>this is where Ada fails to have a 'draw'. Being geared to projects
>which start large and continue, it is not able to attract projects
>which start small and grow. I don't know, when I read the Ada news-
>groups I see a lot of stridency for a viewpoint without many concessions
>for success. So I personally don't see a large future for the language.
When I was learning to program, several of my colleagues used to favour
the term 'Noddy program'.  I always held that there was no such thing
although there might be Noddy programmers and there are bad programs.
If something is worth doing, it is worth doing properly.  It may be a
simple, ad hoc one off with no safety features but if it performs a
necessary function elegantly and effectively it deserves to be described
as a program.

This extends to writing small, simple programs in Ada.  OK there are
overheads involved in code which checks data, handles exceptions and so
on but if your system is worth developing it must be worth making
effective.  The intention of Ada was for general use not just for
writing large programs.  If your compiled 'hello world', gigabytes of
storage, blame the compiler implementation, not the language.

>As a non-sequitor, when I tried to learn rather than just admire the
>language (in the 80's) I had a great deal of difficulty. Being an
>experienced (and arrogant) programmer, I really didn't want a tutorial
>and didn't want to spend time with the LRM. I couldn't find books
>which were not tutorial and I did find that the LRM was all but
>impenetrable.

Like learning to talk, a second language is much more difficult to learn
because you can already talk in your first language.

Any technical book is almost by definition at the wrong level.  If it's
at too low a level you have nothing to learn from it.  If it starts at
too high a level its impenetrable.  Even if it is at exactly your level,
once you've read it, it moves into the too low a level category.

> In terms of C (now, not then), I use a book by Harbison
>and Steele, "C, A Reference Manual". For me it is an unqualified
>success. To this day I don't know of a comparable book in Ada.

Yes, to program in C a good book is very advisable.

There is an unfortunate bootstrapping effect here, if Ada was more
popular, more people would write books on it, more people would read
them and Ada would be more popular...

>My feeling is that it is time to stop congratulating ourselves.

Is that what we are doing?

> It is time to develop an appreciation for our potential audience.
If your drinks machine dispenses the drink you want, you dont care if it
is programmed in Ada or runs by clockwork, steam or even 'C'.  If their
systems are effective, they'll be happy and carry on using you to supply
their systems.

The people who gain most directly from Ada are the programmers, you may
be able to make things work using SCMP assembly language but if it takes
5% of the time and 1% of the effort to do it in Ada it must be the best
choice.  Employers, managers and others at the pointy end of the
hierarchy need to either find out what works best or listen to the
voices from below which are feeding them with informed opinions.

How about if manufacturers were to sell off their Ada 83 compilers at
bargain basement prices?  Make it financially attractive, if people like
it they'll be back to buy Ada 95, if not, no one has really lost
anything except the unfortunates who couldn't see the benefits.

> The language won't sell itself and strong advocacy is not the same as
> many and enthusiastic user's.
> The articles that I see telling about Ada's
>successes and its future seem to be a cry of desparation. "Why can't
>people see the superiority of Ada over C/C++?". Good question. What's
>the answer.
Aye, there's nowt so queer as folk.

Do people have an emotional reaction to Ada's roots in defence?
("Program in C for peace man, yeah.")  Yes, I know it sounds silly, but
I've met people who haven't realised that a language can be more general
than a single application.  Take the Tolstoy approach, don't rely on
someone else to lead the way, individuals need to move in the right
direction on their own initiative.  Ada might fail as the best like
Betamax or be replaced by something better but I'd hate to think it was
because I couldn't be bothered to mention it to a Cobol programmer who
knew no better.

>So go figure. One of the best languages of the times seems destined
>for a footnote in history - used by the Government, abandoned by the
>people.
Unfortunately, all the effort that went into the specification doesn't
seem to have been reflected in the tools available.  Surely, it's not
dead yet?

>(sorry for the speach).
No worries blue.  My apologies for the length of this, better out than
in as they say.

RC1




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

* Re: Success: Ada versus C
  1997-06-07  0:00     ` Robert Dewar
@ 1997-06-09  0:00       ` Dale Pontius
  1997-06-09  0:00         ` Robert Dewar
  0 siblings, 1 reply; 10+ messages in thread
From: Dale Pontius @ 1997-06-09  0:00 UTC (permalink / raw)



In article <dewar.865692615@merv>,
        dewar@merv.cs.nyu.edu (Robert Dewar) writes:
> Dale says
>
> << There is a "Purity" emphasis to the language that leaves you
>    (or at least me) fearing that it "CAN'T" be fast. For instance,
>    the whole discussion of copying IN and OUT the parameter list
>    leaves a taste of poor performance. Read further and you see
>>>
>
> What are you saying here? That call by reference is preferable from an
> efficiency point of view to call by value return for scalars? Surely
> not (most Fortran compilers also pass scalars by value).
>
I'm saying that until you think it through, pass-by-reference seems
faster. Think twice and you see that pass-by-value is faster for
simple values. Pass-by-reference shines on structures, which is
where Ada95 allows it.

I didn't say Ada95 does anything "wrong" or slow, I just said that
at first glimpse it looks that way. Look harder and the "can't run
fast" first impression goes away.

Dale Pontius
(NOT speaking for IBM)




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

* Re: Success: Ada versus C
  1997-06-09  0:00       ` Dale Pontius
@ 1997-06-09  0:00         ` Robert Dewar
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Dewar @ 1997-06-09  0:00 UTC (permalink / raw)



Dale says

<<I'm saying that until you think it through, pass-by-reference seems
faster. Think twice and you see that pass-by-value is faster for
simple values. Pass-by-reference shines on structures, which is
where Ada95 allows it.>>

OK, understood. It is hard for me sometimes to guess what misconceptions
people might have, but yes of course call by value is more efficient
for values that fit in registers. Indeed this is why Fortran does not
require call by reference. A typical Fortran compiler, like a typical
Ada compiler, uses call by value for register sized scalars, and call
by reference for large stuff, and there are some cases in between which
are target dependent (for example, the SPARC ABI (unwisely) requires all
structures to be passed by reference, but many other ABI's permit the
more efficient approach of passing register sized structures by value
in registers -- note that it is particuarly annoying to be forced to
pass structs by reference at the ABI level in C, because C requires
call by value for structs at the language level. This means that a
typical SPARC C compiler that obeys the ABI must first copy a small
struct to memory and then pass its address, instead of just passing
it in a register.





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

end of thread, other threads:[~1997-06-09  0:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-06-04  0:00 Success: Ada versus C RC
1997-06-06  0:00 ` Arthur Schwarz
1997-06-06  0:00   ` Brian Rogoff
1997-06-06  0:00     ` Corey Minyard
1997-06-06  0:00   ` Dale Pontius
1997-06-07  0:00     ` Robert Dewar
1997-06-09  0:00       ` Dale Pontius
1997-06-09  0:00         ` Robert Dewar
1997-06-07  0:00   ` Robert Dewar
1997-06-08  0:00   ` RC

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