Javascript interacts with C ++

I have a desktop application that has a C ++ backend and an HTML5 / JS frontend. Currently we must use Google V8 or Mac Webview and Objective-C to allow Javascript and C ++ to communicate. Is there a way to get them to talk directly to each other without middleware?

Attempt to execute:

  • Share variables.
  • Call functions from C ++ to JS.
  • Call functions from JS to C ++.

I tried google search and all this points to the above solutions.

+5
source share
5 answers

-, . NodeJS , write ++ javascript. . A :)

Electron project, , - Chrome.

+3

Electron, Chrome API Node.js. nbind, ++ JavaScript. , .

++, - ++ 11:

NBIND_CLASS(X) {
    construct<int, int>();

    method(Y);
    method(Z);
}

X , 2 ints Y Z .

nbind Here is an example of how to pack your C ++ code into the Node.js addon for use in Electron.

+1
source

Please take a look at this, I am the owner

http://code.google.com/p/libjspp/

Does libjspp make it easy to interact and interact with c ++ with javascript spidermonkey 1.8.5? Non-intrusive for C ++ and javascript world at the same time. Useful for applications that want to implement and extend Javascript in an object-oriented manner. Very thin interface with virtually no overhead using C ++ templates.

I AM

0
source

All Articles