Remix.run Logo
omgmajk 11 hours ago

I explored the programming language nim a bit deeper for use in game programming with SDL3 bindings, but I came to find out that compiled nim code on Windows often triggers anti-virus because, from what I hear from people, nim is used a lot in malware development currently. Which is a shame because I really like that language. I haven't tested it myself, it's just things I have heard and read. Someone on r/gamedev told me to write the code in nim, generate C code and then compile it with zig cc.

If anyone has any experience with this, please do chime in :)

archargelod 41 minutes ago | parent | next [-]

It's usually code compiled with Mingw that gets AV false-positives in Nim. But, indeed, you can use clang or zigcc compilers instead.

Nim has good support for Clang, so it works by just switching a single flag: `nim c --cc:clang main.nim`

For zigcc - there is a wrapper package you can install with nimble: `nimble install zigcc`

Then you can use it with: `nim c --cc:clang --clang.exe=zigcc --linker.exe=zigcc main.nim`

Of course, you can save the flags in configuration files. You can look at my setup for inspiration [0].

[0] - https://codeberg.org/janAkali/grabnim/src/branch/master/conf...

imadethis 11 hours ago | parent | prev [-]

I don't have any nim experience (sorry!) but I'm also exploring SDL3 with odin. I was able to get a naive battleship clone up and working very quickly, pretty neat. Next step is the new SDL3 GPU API.

omgmajk 11 hours ago | parent [-]

I haven't looked into Odin that much but I hear it's swell, so maybe I should!