A lot of the tooling around Gotham is inherited from Hugo. There’s many decisions that they’ve made that aren’t easily accessible. This can make it difficult to determine why something was used or why something was done in a certain way. I wanted to have a quick discussion on Mage and see if this is something we should continue to use, or to switch to using Make and a Makefile.
Make
Make has been around for awhile and is sort of an unofficial standard. Many, many projects of all sorts of languages use Makefiles in order to build their source. For GNU’s release of Make, you can find more information here.
Mage
Mage was created in 2017 as a Rake-like alternative to Make. The idea is that instead of a Makefile
, you have magefile.go
. It serves the same purpose but written in Go, the same language that your project would be in. Their website can be found here.
Make vs Mage
So what do we do for Gotham, keep using Mage or switch to Make?
Switch to Make
Here’s why I think we might want to switch to Make:
- It’s not written in Go. This may sound like a con for Make instead of a pro but I don’t think so. The fact that Make is a standalone tool that works with multiple programming languages is a positive to me. It’s a tool you can learn once and use across various projects. Mage has to be used with Go projects only.
- Related to the previous point, Make is more well known. It’s more likely that incoming contributors will already know it. This means a lower learning curve for devs new to Gotham development.
Stay with Mage
- Hugo, Gotham’s upstream project, already uses it. It’s less work to simply stick with what we have. Not just the work to implement Make, because I don’t care about that. The work dealing with conflicts if and when Hugo updates their Mage file.
- Better integration with core Gotham code. Since Mage is written in and uses Go, this provides 1st class integration with the actual source code of Gotham.
- Make isn’t a native tool in Windows. Since Mage is Go, and thus compiled on the local machine, it can work on Windows the same as it would on Linux or Mac.
Thoughts? I can be swayed, but I am slightly leaning towards sticking with Mage. Not only does it have more pros than Make in this post, but point 3, the cross-platform capabilities, is the most useful thing I think we can get from these tools. While we don’t provide Windows binaries right now, we will soon. If we can make it easy for Windows devs to contribute to the project, that’s a great thing.
cc @chayev