I do not have any personal experience with it, but I have heard several success stories for Actually Portable Executables & Nim and there is this to try to ease the path for cosmopolitan libc fans: https://github.com/foxoman/cosmonim/blob/master/README.md
I don’t suppose I could compile a binary that runs on both linux and macos (a la Cosmopolitan)?