At least with C++, you can easily write C shim layers and your code becomes compatible with most runtimes in existence. The opposite is not true with Go.
I ordinarily wouldn't care, but I usually feel like I have something to learn from ambitious networking libraries even when they're written in languages I prefer not to use.
I would rather talk about the implementation of async I/O too.
Yes. In fact, under Linux oftentimes spawning a thread and then running a system call can be faster than just running a system call.
> Conventional C++ wisdom advices against it.
With 32 bit CPU's you might run out of virtual memory quickly, since each thread allocates virtual memory for its stack.
With 64 bit CPU's there are no issues. (Also never forget that virtual memory isn't real memory, it's just a page counter.)
Interesting, do you have any further info (references, cites) on this?
Usually synchronous database drivers have to be reimplemented in an asynchronous fashion to work with event loops. It's not very hard though, could be as simple as adding jump tables and context structures into synchronous functions.
Emulating asynchronous execution with a thread is ok too. You do that to access filesystem anyway.
But if your first thought is about accessing a database server - you probably don't need to go asynchronous at all.
Straying away from the topic, but I used to support a file streaming library for the game studio I worked with, and while this approach worked, some things were not gracefully handled - for example canceling reading in the middle, or somehow giving all your I/O requests to the underlying system, so it can decide what's the best way to read them (aio?).
Also, Once I manage to compile folly and then wangle, what kind of database drivers can I use in conjunction with this? Would I shoot myself in the foot if I use this with libpq under CPUThreadPoolExecutor?
Same with Rust and dlang, I'm not sure how to apply the freedom to have pluggable executor into something useful in real life, I think this is the main reason Golang is killing it and it keeps getting better.
For now I have my money on Go but can't wait for http://www.ponylang.org/ to become stable.
Edit: Issue reported has been closed, I can now proceed to install wangle https://github.com/facebook/folly/issues/400
Edit 2: Found another issue, this time installing wangle https://github.com/facebook/wangle/issues/37