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
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
Hello Anton,
I've never used it, just found the link with Google, but take a look at
Anton Erasmus wrote in news: snipped-for-privacy@4ax.com:
Silly requirement but C++ does exist (in some form, e.g. EC++):
and maybe
-- - Mark -> --
Never tried it, can't say how good it is. Good luck (you'll probably need it...)
Regards,
-=Dave
-- Change is inevitable, progress is not.
This appears to be a C++ to C preprocessor. Information is sketchy but there are downloadable demos. They do a version integrated with keil tools. The demo of their standalone product uses SDCC.
I was going to say I wondered why they bothered considering how awful C++ compiled for a 51 must look but then tweaking a preprocessor for a particular backend compiler isn't that much work.
rumor has it that it uses too many resources. C++ in an 8052 is probably not the best idea. look aT
In article , Anton Erasmus writes
DON'T DO IT
The only C++ compiler system for the 8051 AFAIK is the Ceibo one that Keil can supply. However it is not very efficient and I can't see any reason for using it.
You C++ will be so restricted that is will be virtually C or it will be a VERY small program.
Why is C++ Mandatory? This spec is from some one who clearly does not understand what they are asking for.
BTW which 51 is it?
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\ /\/\/ snipped-for-privacy@phaedsys.org
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.
-- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.
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 a 40-ton 18-wheeler. It's a completely crazy idea.
I'd interpret that spec as someone's sick try at a prank.
-- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.
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.
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
on
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
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."
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
... snip ...
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.
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
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 /\/\/\/\/\ /\/\/ snipped-for-privacy@phaedsys.org
In article , Bob writes
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.
Now there is a good question that should be closely followed by "why?" ie why does he *NEED* those features.
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\ /\/\/ snipped-for-privacy@phaedsys.org
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
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...
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.