There are 83 messages in this thread.
You are currently looking at messages 10 to 20.
In article <e...@4ax.com>, n...@nospam.invalid says... > Hans-Bernhard Broeker <b...@physik.rwth-aachen.de> wrote: > > >Anton Erasmus <n...@nowhere.net> wrote: > >> Hi, > > > >> I just need to get my facts straight. I have been given a spec, where > >> the use of C++ and a '51 core MCU is mandatory. AFAIC a C++ compiler > >> for the 51 does not exist. > > > >It does (see the other replies), but that's not really the answer to <snip> > It is just difficult to see how the inefficiency could be justified by the > limited benefits of C++ compared to C on the kind of system that will fit > on a 51. There is at least the possibility that those who specified the system did not understand that C was a different language from C++. You often see C/C++ referred to as if it were a single language and I seem to recall seeing C++ referred to in a context where the language being discussed was C. Depending on your relationship with the people involved it may be worth discussing this (although I suspect you would already have done that if you expected it to be at all fruitful). You might even be able to sell them on C as a subset of C++. Robert
"nospam" <n...@nospam.invalid> wrote in message news:e...@4ax.com... > Hans-Bernhard Broeker <b...@physik.rwth-aachen.de> wrote: > > >Anton Erasmus <n...@nowhere.net> wrote: > >> Hi, > > > >> I just need to get my facts straight. I have been given a spec, where > >> the use of C++ and a '51 core MCU is mandatory. AFAIC a C++ compiler > >> for the 51 does not exist. > > > >It does (see the other replies), but that's not really the answer to > >the problem. That combination is like asking an architect to build a > >family home with a fully service-qualified road inside to go from the > >couch to the toilet in an 40-ton 18-wheeler. It's completely crazy > >idea. > > Poor analogy IMO. They specified a language which will run inefficiently on > the specified hardware. People run interpreted BASIC on 51s is that > completely crazy? > > It is just difficult to see how the inefficiency could be justified by the > limited benefits of C++ compared to C on the kind of system that will fit > on a 51. > You did not catch the point: a minimal C++ program (doing nothing yet) needs more resources then is sensible to take from a 8051. Of course, if you're going to use C++ as weird C without using any objects, you can get by with an 8051, but what is the advantage over plain C? Like Cato the elder said: 'Ceterum censeo, Carthaginem esse delendam' (By the way, Karthago ought to be destryed). Even risking a repeat: DO NOT ATTEMPT IT. The first C++ compilers converted the code into straight C which was then compiled to the target object code. The converted C is plain awful. Tauno Voipio tauno voipio (at) iki fi
On 5 Aug 2004 11:12:53 GMT, Hans-Bernhard Broeker wrote: > Anton Erasmus <n...@nowhere.net> wrote: >> Hi, > >> I just need to get my facts straight. I have been given a spec, where >> the use of C++ and a '51 core MCU is mandatory. AFAIC a C++ compiler >> for the 51 does not exist. > > It does (see the other replies), but that's not really the answer to > the problem. That combination is like asking an architect to build a > family home with a fully service-qualified road inside to go from the > couch to the toilet in an 40-ton 18-wheeler. It's completely crazy > idea. > > I'd interpret that spec as someone's sick try at a prank. Sounds more like some junior, pointy haired middle management type whose golfing buddy told him C++ was hip. Bob -- "Just machines that make big decisions programmed by fellas with compassion and vision." -D. Fagen (remove yomama)
"Anton Erasmus" <n...@nowhere.net> wrote in message news:g...@4ax.com... > Hi, > > I just need to get my facts straight. I have been given a spec, where > the use of C++ and a '51 core MCU is mandatory. AFAIC a C++ compiler > for the 51 does not exist. > > Regards > Anton Erasmus If you don't use any C++ features, it should be possible to generate code that is no larger or slower than plain C. What specific C++ features does the spec writer have in mind? Bob
R Adsett wrote: > ... snip ... > > There is at least the possibility that those who specified the > system did not understand that C was a different language from C++. > You often see C/C++ referred to as if it were a single language and > I seem to recall seeing C++ referred to in a context where the > language being discussed was C. > > Depending on your relationship with the people involved it may be > worth discussing this (although I suspect you would already have > done that if you expected it to be at all fruitful). You might > even be able to sell them on C as a subset of C++. Which it isn't. So long as you realize that yourself before putting on the spin. -- "I'm a war president. I make decisions here in the Oval Office in foreign policy matters with war on my mind." - Bush. "Churchill and Bush can both be considered wartime leaders, just as Secretariat and Mr Ed were both horses." - James Rhodes. "If I knew then what I know today, I would still have invaded Iraq. It was the right decision" - G.W. Bush, 2004-08-02
CBFalconer wrote: > R Adsett wrote: > > ... snip ... > >>There is at least the possibility that those who specified the >>system did not understand that C was a different language from C++. >>You often see C/C++ referred to as if it were a single language and >>I seem to recall seeing C++ referred to in a context where the >>language being discussed was C. >> >>Depending on your relationship with the people involved it may be >>worth discussing this (although I suspect you would already have >>done that if you expected it to be at all fruitful). You might >>even be able to sell them on C as a subset of C++. > > > Which it isn't. So long as you realize that yourself before > putting on the spin. > Okay, I'll bite. What features or language constructs are in C that are not in C++? I always thought that C++ was a superset of C and curious about why it isn't. TTaylor
In article <2...@megapath.net>, Tom Taylor <ttaylor@no_spam_ateng.com> writes >CBFalconer wrote: >> R Adsett wrote: >> >> ... snip ... >> >>>There is at least the possibility that those who specified the >>>system did not understand that C was a different language from C++. >>>You often see C/C++ referred to as if it were a single language and >>>I seem to recall seeing C++ referred to in a context where the >>>language being discussed was C. >>> >>>Depending on your relationship with the people involved it may be >>>worth discussing this (although I suspect you would already have >>>done that if you expected it to be at all fruitful). You might >>>even be able to sell them on C as a subset of C++. >> >> >> Which it isn't. So long as you realize that yourself before >> putting on the spin. >> >Okay, I'll bite. What features or language constructs >are in C that are not in C++? I always thought that C++ >was a superset of C and curious about why it isn't. C has not been a sub set of C++ for some years. Parts of C++ use the same syntax for different things. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\ /\/\/ c...@phaedsys.org www.phaedsys.org \/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In article <1...@corp.supernews.com>, Bob <S...@excite.com> writes >"Anton Erasmus" <n...@nowhere.net> wrote in message >news:g...@4ax.com... >> Hi, >> >> I just need to get my facts straight. I have been given a spec, where >> the use of C++ and a '51 core MCU is mandatory. AFAIC a C++ compiler >> for the 51 does not exist. >> >> Regards >> Anton Erasmus > >If you don't use any C++ features, it should be possible to generate code >that is no larger or slower than plain C. You would thinks so but this is not the case.... The C++ compiler that is available for the 8051 is nothing like as efficient as the C compilers for the 51... SO even if you use almost straight C on the C+ compiler the code will be much biger than the same C on a good C51 C compiler. >What specific C++ features does >the spec writer have in mind? Now there is a good question that should be closely followed by "why?" ie why does he *NEED* those features. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\ /\/\/ c...@phaedsys.org www.phaedsys.org \/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Tom Taylor wrote:
> CBFalconer wrote:
>> R Adsett wrote:
>>
>> ... snip ...
>>>
>>> Depending on your relationship with the people involved it may be
>>> worth discussing this (although I suspect you would already have
>>> done that if you expected it to be at all fruitful). You might
>>> even be able to sell them on C as a subset of C++.
>>
>> Which it isn't. So long as you realize that yourself before
>> putting on the spin.
>>
> Okay, I'll bite. What features or language constructs are in C
> that are not in C++? I always thought that C++ was a superset
> of C and curious about why it isn't.
Many aspects. Just to name a few:
IN 'C' IN C++
'0' integer const char const
// syntax error comment to EOL
unless C99 standard
p = malloc(N * sizeof *p)
Best construct requires a cast
int new; integer named new syntax error
sizeof('1') == sizeof(int) == 1
<< left shift operator varies
const int i; i is protected from i is a constant.
writing, but can be
overridden.
Inquiries in comp.lang.c will bring you many more. The languages
are different, even though the common subset is not empty.
Thinking of subsets will bite you.
--
"I'm a war president. I make decisions here in the Oval Office
in foreign policy matters with war on my mind." - Bush.
"Churchill and Bush can both be considered wartime leaders, just
as Secretariat and Mr Ed were both horses." - James Rhodes.
"If I knew then what I know today, I would still have invaded
Iraq. It was the right decision" - G.W. Bush, 2004-08-02
"CBFalconer" <c...@yahoo.com> wrote in message news:4...@yahoo.com... > -- > "I'm a war president. I make decisions here in the Oval Office > in foreign policy matters with war on my mind." - Bush. > "Churchill and Bush can both be considered wartime leaders, just > as Secretariat and Mr Ed were both horses." - James Rhodes. > "If I knew then what I know today, I would still have invaded > Iraq. It was the right decision" - G.W. Bush, 2004-08-02 > > goofy sig. IS it absolutely necessary in a programming NG to wear your politics on your sleeve? Not to mention a sig that is nearly as long as the posts...