comp.lang.ada
 help / color / mirror / Atom feed
From: "Jed" <jehdiah@orbitway.net>
Subject: Re: Why use C++?
Date: Fri, 12 Aug 2011 10:14:23 -0500
Date: 2011-08-12T10:14:23-05:00	[thread overview]
Message-ID: <j23fvr$gsf$1@dont-email.me> (raw)
In-Reply-To: 4e44e50a$0$7619$9b4e6d93@newsspool1.arcor-online.net


"Georg Bauhaus" <rm.dash-bauhaus@futureapps.de> wrote in message 
news:4e44e50a$0$7619$9b4e6d93@newsspool1.arcor-online.net...
> On 12.08.11 07:03, Jed wrote:
>> "Dmitry A. Kazakov"<mailbox@dmitry-kazakov.de>  wrote in message
>
>>> Ada does not have predefined modular types in the package Standard,
>>> because
>>> any modular type can be constructed using "type T is mod N" 
>>> construct.
>>
>> OK, I plainly see what you meant now even without your example. It's
>> amazing what a good night's sleep will do. Last night, I was keying-in 
>> on
>> the word "algebra" too much and it blinded me to the overall meaning.
>>
>> I'm not sure I'd want that level of flexibility in a language. I think 
>> it
>> may be too much effort for too little benefit. It seems it may be 
>> doing
>> something in software that could be supported in hardware but isn't 
>> (?).
>> Maybe too much of a "purist" approach. I'd need more info about it and 
>> be
>> convinced it is worth it before I'd put that on my shortlist of
>> compelling features for a language to have.
>
> Perhaps it is info if beginners in embedded systems programming
> consistently produce much better results (statistics collected
> and testedover some 6 years) when they have an expressive  and
> likely more intuitive type system for fundamental types.

While that is definitely a good characteristic, I can't evaluate it 
without knowing what effort it takes to get it. Certainly something like 
ranged types is easily doable. I'm not sure the scope of what is being 
called for by those calling for it (e.g., Dmitry), that's the problem. I 
ranges is one thing, what are the others?

> My guess
> is that the absence of representation riddles is a boon.

I would say that abstraction is nice sometimes, but if you don't have any 
guarantee of the representation, then that is necessarily a higher-level 
language than C and C++ are (i.e., higher than "close to the metal).

> Put yourself
> in the position of a beginner who is woken up at 5p.m. They would not
> recall the rules regarding enum vs int, or the collection of 
> traditional
> idioms for declaring arrays in C, autotruncation of numeric values
> to fit in the space of LHS; and likely neither the more modern
> classes addressing hardware things.

Some of those things are decicely deficient, yes, but that is not to say 
that abstracting-away the representation is always good. Indeed, do that 
and you have a 4GL rather than a 3GL.

>   Then, will understanding the type declarations
>
>    type Intensity is range 0 .. 255;
>    for Intensity'Size use 8;

Oh, but I thought you desired to abstract-away the representation. What's 
that "Size use 8", then, all about?

>    type RGB is (Red, Green, Blue);
>    type Pixel is array (RGB) of Intensity;
>
> require much besides what is written?   Compare
>
>    #define RGB_LIMIT 3
>
>    typedef unsigned char Intensity;
>    enum RGB {Red, Green, Blue};
>    typedef Intensity Pixel[RGB_LIMIT];
>
> and
>
>   switch (1) {
>   case 0: break;
>   case CHAR_BIT == 8: break;
>   }
>
> somewhere.  If I am a beginner, what is the number of technicalities
> I must know it order to understand the second way of declaring things?
> (I'll leave out that the declare-like-used rule in typedef is
> confusing many. Maybe that's because the typdef-ed name isn't in some
> fixed position in the typedef.) 





  parent reply	other threads:[~2011-08-12 15:14 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fb9f787c-af06-427a-82b6-b0684e8dcbc5@s2g2000vby.googlegroups.com>
     [not found] ` <j1kaj8$dge$1@adenine.netfront.net>
     [not found]   ` <1e292299-2cbe-4443-86f3-b19b8af50fff@c29g2000yqd.googlegroups.com>
     [not found]     ` <j1tha5$11q5$1@adenine.netfront.net>
     [not found]       ` <1fd0cc9b-859d-428e-b68a-11e34de84225@gz10g2000vbb.googlegroups.com>
2011-08-10 19:05         ` Why use C++? Niklas Holsti
2011-08-10 22:37           ` Randy Brukardt
2011-08-10 22:49             ` Ludovic Brenta
2011-08-12  4:54               ` Randy Brukardt
2011-08-11  7:54             ` Dmitry A. Kazakov
2011-08-11  8:20               ` Jed
2011-08-11  9:13                 ` Dmitry A. Kazakov
2011-08-11 10:57                   ` Jed
2011-08-11 11:43                     ` Georg Bauhaus
2011-08-12  5:07                       ` Jed
2011-08-11 13:11                     ` Nomen Nescio
2011-08-11 15:11                       ` Paul
2011-08-12  5:15                       ` Jed
2011-08-12 21:39                         ` Fritz Wuehler
2011-08-14  6:52                           ` Jed
2011-08-14  8:13                             ` Nomen Nescio
2011-08-11 15:09                     ` Dmitry A. Kazakov
2011-08-12  5:03                       ` Jed
2011-08-12  8:32                         ` Georg Bauhaus
2011-08-12 13:15                           ` Hyman Rosen
2011-08-12 22:09                             ` Randy Brukardt
2011-08-12 15:14                           ` Jed [this message]
2011-08-12 17:20                             ` Georg Bauhaus
2011-08-12 19:51                               ` Jed
2011-08-12 21:22                                 ` Ludovic Brenta
2011-08-14  7:00                                   ` Jed
2011-08-16 13:06                                     ` Ludovic Brenta
2011-08-13  9:37                                 ` Georg Bauhaus
2011-08-14  5:22                                   ` Jed
2011-08-13 10:27                                 ` Georg Bauhaus
2011-08-14  5:35                                   ` Jed
2011-08-14 20:13                                     ` Georg Bauhaus
2011-08-15 11:38                                     ` Georg Bauhaus
2011-08-13 11:02                                 ` Georg Bauhaus
2011-08-14  5:56                                   ` Jed
2011-08-12  9:21                         ` Dmitry A. Kazakov
2011-08-12 13:26                           ` Jed
2011-08-12 14:30                             ` Dmitry A. Kazakov
2011-08-12 19:06                               ` Jed
2011-08-12 20:05                                 ` Dmitry A. Kazakov
2011-08-13  7:53                                   ` Jed
2011-08-13  9:15                                     ` Dmitry A. Kazakov
2011-08-13  9:29                                       ` Ian Collins
2011-08-13  9:52                                         ` Dmitry A. Kazakov
2011-08-13 11:10                                           ` Ian Collins
2011-08-13 11:46                                             ` Georg Bauhaus
2011-08-13 20:30                                               ` Ian Collins
2011-08-13 11:54                                             ` Brian Drummond
2011-08-13 13:12                                               ` Simon Wright
2011-08-14 11:01                                                 ` Brian Drummond
2011-08-14  4:54                                             ` Jed
2011-08-14  4:35                                           ` Jed
2011-08-14  6:46                                             ` Dmitry A. Kazakov
2011-08-14  4:49                                           ` Jed
2011-08-14  6:51                                             ` Dmitry A. Kazakov
2011-08-14  4:29                                       ` Jed
2011-08-14  7:29                                         ` Dmitry A. Kazakov
2011-08-16  8:18                                       ` Nick Keighley
2011-08-16  8:47                                         ` Dmitry A. Kazakov
2011-08-16  9:52                                           ` Nick Keighley
2011-08-16 10:39                                             ` Dmitry A. Kazakov
2011-08-16 10:23                                           ` Georg Bauhaus
2011-08-16 10:58                                             ` Dmitry A. Kazakov
2011-08-16 11:44                                               ` Georg Bauhaus
2011-08-16 14:51                                               ` Bill Findlay
2011-08-16 19:13                                                 ` Dmitry A. Kazakov
2011-08-16 19:23                                                   ` Bill Findlay
2011-08-12 11:48                 ` Stuart Redmann
2011-08-12 13:12                   ` Vinzent Hoefler
2011-08-12 15:50                     ` Stuart Redmann
2011-08-12 17:02                       ` Bill Findlay
2011-08-15 12:59                       ` Vinzent Hoefler
2011-08-12  5:02               ` Randy Brukardt
2011-08-12  5:16                 ` Robert Wessel
2011-08-12 16:39                   ` Adam Beneschan
2011-08-12  5:24                 ` Jed
2011-08-12  6:51                   ` Paavo Helde
2011-08-12  7:41                     ` Georg Bauhaus
2011-08-12 15:50                   ` Fritz Wuehler
2011-08-12 19:59                     ` Jed
2011-08-13  8:06                     ` Stephen Leake
2011-08-12  9:40                 ` Dmitry A. Kazakov
2011-08-12  9:45                   ` Ludovic Brenta
2011-08-12 10:48                     ` Georg Bauhaus
2011-08-12 15:56                       ` Ludovic Brenta
2011-08-13  8:08                   ` Stephen Leake
2011-08-18 13:39               ` Louisa
replies disabled

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