First of all, thank you to all the amazing things you do for the self-hoster, FOSS comunity ! We won't be able to have those shiny things without you ! I'm not a dev and have just played arround with python (and I know how most of you feel about it 🤫) so I have very limited knowledge regarding programming languages.
I know whats a low level language (C, C#, rust?), general scripting tools and even heard about assembly. And it always baffles me how all those coding lines rule and make our microchips communicate and understand each other, but that's another story ! This is about golang !
As a self-hoster enthousiast, when I'm looking at a github repository, I always check the programing language used, even though I have no idea if those integrate well with each other or if it's the best programming language for that kind of application.
And everytime I see golang, It makes me smile and have a feeling it's going to be a good application. I know it also depends on the programmer skills and creativity, but all my self-hosted Go apps works like a charm.
Traefik is the best example, I never had any issue or strange behavior, except for wrong configuration files on my side,
Or navidrome a music server compatible with subsonic, also written in go, is working great and fast AF !
Or Vikunja, the todo app... and many more !
I'm probably biased because I have no idea of how the programing realm works, but I have the feeling that Golang is a certificate for good working and fast applications. Just to bad it's backed/supported by google (uuhhg)
Feel free to debate and give me your personal opinion of the Go language, if my feelings are right or Am I just beeing silly :).
I am a dev and I concur. I’ve also noticed golang projects are more likely to be good quality compared to projects written using most other popular languages
As to why that is.. well, all I can really do is compare languages on their details and make some kind of speculative guess at the sociological implications lol
I don’t see golang frequently picked for use in your stereotypical “enterprise business factory REST microservice” project. Typically it’s like, for infra projects. At least in my experience. So that probably has a lot of downstream impacts on our perception of quality. Hmm
In short when a program runs, it allocates memory for the data it is using. Then the garbage collector which you can think of a 'program' (though not in a strict sense, just a part of the runtime), takes care of freeing the memory which is no longer needed. In languages with manual memory management, like C or C++ it is up to the programmer to properly (de)allocate memory, which might result in issues like dangling pointers (references to already freed memory, which might cause unpredictable behavior and compromise your whole system's security) or memory leaks (gradually increasing memory usage over time in absence of user action that would prompt that, like e.g. opening more and more browser tabs, which is also partly why in the past you've often had to restart your PC every once in a while to free some trashed memory. In Go most of the stuff is done by GC and only code that uses the unsafe package or relies on external resources, like reading a file or database connection needs to have programmatic termination of access to these (usually by calling something like defer db.Close() ).
Also Go is a nice balance between low and high level, one of such examples is the use of pointers. They might be complicated for most beginner coders, but in reality there is seldom any use of uintptr, double pointers and even slice (list) pointers, but it has a tremendous performance amount since when you do some operation, especially loops where without a pointer you would copy the data you're iterating through by value instead of just it's memory address.
Which is especially important with large sets of data, where 160 bytes might seem miniscule with one call, but if you loop over 1 million records, that's 160 MB (for example in some database used by municipal authorities of a large city). That's one of the reasons some databases like CockroachDB were written in Go.
As a developer whos had python and rust web applications in production, golang is an almost perfect balance between complexity and power. Its simple enough for anyone to learn (yes you!) yet powerful enough to build large, performant programs. It also has an amazing model for concurrency which is basically multitasking.
The reason lots of networking applications use it is because networking requires a lot of this multitasking and demands efficiency. Part of the reason they tend to be built well is that every funtion that might have an error requires you to explicitly handle it or ignore it. Also the syntax is very simple relative to other languages, so you dont often get cryptic, hard to understand code.
Golang also compiles to one nice executable rather than requiring the host system to have certain files/programs so more time can be spent on the code rather than the deployment.
It of course has it's rough edges but I think it's underrated.
The reason lots of networking applications use it is because networking requires a lot of this multitasking and demands efficiency.
So that's one reason why traefik devs chose golang ! Good to know :)
Its simple enough for anyone to learn (yes you!)
Haha, If I had enough time I would probably chose Go and Rust. But hosting, networking and linux stuff are already taking way to much of it ! IMO if you haven't learned any programming language early, it's going to be a nightmare to follow up. Also, I'm already struggling with English xD !
If we're making a list of great projects written in Go, I'm putting in a word for PocketBase which is a based around sqlite that works as a backend-as-a-service and does all the tedious auth work for you. It's the perfect sideproject backend.