Are there any 8051 C++ compilers ? - Page 5

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Re: Are there any 8051 C++ compilers ?
Quoted text here. Click to load it

It should have but didn't occur to me that the unadorned plain
command-line version would truly have zero optimization.

Quoted text here. Click to load it

Ironically, I ran "strip" on the result as a matter of course, but
neglected to specify any optimization!  It seems that a useful corollary
to "you don't pay for what you don't use" is "you don't get what you
don't ask for."

Thanks also for the link to the ISO Performance Report.  Based on
testing of one C++ compiler for use on an embedded project, I had
concluded that virtual function calls were "expensive" but now I see
that it may be that the judgment was too hasty, and that performance
varies more significantly by compiler than I had thought.

Quoted text here. Click to load it

I only wish there were more modern compilers for embedded systems.  On
low end micros (like the 8051) and especially with less popular micros,
there isn't much to choose from.  Choices are often "buggy C compiler"
vs. "slightly less buggy assembler."

For the less popular (often 8-bit or 4-bit) micros used in some embedded
work, there are typically no C++ solutions available.  Comeau is the
only vendor I know of which currently supplies something like Cfront,
but they stress that their solution is tailored to specific C compilers
and is not for use as a generic C-compiler front end.

Is there much hope that this will improve significantly, say in the next
decade or so, or is the current glacial, incremental approach the best
we can expect?  Is it that few people ask for C++ compilers for embedded
work, or that they're that much difficult to create?

Ed


Re: Are there any 8051 C++ compilers ?
Quoted text here. Click to load it

Yes, as I stated above I know the difference between
compile-time constants and run-time constants.  What I was
trying to ask was why and how it was determinted that "C" was
the "peculiar" case and "C++" the normal, ordinary case.

--
Grant Edwards                   grante             Yow!  I have many CHARTS
                                  at               and DIAGRAMS...
We've slightly trimmed the long signature. Click to see the full one.
Re: Are there any 8051 C++ compilers ?
Quoted text here. Click to load it
... snip ...
Quoted text here. Click to load it

IMO the C version is more useful.  You can write a routine that
takes a parameter such as:

    int foo(const char *bar);

and happily pass it strings (or whatever else via pointers),
secure in the knowledge that the item will not be munged (barring
evil doings in foo).

The Pascal technique of a CONST section, where all such items can
be defined (and are NOT variables) makes more sense then the C++
const to me.  It can be simulated with defines.

--
"Churchill and Bush can both be considered wartime leaders, just
 as Secretariat and Mr Ed were both horses." -     James Rhodes.
We've slightly trimmed the long signature. Click to see the full one.
Re: Are there any 8051 C++ compilers ?
I am sorry about entering in the middle of the discussion, but I could not
resist anymore.
Quoted text here. Click to load it

1. Though formally C is not a subset of C++, C++ was created with huge
     effort to make it compatible with C. Making C code correct C++ code
    usually is very easy - I did it many times and sometimes it helped to
find
    some unknown bugs - thanks to some more strict rules in C++.
2. C++ is a multy-style languages and one of its use is described as
    "better C".
- so calling their similarities superficial is not true. For more details I
would
    recommend to read:

1. The Design and Evolution of C++ by Bjarne Stroustrup

2. http://wwwold.dkuug.dk/jtc1/sc22/open/n3502.pdf

3. More on topic:
I always prefer to use C++ - even in embedded systems. It is not necessarily
increase
resources needed for executing the program code. Sometimes it even helps
make code smaller and more effective - of cause not directly because of
using C++.
but C++ helps make source code smaller and more maintainable which helps
to find and implement some solutions, which could be much harder with C.

Of cause some techniques that are popular in C++ often not appropriate in
embedded area.

Last time I developed 8051 software (~5 years ago) I could not find C++
compiler. It was ~5 projects and would use C++ for all but one (this one
had CPU with only 128 bytes RAM),

    Regards,
                      Michael Furman




Re: Are there any 8051 C++ compilers ?
Quoted text here. Click to load it
Of course.  I even knew that.  Sigh!

I suspect it was the use of overridden that threw me.  I write C such
that I would consider overriding const to be an error, but style
conventions and illegal use are of course two quite different things.

Robert

Re: Are there any 8051 C++ compilers ?
Quoted text here. Click to load it
Good points, although I expect practically speaking compiler specific
8051 extensions are as much or more of an issue.

Robert

Re: Are there any 8051 C++ compilers ?

Quoted text here. Click to load it
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



Re: Are there any 8051 C++ compilers ?

Quoted text here. Click to load it

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."
We've slightly trimmed the long signature. Click to see the full one.
Re: Are there any 8051 C++ compilers ?
On Thu, 05 Aug 2004 15:21:53 GMT, Bob Stephens

Quoted text here. Click to load it

The spec has got all the right buzzwords etc. We have managed to stear
the client towards a more reasonable stance on many points, but where
we have unknowingly stepped on someone toes, it becomes much more
of a diplomatic game in stead of an engineering one.  It is much
easier to say that we believe we have found a typo, since no C++
compiler is available for the '51, than to in any way imply "What
idiot specced a '51 core and C++ as the language"

Regards
   Anton Erasmus



Re: Are there any 8051 C++ compilers ?
Quoted text here. Click to load it
... snip ...
Quoted text here. Click to load it

Luverly.  By contrast this points out, once more, why I am no
diplomat and need buffering.  I wouldn't even think of the 'typo'
ploy.

Of course in certain circles this spec is an open ended license.
It requires a compiler, which is not available, and therefore must
be developed (at X units of currency per hour until done).  After
this necessary preliminary we can quote the fixed price for the
actual job.  The compiler development might be inserted by making
the customer responsible for supplying the compiler, and if this
is awkward we will undertake .....  The system will increase the
critical buzzwords per page value.

With proper verbiage you could even supply the totally useless end
product in source form, after development on some fully featured
and standards compliant system.

I told you I was no diplomat. :-)

--
"The most amazing achievement of the computer software industry
 is its continuing cancellation of the steady and staggering
We've slightly trimmed the long signature. Click to see the full one.
Re: Are there any 8051 C++ compilers ?

Quoted text here. Click to load it

You are much braver than I am. I would not even for moment dream of
suggesting to develop a C++ compiler for the '51. The worst possible
scenario is if they think it is a good idea and is willing to pay a
reasonable hourly rate. I am sure there are people who would think it
an intellectual challange to create a half usable C++ compiler for the
'51.

Regards
   Anton Erasmus

Re: Are there any 8051 C++ compilers ?
Quoted text here. Click to load it

You miss my point - if they bite we have an open ended contract,
with the customer paying indefinitely for good hard work that
produces nothing relevant.  Any relevance to governmental
contracts is purely coincidental :-)

--
"The most amazing achievement of the computer software industry
 is its continuing cancellation of the steady and staggering
We've slightly trimmed the long signature. Click to see the full one.
Re: Are there any 8051 C++ compilers ?
Quoted text here. Click to load it


Let's be nice, now!  8-)

Are we thinking of Ada for the `51?

Re: Are there any 8051 C++ compilers ?


Quoted text here. Click to load it

Why not Befunge?


Re: Are there any 8051 C++ compilers ?
Quoted text here. Click to load it

No, but if somebody wants to specify a development for it using
Ada, and is willing to pay for best efforts development of an Ada
compiler for it on a time + expenses basis, I would be willing to
tackle it.  No guarantees of success :-)  I suspect I could find a
subset (such as add/subtract integers) I could compile, but I
think that is the limit.

Would you rather have that compiler for a PIC?

--
Chuck F ( snipped-for-privacy@yahoo.com) ( snipped-for-privacy@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
We've slightly trimmed the long signature. Click to see the full one.
Re: Are there any 8051 C++ compilers ?

Quoted text here. Click to load it

There is a sort of ada port for the avr for avrgcc
http://avr-ada.sourceforge.net/
http://avr-ada.sourceforge.net/install.html

Might be able to cobble it on to sdcc for pic and 8051
but then just wait for Chris Hills usual diatribe
about sdcc :-)

Alex Gibson



Re: Are there any 8051 C++ compilers ?

Quoted text here. Click to load it

Not in this country. If you are a smaller fish, then you have to stick
to the letter of a contract.  If the contract is vague and
contradictory, then it just means that one has to keep changing the
product and spec until they have something completely different from
what they asked for initially.
The biggest problem with these specs, is that they do not contain the
actual requirements. They contain somebodies half baked thoughts
on what they think the solution to their problem is. Add some current
buzzwords to the mix, and you have --- "The perfect specification".

If you are a bigger fish, then such a contract is quite nice. The
legal department should then be twice the size of the engineering
department of course. The only problem with this, is that engineering
will still have the sort end of the stick.

Regards
   Anton Erasmus

Re: Are there any 8051 C++ compilers ?
snipped-for-privacy@nowhere.net says...
Quoted text here. Click to load it
That's sort of where I figured you were going when I suggested there
might be confusion by your customer between C and C++.

I seem to have inadvertently ignited a small firestorm ;)  Sorry about
that.

Of cource if you do manage to steer them to an ARM variant (as you
suggested in another post) then the question becomes if not moot, at
least less pressing.

Robert

Re: Are there any 8051 C++ compilers ?
In article <Za7Rc.350309$ snipped-for-privacy@news01.bloor.is.net.cable.rogers.co
Quoted text here. Click to load it


Not really.... you still have to find a good C++ compiler for ARM. The C
compilers for ARM are still more efficient.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England    /\/\/\/\/\
/\/\/ snipped-for-privacy@phaedsys.org       www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Re: Are there any 8051 C++ compilers ?
Quoted text here. Click to load it


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 ( snipped-for-privacy@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Site Timeline