C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How portable is C++ today

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Metaosp
Guest





PostPosted: Sat Feb 25, 2006 1:06 pm    Post subject: How portable is C++ today Reply with quote



Hi,

When it comes to code portability, most people would think C is a better
choice then C++. That was probably true 5 or 10 years ago, but how
about today? Are there still many platforms or devices that have no
good C++ compiler? C++ offers a lot more then C, would you use it to
build a new cross-platform project that will support a wide range of
platforms, say from handheld devices to multi-nodes servers?


--
Metaosp
Back to top
Moonlit
Guest





PostPosted: Sat Feb 25, 2006 2:06 pm    Post subject: Re: How portable is C++ today Reply with quote



Hi,

Standard C++ is very portable. I develop mostly for unix (g++ version > 3.)
like systems but I never have a problem compiling the code (MS-VC++ 2003 and
later) on windows. However as soon as you start to use system specific stuff
threading/mutexes/micro timers or windowing systems than you likely do have
a small or large portability problem. It would be great if C++ (and C) would
add multi threading and micro timers to the standard libraries since I think
a lot of modern systems need or use them in some way.

--


Regards, Ron AF Greve

http://moonlit.xs4all.nl

"Metaosp" <metaosp (AT) gmail (DOT) com> wrote in message
news:1140870891.20935.21.camel@jupiter...
Quote:
Hi,

When it comes to code portability, most people would think C is a better
choice then C++. That was probably true 5 or 10 years ago, but how
about today? Are there still many platforms or devices that have no
good C++ compiler? C++ offers a lot more then C, would you use it to
build a new cross-platform project that will support a wide range of
platforms, say from handheld devices to multi-nodes servers?


--
Metaosp

Back to top
loufoque
Guest





PostPosted: Sat Feb 25, 2006 3:06 pm    Post subject: Re: How portable is C++ today Reply with quote



Metaosp a écrit :

Quote:
When it comes to code portability, most people would think C is a better
choice then C++.

Tools exist to convert C++ code to C.
Back to top
loufoque
Guest





PostPosted: Sat Feb 25, 2006 6:06 pm    Post subject: Re: How portable is C++ today Reply with quote

Default User a écrit :

Quote:
Those don't usually produce any kind of C code that can be used by
humans successfully.

Indeed, put that's not the point.
The point is to compile C++ code on a platform that only has a C compiler.
Back to top
Default User
Guest





PostPosted: Sat Feb 25, 2006 6:06 pm    Post subject: Re: How portable is C++ today Reply with quote

loufoque wrote:

Quote:
Metaosp a écrit :

When it comes to code portability, most people would think C is a
better choice then C++.

Tools exist to convert C++ code to C.

Convert? Not really. There are some compilers that will compile to C.
Those don't usually produce any kind of C code that can be used by
humans successfully.



Brian
Back to top
Nick Keighley
Guest





PostPosted: Sat Feb 25, 2006 7:06 pm    Post subject: Re: How portable is C++ today Reply with quote

I've de-top posted this

Moonlit wrote:
Quote:
"Metaosp" <metaosp (AT) gmail (DOT) com> wrote in message

When it comes to code portability, most people would think C is a better
choice then C++. That was probably true 5 or 10 years ago, but how
about today? Are there still many platforms or devices that have no
good C++ compiler? C++ offers a lot more then C, would you use it to
build a new cross-platform project that will support a wide range of
platforms, say from handheld devices to multi-nodes servers?

Standard C++ is very portable.

I understood (and I'm no expert) that some of the more esoteric
template stuff was not universally supported. For instance this page
from Boost:

http://www.boost.org/status/compiler_status.html

Quote:
I develop mostly for unix (g++ version > 3.)
like systems but I never have a problem compiling the code (MS-VC++ 2003 and
later) on windows. However as soon as you start to use system specific stuff
threading/mutexes/micro timers or windowing systems than you likely do have
a small or large portability problem. It would be great if C++ (and C) would
add multi threading and micro timers to the standard libraries since I think
a lot of modern systems need or use them in some way.

--
Nick Keighley
Back to top
Rolf Magnus
Guest





PostPosted: Sat Feb 25, 2006 8:06 pm    Post subject: Re: How portable is C++ today Reply with quote

Default User wrote:

Quote:
loufoque wrote:

Metaosp a écrit :

When it comes to code portability, most people would think C is a
better choice then C++.

Tools exist to convert C++ code to C.

Convert? Not really. There are some compilers that will compile to C.

And what exactly is the difference?

Quote:
Those don't usually produce any kind of C code that can be used by
humans successfully.

So?
Back to top
heinz
Guest





PostPosted: Sun Feb 26, 2006 5:06 am    Post subject: Re: How portable is C++ today Reply with quote

Quote:
It would be great if C++ (and C) would add multi threading
and micro timers to the standard libraries since I think
a lot of modern systems need or use them in some way.

That would have been really, really nice 20 years ago, but today we
really need direct keyboard control (rather than echo'd input streams)
and also graphical display (rather than typewriter like text out) as
well.

A truly portable C++ application can be little other than a crude
command line tool. This isn't the kind of application your typical user
runs today. To realize portability with C++, it is up to the developer
to partition projects into portable and non-portable sections and use
things in the standard whenever there is a choice versus platform
specific API's or compiler extensions. Tuning the architecture to
maximize portability is not free and takes time, but it is an
investment that pays dividends in the end.
Back to top
Moonlit
Guest





PostPosted: Sun Feb 26, 2006 12:06 pm    Post subject: Re: How portable is C++ today Reply with quote

Hi,

You assume that every program has a user interface. Actually the programs I
usually write don't. And still then, I can use a lot of the classes I write
in windows application. Sockets, logging etc. these are all common amongst
unices and ms-windows.

And we do need multithreading, microtimers and the lot in today's windows
applications and daemons etc.. Multithreading isn't exactly a technology of
twenty yeears ago it is something that get's used more and more (for
isnstance to separate the event-handling thread (that handles gui messages)
and doing heavy duty stuff in the background ).



Regards, Ron AF Greve

http://moonlit.xs4all.nl

"heinz" <heinz_baer@my-deja.com> wrote in message
news:1140929685.470167.309450 (AT) z34g2000cwc (DOT) googlegroups.com...
Quote:
It would be great if C++ (and C) would add multi threading
and micro timers to the standard libraries since I think
a lot of modern systems need or use them in some way.

That would have been really, really nice 20 years ago, but today we
really need direct keyboard control (rather than echo'd input streams)
and also graphical display (rather than typewriter like text out) as
well.

A truly portable C++ application can be little other than a crude
command line tool. This isn't the kind of application your typical user
runs today. To realize portability with C++, it is up to the developer
to partition projects into portable and non-portable sections and use
things in the standard whenever there is a choice versus platform
specific API's or compiler extensions. Tuning the architecture to
maximize portability is not free and takes time, but it is an
investment that pays dividends in the end.
Back to top
Chameleon
Guest





PostPosted: Mon Feb 27, 2006 12:06 am    Post subject: Re: How portable is C++ today Reply with quote

Moonlit wrote:
Quote:
Hi,

Standard C++ is very portable. I develop mostly for unix (g++ version > 3.)
like systems but I never have a problem compiling the code (MS-VC++ 2003 and
later) on windows. However as soon as you start to use system specific stuff
threading/mutexes/micro timers or windowing systems than you likely do have
a small or large portability problem.


Quote:
It would be great if C++ (and C) would
add multi threading and micro timers to the standard libraries since I think
a lot of modern systems need or use them in some way.


I believe, companies must agree to a third-party API libraries which
must be implemented in all OS platforms. (like OpenGL in 3d graphics, or
MIDP 2.0 on mobile phones)

However, a compiler for an 8-bit microcontroller and an OS for x86
processors cannot have the same API.
Back to top
Chameleon
Guest





PostPosted: Mon Feb 27, 2006 12:06 am    Post subject: Re: How portable is C++ today Reply with quote

loufoque wrote:
Quote:
Metaosp a écrit :

When it comes to code portability, most people would think C is a better
choice then C++.

Tools exist to convert C++ code to C.

Wrong. Not in human readable form.

btw, this decreases optimization from C++ compiler.
Back to top
Guest






PostPosted: Mon Feb 27, 2006 10:06 am    Post subject: Re: How portable is C++ today Reply with quote

Rolf Magnus wrote:
Quote:
Default User wrote:

loufoque wrote:
Tools exist to convert C++ code to C.

Convert? Not really. There are some compilers that will compile to C.

And what exactly is the difference?

Expectations. I'd expect a converter to convert // to /* */ . I'd
expect a compiler
to strip them outright. Same goes for every other preprocessor entity.
Since
that includes headers, the output of the compiler could be usable on
only that
precise machine, with precisely the one C compiler installed there.

HTH,
Michiel Salters
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.