I am currently at a project that is mainly written in Node.js, which involves non-linear curve fitting. After trying to do this task with Node.js itself, I gave up on it, because it is simply impractical. So I was looking for a high level language for solving mathmatical problems like that one I am facing. I had to decide between MATLAB and Python, but since Python has really powerful methods by now and it's free, I decided to go with Python.
Now I need to find a way to communicate between Node.js and Python, and I already found two completely different approaches:
- Setting up a Python server, that solves the mathematical problem as described here
- Or spawning a child process from my node.js code as described here
Now I would usually go with the client server approach because in my opinion it is cleaner, because it separates both languages. But since somebody is writing a blog post about the second approach, there must be some advantage with it, right?
Would somebody briefly explain what are the advantages and disadvantages with both approaches in this case ?