3 ms·
"What's the point" referred only to the use of deferToThread in Twisted. And I was specifically talking about "typical Web page", you know, login, logout, comme
by klibertp 12y ago
"What's the point" referred only to the use of deferToThread in Twisted. And I was specifically talking about "typical Web page", you know, login, logout, comments and such.
Other than that we actually agree 100%. I wrote that "Async is good if you mostly do things which can be asynchronous", you in turn listed a couple of examples of such things (WebSockets, not RDBMS). We're violently in agreement here.
One additional point I made was about Erlang. Really, if you're building " a product for which you see peak usage of, say, 1m users" go for Erlang (or rather about pre-emptive scheduling, but it boils down to Erlang anyway). In my experience it's the only environment which provides both concurrency and parallelism for both IO and CPU-bound tasks and is easily (transparently!) distributable to many nodes.
- IgorPartola 12y agoThat's a good and complete summary. I have been curious about Erlang for some time. The syntax keeps sending me running in the other direction, but perhaps I just haven't found a suitable project to work on where I could have an excuse to really dig in. any favorite resources you can recommend on learning Erlang?
- klibertp 12y agoOf course LYSE (http://learnyousomeerlang.com/ http://learnyousomeerlang.com/) and then "OTP in Action" after you know the basics. But! There are at least two languages that work on Erlang VM and offer alternative syntax. There's Lisp Flavoured Erlang (http://lfe.io/ http://lfe.io/) and Elixir (http://elixir-lang.org/ http://elixir-lang.org/). Elixir, in addition to syntax, improves on some aspects of Erlang which make newcomers uncomfortable, adds more powerful metaprogramming utilities and adds modern features like browsing the docs from REPL. I found "Introducing Elixir" (http://shop.oreilly.com/product/0636920030584.do http://shop.oreilly.com/product/0636920030584.do) rather good as a starting point and you can do quite a lot with it. But, in the end, you have to at least know how to read Erlang docs, because Elixir won't (and doesn't even try to) cover all of Erlang libraries with friendly wrappers. Personally I'm used to Erlang syntax, which is small and consistent and I like the "explicit is the only way, no implicit things ever" language philosophy of Erlang, but Elixir is a fine language to learn and use. There's a web framework called Phoenix which despite being very young is already better (subjectively) than pure Erlang frameworks. I used Erlang twice professionally: for writing a kind of reverse HTTP proxy with caching and for writing a backend for web app using WebSockets. It performed very, very well and was quite pleasant to write. Both things are running non-stop for over a year now and never crashed and were not restarted even once, despite being changed significantly in the meantime (that's just an anecdote, of course). Erlang is a bit odd and has much smaller community than Python. Lack of libraries may be a problem. I'd never use Erlang for something I'd use Django. I would consider using it for things I'd otherwise use Flask, but probably wouldn't chose it in the end. But it's my "go to" tool for situations where I'd use Twisted/Tornado or gevent now.