I'm working on a project where I need heavy numerical calculations to be real-time visualized with something flexible like D3.js. Are there frameworks out there that would let me painlessly achieve this? Or do I need to use some sort of "glue" code written in, say, Python?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Foreign Function Interface (FFI) bindings and Inter-Process Communication (IPC).
FFI is where a standard agreed upon protocol is built into the assembly at compile time which allows access to the assemblies facilities by foreign languages. There are a variety of FFI standard interfaces, but I am familiar with none that allows an interpreted language to interface with a compiled language or vice versa; the concept doesn't fit with using interpreters as their scripts are plain text with no assemblies to interface.
Inter-Process Communication (IPC) is where you run the process in one language, and the other process in the other language, and then use a form of IPC to communicate between the two. Commonly this is done via shared memory space where both processes can put data into that memory space and read from it to send messages back and forth. The same technique is used with files sometimes though this is a high-overhead technique due to the IO costs, it does however afford a durability in the event of either or both processes crashing, or even the machine losing power.
The shared memory technique for IPC often comes in a couple flavors:
Other than shared memory or disk, the other largely used IPC technique is network communication. Whenever your browser accesses a website it is communicating with another process, so this is IPC, and in this way web services have become a hugely common way of accomplishing IPC. Direct TCP techniques are still used as well as even UDP for certain tasks, but the point is the network may act as a communication layer between processes just as a memory space or disk space may.
All of this said, my suggestion is you use web services for IPC as your language interoperation technique, because you wish for visualization on a browser.
That's all. I hope you learned something, carry on :)
If you (your bosses) are really that desperate into making it look like there isn't a browser doing the heavy hauling, look into including a WebKit widget (cross platform) or embedding an MSIE frame (all-around easier and faster, but only available on Windows, and might raise issue with MSIE versions) into your windowed app.