-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
remove misleading C extending possibility #7130
Conversation
/cc @nodejs/documentation |
@@ -1,9 +1,9 @@ | |||
# Addons | |||
|
|||
Node.js Addons are dynamically-linked shared objects, written in C or C++, that | |||
Node.js Addons are dynamically-linked shared objects, written in C++, that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two spaces before C++
Can you please provide a description and a reason why? Also I don't see the need. -1 |
See #7129 for description/need of the correction |
Yeah, sorry, this is not enough description. Also I am not sure what your intention is. You can of course write C addons. Even when you compile with a C++ compiler, it's still the language and compatible to the C++ environment. |
So, the truth is somewhere in the middle. While technically speaking it is possible to write add-ons in pure C, no one in their right mind does so because you can't really write anything useful that way, not without going through deeply unnatural contortions (think: calling C++ symbols by their mangled name.) Looking at it another way, you can write add-ons that are 99% C but the glue code is still going to be C++. |
I mean that is what is understood by addon authors and natural C/C++ developers already, is it not? Then I wouldn't overcomplicate this by being nitty, let alone not calling it "lying". Interoperability of C and C++ is more complicated than having a polar explanation and the current documentation already suits the reality well enough. Basically it answers the question: Can I integrate my C++ and C programs into Node, and the answer is yes. I'd like to move to closing this, if no-one objects. |
I don't have a stake in this, no objections from me. |
You can also integrate multiple other languages, but they are not mentioned. Not implying anything, just something to think about. |
No objections to closing. |
The last part seems true, perhaps |
+1 to @Fishrock123’s suggestion, although |
Hmm. maybe we can move the discussion into an issue - if someone feels like it. The intention behind this PR and the ref'ed issue doesn't match the above discussion, though, which rather revolves around (human) language. |
Based on the "reasons" above I can write addons In 8bit assembly, shall we put that into the docs too? Just because it is possibe it does not mean that is it usable. And it definitely does not mean that it's the developers credit that "you can write addons in c", yeah I can disassemble the c++ mangled namespace methods (well thanks you call that c support?) thats got nothing to do with nodejs or v8, every c++ project could say the same, yet they doesn't Breaking news, microsoft windows is open-source, have fun with assembly 😄 |
@Silur please refer to this http://stackoverflow.com/a/3789553/3580261. In any case, thanks for your input. |
can be loaded into Node.js using the [`require()`][require] function, and used | ||
just as if they were an ordinary Node.js module. They are used primarily to | ||
provide an interface between JavaScript running in Node.js and C/C++ libraries. | ||
provide an interface between JavaScript running in Node.js and C++ libraries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++ addons can provide interfaces to C libraries, so this should remain as was
FWIW, this PR showed up in my notifications last night, no idea why. Also, if @Silur you need a C addon building API, there is one now: https://github.com/nodejs/node/blob/master/doc/api/n-api.md |
No description provided.