Go language support on shared hosting


PHP? Uh, sure, fine. Ruby on Rails? Gack. Writing your own FastCGI apps using C? Well, yes, sure, why not, but… the future (so says Google) is Go (they say so because they invented the language a decade ago, of course…)

Creating FastCGI applications using Go is actually already possible — here is my tutorial for getting it installed and writing a test application. The main drawback? Well, if suddenly everybody started developing Go apps it would mean tons of copies of the Go compiler & libraries over and over again (and almost all would be different versions…).

My suggestion is therefore to have Go pre-installed on the shared hosting servers to avoid needless duplication. Aye, I’m aware that people are still going to continue to develop on PHP for the decades to come; and those who are C die-hards (nothing against them, btw!) will continue to develop FastCGI applications using C. Go is an alternative to both: easier to use than C, being a strongly-typed language; aimed for systems development, so it compiles to small and efficient code which is as fast as C in many situations (that was a design goal); it has a standard way of development (no need to figure out how to create your directories tree) and comes straight out of the box with a ton of standard libraries for writing efficient web applications (so, yes, it not only ‘replaces’ things like Ruby on Rails, but it also gets rid of the need of having those cute frameworks for PHP, such as Laravel… yuck!). And, well, it’s compiled. Not Almost-Just-In-Time-Compilation-But-Not-Quite as PHP 7.0, but really compiled with a modern, efficient compiler (which is blindingly fast… aye, even under shared hosting!) to good, old, superfast machine code. No PHP application, no matter how well it has been written, can beat machine code. And this comment is made by someone who is a die-hard fan of PHP :slight_smile: but at some point in my life I needed something faster, more efficient, multi-threaded, and, well, easier to figure out; Go code is generally extremely compact, as it subsumes a lot of things, and it’s not quite object-oriented, but a new programming paradigm (invented by the same guys who already gave us C… almost half a century ago!) which borrows the best of object-oriented programming while at the same time keeping away the insane ideas that have been floating around for the past few years which only make code way harder to track down.

No, there is no WordPress written in Go (yet). But there are certainly several static content generators (rivalling with Grav which runs under PHP), such as Hugo. And remember that old discussion about using Git on DH? Well, there are a gazillion GitHub clones out there running on PHP, but nothing beats Gogs. Really (I’ve tested practically everything out there running under PHP). Gogs actually runs as a standalone web server which does not require the Go compiler at all, but you cannot use it under DH shared hosting because it’s not a FastCGI application… oh well.

Anyway. I digress. My point here was just to mention that if more Dreamhosters start using Go on shared hosting, there will be copies and copies of the compiler all over the place, which is not a good idea. I have unlimited hosting, but the servers don’t have unlimited disk space! Having a single installation, kept up-to-date by DH’s tech team, is a far better solution.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.