6 ms·
And for those of you who are not cofortable running with net/http (it is a rather simple server), there is always uWSGI support for Go, which I found to be a ra
by chewxy 14y ago
And for those of you who are not cofortable running with net/http (it is a rather simple server), there is always uWSGI support for Go, which I found to be a rather brilliant idea
- jinushaun 14y agoRunning directly off net/http? Isn't that just Node.js? People are comfortable with that.
- realrocker 14y agoIn the sense of your statement, people are uncomfortable with compulsory concurrency for everything in Node.js off http not http itself. Though you have to look at the package api yourself to decide whether it's running directly or not.
- chewxy 14y agoUh... no. Ruby on Rails runs off a ruby webserver. Flask has its own built in webserver, web.py has its own built in webserver. Tho these are not languages, rather frameworks, (and in the case of web.py, a library), they have built in webservers My point? These things came way before node.js, so no, node.js isn't the only one with a built in webserver. The difference is node.js has a rather performant built in webserver (still, exeperience shows that a properly tuned gevent or netty beats a properly tuned node.js). The idea is that instead of spending time tuning these things, you can just wrap it in a uWSGI container, and let better tuned-out-of-the-box servers like nginx handle the webserving
- gary4gar 14y agoeven php has built-in webserver too! http://php.net/manual/en/features.commandline.webserver.php http://php.net/manual/en/features.commandline.webserver.php
- kkowalczyk 14y ago(I wrote the article and 3 web apps on Go). I would be much more uncomfortable running on uWSGI than on net/http. As far as I can tell (https://github.com/unbit/uwsgi/blob/master/plugins/go/src/uwsgi/uwsgi.go https://github.com/unbit/uwsgi/blob/master/plugins/go/src/uw...) Go's uWSGI implementation is just a small wrapper over C code inside a dll. It's not portable (support for cgo on Windows is extremely sketchy). It also goes against common sense. Any code you can write in C, you can write in Go, except it'll be easier (Go is garbage collected, has built-in arrays, strings, hash tables etc.) and there's drastically smaller chance Go will have a security issues due to memory over-write. It duplicates lots of net/http functionality. net/http is well documented, well tested, reviewed by extremely knowledgeable people. Most importantly, it is being used in production by me and many other people. Finally, net/http gave me everything I needed to write my web applications. Before I would even considering using uWSGI (or anything else) someone would have to explain what exactly does it provide that is so indispensable for writing web apps.
- mitchi 14y agoYou have basically just described the advantages of the D language too. Do you plan on trying D?
- kaib 14y agoI've written some hundred thousand lines of production code in Go and D and feel they are very different languages. To sum it up: Go is a better C while D is a better C++.
- kkowalczyk 14y agoI did try D when it was in its early days (i.e. D 1) but at the time I was put off by lack of documentation, the standard library split (phobos vs. D) and general immaturity of the system. I'm sure things have improved since then but I really like Go's simplicity.
- unbit 14y agoIf net/http (or whatever http wrapper in whatever language) gives you enough batteries for a web application i am really happy for you. Sadly me (and a lot of other people) need a lot more. That is why the uWSGI project exists. Things like logging, clustering, statistics, multi protocol support, alarms, time events, request routing and blah blah are added to your app for free (and the funny thing is that you can tune lot of internals without rebuilding your app). Obviously if not having windows support is a too much high price for you the discussion ends here :)
- zerohp 14y agoRun nginx or lighttpd as a reverse proxy in front of net/http.