5 ms·
What's it like to use a compiled language for a web server?
by firefoxman1 15y ago
What's it like to use a compiled language for a web server?
- BarkMore 15y agoBecause the Go compiler and linker are so darn fast, the extra compilation step is just a blip. It's not like working with Java or C++.
- enneff 15y agoIt's really nice. You can build your Go program, deploy it as a single binary and it just runs. No need to hide it behind nginx or some other dedicated web server. The Go http package is DoS hardened and very fast. It's refreshing how little mechanism there is.
- stock_toaster 15y agoHow are the database libraries (postgres/mysql) these days? Last time I poked around (been a while) it seemed like most of them were pretty beta yet.
- enneff 15y agoThere's the new database/sql library (http://weekly.golang.org/database/sql http://weekly.golang.org/database/sql), which is a general SQL interface backed by various driver implementations (http://code.google.com/p/go-wiki/wiki/SQLDrivers http://code.google.com/p/go-wiki/wiki/SQLDrivers).
- stock_toaster 15y agoGood to see that has improved quite a bit. Thanks!
- icebraining 15y agoNo need to hide it behind nginx or some other dedicated web server. So, how do you serve static files?
- jbarham 15y ago> So, how do you serve static files? http://weekly.golang.org/pkg/net/http/#FileServer http://weekly.golang.org/pkg/net/http/#FileServer
- fs111 15y agoWell, even if I like go, I would not run a go program as root to listen on port 80. Can you drop the privileges from within go like apache or nginx are doing it?
- enneff 15y agoYou sure can: http://golang.org/pkg/syscall/#Setuid http://golang.org/pkg/syscall/#Setuid
- BarkMore 15y agoNo need to hide it behind nginx or some other dedicated web server. A contributor to Go says otherwise if SSL is involved: https://groups.google.com/d/msg/golang-nuts/yohrNK8lFhc/L1d6xocVmJ4J https://groups.google.com/d/msg/golang-nuts/yohrNK8lFhc/L1d6...