TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Sorry State of C++ Portability

72 pointsby pertinhowerover 12 years ago

19 comments

drobillaover 12 years ago
A more accurate title would be "The Sorry State of Microsoft's C++ Compiler".<p>As usual with native code, portability is actually quite easy to achieve - except to Windows using MS's native tools.
评论 #4694543 未加载
评论 #4694574 未加载
评论 #4694653 未加载
kelnosover 12 years ago
<i>I love C++.</i><p>There's your first problem.<p><i>I love C++11 to pieces.</i><p>... and your second.<p>Yes, I know that sounds language-war-flamey, but has anyone seen a more complex language with weird context-dependent behavior and strange side effects? The STL is a mess of weird APIs and often hard-to-understand behavior (and let's not forgot the utterly obtuse warning and error messages).<p>Every new revision of the language comes with a slew of new features bolted onto the language or standard library. All of them are arguably useful, but the standards process is driven too much by permissive committee, setting the bar very low (with regard to use-cases, not quality) for new features to be included.<p>I just feel like in this day and age, with such focus on code reuse, readability, and security over performance, C++ is a very dangerous language to work with.<p>(Having said this, a month or two ago I wrote a VoIP SDK in C++, mainly as an experiment. It was certainly easier to write in some ways than if I'd used straight C, but it was such a pain in so many other ways that I hesitate to consider my experiment a success.)
评论 #4694745 未加载
评论 #4694694 未加载
评论 #4694696 未加载
JoachimSchipperover 12 years ago
This is bad. Know what else is bad? It's 2012, and MS still has no plans to support C99. Waiting for MS to follow standards is frustratingly often futile. (See also: IE.)
评论 #4694562 未加载
评论 #4694545 未加载
nnqover 12 years ago
...how about Intel's C++ compiler on Windows? (it integrated in Visual Studio and one could even have one compiler on all platforms by using Intel's solution on all supported platforms)
评论 #4694918 未加载
评论 #4694470 未加载
评论 #4694480 未加载
评论 #4694582 未加载
jon6over 12 years ago
The major issue he has seems to be that visual studio is much easier to use than the command line + makefiles. Ok that may be but if you are porting to linux then you probably are already familiar with the command line and makefiles. Supporting gcc on windows from a makefile that you already need on linux is not super hard.<p>But in any case I find visual studio a horrendous piece of garbage.
muninover 12 years ago
"Perhaps by 2014 or so, Microsoft will have overcome their intellectual challenges..."<p>was this really necessary? I'm quite sure that Microsoft is smart enough to implement the C++11 standard, so why it isn't implemented is actually more nuanced than "they're dumb lol". Could it be that you're one of a very small minority who would run into these problems?
评论 #4695053 未加载
评论 #4694730 未加载
评论 #4694743 未加载
TwoBitover 12 years ago
C++11 is a newly sandardized language. It took years for C++98 to have conforming compilers. I have no sympathy for OP, especially since he could have implemented hs game fine by simply using more compatible syntax.
评论 #4694337 未加载
cheesefunnelover 12 years ago
If one is determined to use the more exotic features of C++ this will happen, I've had code that the MS compiler coped with and GCC didn't, so it cuts both ways. If one is going to write cross platform code, you do this research up front then restrict yourself to commonly supported features, going template wild then moaning about it on a blog seems a little short sited to me.
forgottenpaswrdover 12 years ago
This should be the sorry state of Microsoft tools for actual portability between platforms.<p>Obviously Microsoft(or any other platform maker) does not want you to easily port your Application between platforms, but this does not mean the language is in bad shape.<p>Also, "The sorry state of WebGL" because Microsoft has decided not to support OpenGL.<p>You don't need to use Microsoft products. They are plenty of alternatives today.
评论 #4694712 未加载
aidenn0over 12 years ago
TLDR: I'm pissed that a standard with significant new features that is less than a year old doesn't have enough mature implementations yet
评论 #4694407 未加载
评论 #4694394 未加载
pjmlpover 12 years ago
This is nothing new.<p>Ada, C, C++, Pascal, Algol, PL/I, Common Lisp, among many others, always have different levels of standards compliance level across compiler vendors.<p>This is the price to pay for ANSI/ISO standard compliant languages.<p>The other option is to have languages like e.g. Python with a single open source implementation across multiple operating systems. Or proprietary languages where the vendor decides to support multiple systems.
评论 #4694625 未加载
评论 #4695106 未加载
zannyover 12 years ago
I just want to mention I went reading about variadic templates and std::bind and my mind is still aching. I even <i>kind of</i> understand move semantics and rvalue references with &#38;&#38;, but a lot of template metaprogramming just blows my mind. It is really humbling when concepts like argument binding to function objects and all these other insanely complex ideas that "make neat things happen" are so overwhelming. I guess I'm gonna be reading C++ reference all afternoon now :P<p>&#62; Windows command lines, and makefiles. CMake can help take the edge off managing a project’s build process, but this, too, is a new, non-trivial skill to learn.<p>And this makes me feel all the wierder, as someone who doesn't use Microsoft tools ever and is used to terminals, vim, and makefiles, but still can't comprehend some of the language features of C++11.
评论 #4694773 未加载
IsTomover 12 years ago
The title should say "Visual Studio doesn't support C++11 almost at all, compared to g++ and Clang." Current one is at least misleading.
pippyover 12 years ago
Cross platform compatibility is detrimental to Microsoft. Their core businesses is an Operating System, so vendor lock in is an important strategic goal. Visual Studio has always compiled differently, so portability must be done diligently so companies will see it as an expense. This way more exclusive software gets made and helps the Microsoft ecosystem.<p>This pattern can be seen mirrored across many of Microsoft's products; Internet Explorer, Office, XBox etc.
JanneVeeover 12 years ago
I kind of felt sorry for the guy until...<p>&#62; Perhaps by 2014 or so, Microsoft will have overcome their intellectual challenges.<p>Oh developing a game is different than implementing in a complicated feature in legacy code. Especially when that legacy code is relied upon by businesses all over the world including your own. I'm not feeling sorry for him anymore.
jlaroccoover 12 years ago
This is nobody's fault but his own.<p>He didn't have to use a bleeding edge version of C++. The standard is less than a year old and it's a very well known fact that it's not fully supported by any compilers, and that all of the compilers have different levels of support.<p>If building with multiple compilers was important to him, then this is his own screw up, not Microsoft's.
评论 #4694728 未加载
评论 #4694861 未加载
评论 #4695190 未加载
angersockover 12 years ago
Speaking as a (at one time) fellow game developer: maybe you shouldn't go ahead and use the niftiest new features instead of being conservative in your choices.<p>I don't really feel any sympathy here--for the C99 part, okay, but otherwise, none whatsoever.
thwestover 12 years ago
For all that is lacking, the features that MSVC does support (lambdas, auto, std::move) are extremely valuable tools. There's no excuse for not implementing variadic templates or template aliases yet, but there's no reason not to jump onto the existing features.
评论 #4694572 未加载
frozenportover 12 years ago
There is no C++ Renaissance!<p>Look at the <a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html" rel="nofollow">http://www.tiobe.com/index.php/content/paperinfo/tpci/index....</a> . It has been in decline since 2005!