-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++11 features #13
Comments
NB: I filed node-forward/node#30 ("src: replace NULL with nullptr") earlier today. Replacing |
I would vote for none. But |
@bnoordhuis Do we also need to consider embracing anything from the Blacklist too? http://chromium-cpp.appspot.com/#blacklist |
@indutny I added more commits that introduce other C++11 features so you can see for yourself what it would look like. Taking @dshaw Most of those features are blacklisted because of a certain crappy compiler... That's also an important reason of why C++11 library functions are verboten. I'm afraid we'll have to restrict ourselves as well, for now at least. Things that are under consideration, like move semantics or whether or not to use C++11 STL features, don't really affect node because we are not heavy users of containers anyway. (Though I could probably make a case for things like |
@indutny Also, when you say "I would vote for none", you should at least try to argue your case. :-) |
Usually "more features" is inevitably followed by "more overhead". Though the ones you've discussed so far don't seem to fall into that category. Though, now that Node requires C++11 does that also mean libuv can start using C99? |
Regrettably, no. The reason libuv stuck with C89 is that MSVC doesn't really support C99 and never will. You could perhaps carve out a common subset but that's it. I move that we do libuv2 as a from-the-ground-up rewrite in C++11. :-) |
I wonder if we could move to use clang on every platform. |
Probably. According to the compatibility page, it's not 100% compatible with MSVC yet but it's probably good enough for our purposes. With clang HEAD from a few weeks ago, I was able to compile a non-trivial add-on and load it with a node.exe built with MSVC. |
Using clang on every platform would even the field, both linux and windows users would usually lack the tools to compile addons. |
You've got that wrong, Sam. This is about building node with clang, not add-ons. The key is ABI compatibility. Clang emits code that is compatible with the platform's ABI on the Unices and it's getting there on Windows. That means users can build their add-ons with the compiler that suits them best and the result should Just Work(TM) with clang-compiled node. |
Can't you hold off until M$ releases Visual Studio 14? I refuse to upgrade from 2010 until the menus STOP SCREAMING AT ME. |
@bnoordhuis I was lead astray by this:
Depending on clang head is a bit of a barrier to entry to node dev, Perhaps depending on clang can wait until clang has binary releases for the platforms node supports, or recent linux distros package a useable version. |
FYI, re Microsoft, they have new options for Visual Studio versions (as they do with every release ...), to successfully compile Node with the latest V8 you need "Microsoft Visual Studio 2013 Windows Desktop Edition" plus the Windows SDK 8.1. It's pretty specific now, I'd love for clang to be a viable alternative, that'd likely radically simplify things, particularly for native addon builds which is just crazy for the average Windows Node developer. The fact that C++11 is going to be mandatory will mean that it opens up interesting possibilities for addon developers too, unless they want to ensure 0.10 (and prior) support where addon consumers don't have to have such modern compilers. But still, all documentation and recommendations will shift to C++11 compilers anyway so even people using 0.10 are likely going to have modern toolchains that enable C++11 features. |
Ignoring the platform SDK requirements.. the idea that clang binaries could be distributed via a node-gyp like module would awesome. |
This is going to open up an avalanche of spurious issues along the lines of "Installation Error With Turbo C++ 3.0 / GeOS" |
Filing the issue here because node-forward/node is currently private and I want this to be a public discussion.
Per the upgrade to V8 3.29 in commit node-forward/node@6bcea4f, we are now building the project with
-std=gnu++0x
. (Coincidentally, that means VS 2013 is now required on Windows.)The question: what C++11 features do we want to use and why?
Chromium follows these guidelines. That's a good if perhaps somewhat conservative starting point.
/cc @indutny @piscisaureus @trevnorris
The text was updated successfully, but these errors were encountered: