I am a strict native languages programmer learning Erlang recently, and I am wondering why people not use c/c++ to directly implement their own functions/modules and run it natively ? And it's not something very difficult to implements even with good scalability. Here's my thoughts:
Any functions in functional programming language take some inputs and generate some outputs. This can be easily done in c/c++ by making small programs (.exe). Each executable has its name in the format of name_version.exe and takes one file as input data and produce another file as output data.
Programming invocation is nothing but making a temporary input file and calling the most updated .exe file and waiting for the result.
Remote function call in function programming language can be implemented by making a server program in each server, accepting requests in the form of (executable path + ' ' + input params), then the server start to look for the latest version of executable in their local copies, invoke it as a new process, and sending back results in TCP stream.
Scalability can be implemented by making a monitor program in each server returning current states (%cpu, %mem) and shooting UDP messages to tell other servers periodically. So that each .exe program can smartly do RPC to the idle servers.
Application update is as easy as copying a new .exe files with the increasing version number. And old .exe files won't be deleted, or can be deleted manually.
So overall, function programming seems to be something to solve the scalability problem. And scalability problem often arise in the situation that one machine has some certain bottleneck on CPU, mem, harddisk,... etc. However, if function programming is not efficient enough, it won't actually be a true solution to scalability problem. Just think of a native program runs 20x faster than a program written in a function programming language, and use 10x less memory. And it's similar to say that you have 20 machines running together, but all these machines can't even beat a single machine that running the native code.