4 ms·
Would it be sane to use this to run Python modules in node.js?
by mfoy_ 8y ago
Would it be sane to use this to run Python modules in node.js?
- kodablah 8y agoIf the Python module was large and complex, it does something that would be incredibly difficult to replicate in nodejs either given the current ecosystem or costs of a rewrite, is not available in Rust/C/C++ that could be WASM'd (not mentioning others here due to large WASM overhead), you accept the large binary sizes of these things (i.e. you're not embedding the Python interpreter/runtime and putting on npm), and you're willing to put a node-friendly layer on top that makes the lower level calls...then it might be sane. But I'd consider modernizing to an updated emscripten that does WASM, see if you can avoid some emscripten runtime (i.e. WASM standalone compilation). For all other cases, stay in Node or use a lib from a language more suited to WASM compilation. Now, if it's an option between this and a native Node module, that depends on your opinion of Node FFI and native Node modules.
- jononor 8y agoIf you have significant amounts of Python code to reuse in another language, I would recommend: A) Run it as a subprocess B) Call it over HTTP request/response C) Use a message broker like AMQP