Integrating node.js with a huge C++ project

36 views
Skip to first unread message

Calogero Mandracchia

unread,
May 29, 2017, 1:53:43 PM5/29/17
to nodejs

HI!


I'm trying to figure out how to integrate "ORE" https://github.com/OpenSourceRisk/Engine ( that calls another huge rep github.com/lballabio/QuantLib) with Nodejs.

For executing ORE you just need to call it in a shell giving as argument a "foobar.xml" file. It will produce xml files and return 0 or 1.

My intent is to build a wrapping interface for calling ORE, the main priority is performance and scalability.

I quickly run deep into Nodejs addon ( github.com/nodejs/node-addon-examples), i found them very helpful and they gave me intels in how to interact with the V8 engine. Great!!

I also found useful the nan project ( github.com/nodejs/nan) simplifying the development.

After all the examples and nice exercise i made with simple C++ programs when i started integrating with all those dependencies, modules like boost and which files wrap and which not.. I got lost. I just have a basic understading of C++ and the more errors I solved the more node-gyp gave me!

  1. How should i do it? What's the best approach?
  2. Maybe it would be better for performace to just separate ORE and Node and trying to make them talk with child_process.execFile? If so how?
  3. I will need to run multiple instances of ORE with Nodejs, then using child_process.fork instead of creating an addon is a better choice?
  4. What's the best approach for running in multiple machines?

Since ORE and Quantlib are always being updated it doesn't seems to me a good approach writing an addon since sooner or later the code it's gonna change.


Thank you for your help!!

Reply all
Reply to author
Forward
0 new messages