Skip to content
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

Closed
wants to merge 2 commits into from
Closed

remove misleading C extending possibility #7130

wants to merge 2 commits into from

Conversation

Silur
Copy link

@Silur Silur commented Jun 3, 2016

No description provided.

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Jun 3, 2016
@ChALkeR
Copy link
Member

ChALkeR commented Jun 3, 2016

/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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two spaces before C++

@eljefedelrodeodeljefe
Copy link
Contributor

Can you please provide a description and a reason why? Also I don't see the need. -1

@mscdex mscdex added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jun 3, 2016
@Silur
Copy link
Author

Silur commented Jun 3, 2016

See #7129 for description/need of the correction

@Silur Silur changed the title removing misleading C extending possibility remove misleading C extending possibility Jun 3, 2016
@eljefedelrodeodeljefe
Copy link
Contributor

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.

@bnoordhuis
Copy link
Member

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++.

@eljefedelrodeodeljefe
Copy link
Contributor

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.

@bnoordhuis
Copy link
Member

I don't have a stake in this, no objections from me.

@vkurchatkin
Copy link
Contributor

Can I integrate my C++ and C programs into Node, and the answer is yes

You can also integrate multiple other languages, but they are not mentioned. Not implying anything, just something to think about.

@cjihrig
Copy link
Contributor

cjihrig commented Jun 3, 2016

No objections to closing.

@Fishrock123
Copy link
Contributor

The last part seems true, perhaps linked using C++, and usually written in C/C++ are more appropriate for the first part?

@addaleax
Copy link
Member

addaleax commented Jun 3, 2016

+1 to @Fishrock123’s suggestion, although glued together may be a better word here than linked?

@eljefedelrodeodeljefe
Copy link
Contributor

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.

@Silur
Copy link
Author

Silur commented Jun 5, 2016

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 😄

@eljefedelrodeodeljefe
Copy link
Contributor

@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.
Copy link
Contributor

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

@sam-github
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.