I'm a newbie to Nim but I really like it so far coming from C++ and Python...
I'm trying to find an example of a Nim webserver but it looks like httpserver is deprecated in favor of the asyncdispatch module. However, I'm trying to find something synchronous that handles requests in a round robin fashion so I don't have to write async code (trying to avoid async/await syntax).
Thanks for the help!
Hello incognick!
Glad to hear that you like Nim. Might I ask, why do you want a synchronous HTTP server?
I would prefer a coroutine solution as you could write and use synchronous modules without having to worry about async underneath.
If one would look at that I think this article is a great place to start:
https://spin.atomicobject.com/2015/03/16/elixir-native-interoperability-ports-vs-nifs
Personally I don't find Nim to be such a compelling alternative for web server stuff, unless we are talking about small services running on smallish devices. For scalable stuff "in the cloud" I think Elixir and Erlang are stealing the show for the next decade.
Do note I love Nim, but I tend to see it replace C/C++ primarily.
For scalable stuff "in the cloud" I think Elixir and Erlang are stealing the show for the next decade.
From your lips to God's ears, certainly, but what makes you think that this might be true? If anything, I see Go being used more and more for web server stuff, and I see Nim as a mighty hunter, errr, competitor, of Go.
Would it be possible to have a Python gevent like library in Nim? Does Nim support that sort of monkey patching?
What I'm thinking about is being able to write synchronous web server code that doesn't block on network io.