I've just read this article which talks about using Python in a serverless setting. Nim is compiled, so obviously, you can't do it exactly the same way, but I had the feeling it would not be that hard to do.
First, you would need some "cloud" to run it on, and I don't think existing serverless offers, like from AWS, would be usable, as they usually target Java/Python, so you would need something like Kubernetes, and maybe Kubeless could be adapted to Nim. You'd start with some repo of your code, possibly based on Nimble, where you would push code (or "references" to code, in the form of URLs). This would trigger some "compile service" to create a new DLL of that code, and put it in an "object store". Once this is complete, you can send request to have "functions" executed on your cloud. Each node would have one (or more?) processes that run in permanence, and have pre-opened connection to your DBs, and a (web?)server to receive requests, such that it only needs to load the DLLs on demand, run the functions (which take input from the DBs), and drop the DLLs when no more needed.
I currently don't have any need for this myself (as "serverless functions" are basically the opposite of "actors", from my point-of-view), but I'd be interested to know if there is any Nim limitations that would make something like this hard to implement, as I can then expect to eventually run into those limitations myself, while trying to spread actors over a cluster.
as they usually target Java/Python
You forgot to mention JS, which is usually an option and which Nim compiles to. Moreover, nim can compile to asm.js through emscripten to gain even more performance if that is desired.
if there is any Nim limitations
From my experience Nim has proven to be really portable and versatile, so I would not expect any dead ends here.
@bluenote That's interesting; I could reuse some of that for my own experiments. Would you consider adding a short readme.md, and, most importantly, a license?
EDIT: And while I'm at it, I guess you first looked around for other distributed implementations in Nim? Anything else I should look at?
@federico3 I just read the 2017 community survey post; some users were complaining Nim's "Unix" binaries were "HUGE"; so it seems not everyone agrees on that (I personally have no idea).
@bluenote Thanks! EDIT: seems like only the readme was committed...
I have a story of a "serverless" hack. It's ugly, but you might appreciate it:
There was a company that I worked with that used AWS lambda with Go lang binaries. They did this by having the python runtime "exec" the binary with the python subprocess.popen api. As long as the binary and the python bootstrap script were packaged together it worked fine. I used similar tricks to get native C crypto libraries to work from python in AWS lambda.