I'm trying to write a small Node.js NAPI add-on for VCMP but I am confused how will it work with VCMP's module SDK.
I have seen the "vcmp-java-plugin" which embeds JVM and binds VCMP events to Java methods (Level 1 abstraction) and another plugin "vcmp-javascript-plugin" which is written on the top of vcmp-java-plugin that embeds JavaScript v8 engine in Java and binds JavaScript functions to java methods (Level 2 abstraction).
I very much like the "vcmp-java-plugin" since we can use Java freely and have the full advantage of the language, similarly if we could embed node in c/c++, interfaced with module SDK we might have the power of Node.js. It will also make the server development easier since many developers already know JavaScript.
There are some approaches to solve the problem.
We can write NAPI add-on for Node.js, it is nothing but c/c++ binding to Node.js, now the point is when we write Node.js add-on we have to run JavaScript code first for example: "node server.js" in terminal, it will start a Node.js script/process in a shell, but we want to run VCMP and handle the logic in Node.js, we could embed v8 engine and provide it as a dll plugin for VCMP server but that would't be effective since we cannot use the power of Node.js.
If anyone has a better idea or how to embed Node.js or use Node.js as an environment for VCMP servers please leave a clue then.
P.S: This is purely for learning purpose
I have seen the "vcmp-java-plugin" which embeds JVM and binds VCMP events to Java methods (Level 1 abstraction) and another plugin "vcmp-javascript-plugin" which is written on the top of vcmp-java-plugin that embeds JavaScript v8 engine in Java and binds JavaScript functions to java methods (Level 2 abstraction).
I very much like the "vcmp-java-plugin" since we can use Java freely and have the full advantage of the language, similarly if we could embed node in c/c++, interfaced with module SDK we might have the power of Node.js. It will also make the server development easier since many developers already know JavaScript.
There are some approaches to solve the problem.
We can write NAPI add-on for Node.js, it is nothing but c/c++ binding to Node.js, now the point is when we write Node.js add-on we have to run JavaScript code first for example: "node server.js" in terminal, it will start a Node.js script/process in a shell, but we want to run VCMP and handle the logic in Node.js, we could embed v8 engine and provide it as a dll plugin for VCMP server but that would't be effective since we cannot use the power of Node.js.
If anyone has a better idea or how to embed Node.js or use Node.js as an environment for VCMP servers please leave a clue then.
P.S: This is purely for learning purpose