The HG code is written in .net and works with mono which makes it run the same on any platform with mono support. Currently there are several precompiled versions for different platforms available on SourceForge (Windows, Raspi, BananaPi, etc). With the proper knowledge of your target environment, you should be able to get it running on others too.
Wibo's guide should help you get an compiler set up in Windows such that you can start compiling from source and tweak the code as needed. If you are just looking to write code for within HG rather than modify the source, you can use the built-in compiler in the web interface.