comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier <gautier.demontmollin@maths.unine.ch>
Subject: Re: bitwise comparators
Date: 2000/01/17
Date: 2000-01-17T00:00:00+00:00	[thread overview]
Message-ID: <3883812B.5B93E902@maths.unine.ch> (raw)
In-Reply-To: 38834F16.FE5DE77F@hotmail.com

<<
1  Strong typing
2  Multitasking
3  Generics
4  Tagged Types
5  Packages
6  Exceptions
7  Discriminants
8  Arrays indexed over arbitrary ranges, including enumerations
9  Much greater control over variable range and representation
10 Runtime error checking
>>
Alexander Van Hecke:
> I'm not sure why you think these features are more _powerful_ than in C.

* Take the example of exceptions (but the tasking, that I don't practice, is a better one).
  With the years, compiler makers tend to implement them the most efficiently
  (zero-cost when no exception occurs, at least). If you want to program it in C,
  you have to invent them; for years your home-made exception model will be slow,
  will crash a lot etc. And it won't work on another machine, compiler or even
  memory model. Other C resources won't be able to use them; if they use them,
  exception codes will interfer.
* So you will avoid exceptions, but you'll have to carry error codes everywhere
  in the process -> slower. (I think to Unzip - see
  http://members.xoom.com/gdemont/unzipada.htm )
* This is an example where features are a the same time advanced _and_ powerful.
  Among the list, 1,2,6,9 (at least) are effectively used by optimizers
  in GNAT Ada 95 and DEC Ada (83) - the compilers I know. A real Ada bonus.
  1-9 save a huge portability effort, 10 (that uses 1-9) save incredible time
  of run-time debugging. I'll add that 1,8,9 catches most errors at compile-time:
  it means that the 1/100 sec of slower Ada compilation replace 1 hour of debugging
  in Fortran/C...

> I'd label these features as more _advanced_.  C is an old language (allthough I'm
> not sure at all about Ada),

Ada (83) is about 20 years younger... 

> but nearly all those things you sum up are
> _possible_ in C, maybe they're not as easy as in Ada and require the programmer
> to explicitly program them (which may take a lot of code), but they're
> possible.

Of course. You can even program it in assembler ;-). It depend ho many
lifes you have to do it!
Seriously: to implement basic features of Ada, say

  * packages (getting rid of makefiles with a working auto-make, check .h against .c)
  * exceptions (*working* exceptions - read c++ ngs to see that it is not trivial)
  * generics (same remark about c++ templates...)
  * strong type, with possibility of checking bounds

as your home-made C preprocessor and you'll be very old!

> Don't get me wrong, I'm not trying to make Ada look bad here, but I think my
> previous statement stands : suppose you have no previous programming experience
> whatsoever, I think that C is a lot easier to learn than Ada is.  I'd say that
> Ada is a more advanced language (i.e. has more advanced features), as there are
> many languages that are more advanced than C.

My idea about easy or not: all psychological, a question of image.
* C has a better image (the funny 1960 experimental macro-assembler, the hippie era)
* Ada has an horrific one (government, army, commitee, heavy, expensive). This image has
improved much over the past 4 years thanks to GNAT, the Ada95 norm and fast computers
that reach decent compilation times. More is to be done...
A problem with Ada (IMHO): some Ada advocates are a bit arrogant, prefer to boast
that one can do such and such thing in Ada instead of showing simple examples,
providing resources on the Internet. Many people just didn't see Ada sources!

> Again, I'm not trying to start a heavy discussion here about C versus Ada.

It seems well started I fear!
No problem if this is argumented and not (too) religious...

-- 
Gautier

_____\\________________\_______\
http://members.xoom.com/gdemont/




  reply	other threads:[~2000-01-17  0:00 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-15  0:00 bitwise comparators Alexander Van Hecke
2000-01-15  0:00 ` David C. Hoos, Sr.
2000-01-16  0:00 ` Bryce Bardin
2000-01-16  0:00 ` Jeff Carter
2000-01-16  0:00 ` Matthew Heaney
2000-01-16  0:00 ` DuckE
2000-01-17  0:00   ` Alexander Van Hecke
2000-01-17  0:00     ` David C. Hoos, Sr.
2000-01-17  0:00     ` tmoran
2000-01-17  0:00     ` Mike Silva
2000-01-17  0:00       ` Brian Rogoff
2000-02-05  0:00         ` Ashley Deas Eachus
2000-02-05  0:00           ` Jeff Carter
2000-02-06  0:00           ` Andy
2000-02-07  0:00           ` Brian Rogoff
2000-02-09  0:00             ` Robert Iredell Eachus
2000-01-17  0:00       ` Alexander Van Hecke
2000-01-17  0:00         ` Gautier [this message]
2000-01-17  0:00         ` David Starner
2000-01-17  0:00         ` Mike Silva
2000-01-18  0:00           ` Charles Hixson
2000-01-17  0:00     ` Matthew Heaney
2000-01-17  0:00     ` Gautier
2000-01-18  0:00       ` Keith Thompson
2000-01-19  0:00         ` Ole-Hjalmar Kristensen
2000-01-17  0:00     ` Jeff Carter
2000-01-17  0:00       ` Alexander Van Hecke
2000-01-17  0:00         ` David Starner
2000-01-17  0:00           ` Alexander Van Hecke
2000-01-17  0:00             ` David Starner
2000-01-18  0:00             ` Preben Randhol
2000-01-18  0:00             ` Fraser
2000-01-18  0:00               ` Bertrand Augereau
2000-01-19  0:00                 ` Ted Dennison
2000-01-19  0:00                   ` Marin D. Condic
2000-01-19  0:00                     ` Ted Dennison
2000-01-18  0:00           ` Ted Dennison
2000-01-17  0:00         ` Gautier
2000-01-17  0:00           ` Alexander Van Hecke
2000-01-17  0:00             ` David Starner
2000-01-18  0:00             ` Gautier
2000-01-18  0:00           ` Ted Dennison
2000-01-18  0:00         ` Jeff Carter
2000-01-18  0:00           ` Keith Thompson
2000-01-19  0:00             ` Ole-Hjalmar Kristensen
2000-01-19  0:00             ` Jeff Carter
2000-01-19  0:00               ` David Starner
2000-01-19  0:00               ` Keith Thompson
2000-01-19  0:00             ` Gisle S�lensminde
2000-01-18  0:00         ` Pascal Obry
2000-01-21  0:00         ` Ada vs. C/C++ (was re: bitwise something-or-other) Mark Lundquist
2000-01-21  0:00           ` Mark Lundquist
2000-01-24  0:00           ` Hyman Rosen
2000-01-18  0:00     ` bitwise comparators Ted Dennison
2000-01-18  0:00     ` DuckE
replies disabled

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