I found LLVM-MOS on Github. This would theoretically enable all LLVM languages to be compiled to MOS 65xx devices like Apple II, C64, NES etc. But this doesn't seem to be that simple. Only C, C++ (Clang) are supported. And Rust project seems to be abandoned two years ago.
We can expect only C and C++ to be supported on LLVM MOS. (broad C99 and C++11 freestanding compatibility )
And both of those languages are not suitable for beginners.
But Nim can compile to those languages. And NIM is beginner friendly with ORC/ARC and can Run without running GC on a thread. And Nim also seems to run on GameBoy, so it should be able to run on all these MOS 65xx devices with the LLVM MOS compiler.
So, Nim is a good language for targetting retro MOS 65xx devices. So, this can attract Retro fans that don't want to do C, C++ and manual memory management etc
I would also like to mention that MOS 6502 is still alive and well as a chip. It's still being produced and used in many products. It even seems to be used for teaching embedded development in some Engineering colleges.
But the problem for me is libraries. I assume using Nim on these devices wouldn't be plug and play. And C is voodo for me. If the community members feel this a worthy of their effort, I hope they can make libraries/warppers or tutorials for easy Nim developement on these devices.
LLVM-MOS https://llvm-mos.org/wiki/Welcome https://github.com/llvm-mos/llvm-mos https://github.com/mrk-its/rust-mos
Nim on GB https://github.com/ZoomTen/pocket-clicker https://github.com/ZoomTen/nim-gb-test
Nim on GBA https://github.com/exelotl/natu
More of this kinda stuff would be interesting to see, but I am not quite confident yet with the hardware of any of those machines to give it a shot myself at the moment.
There already exists dedicated C compilers for 65xx such as SDCC and CC65 — in fact, you may use my Pocket Clicker project as a jumping off point, since GBDK also has libraries for the NES. YMMV however.
In my experience, I think not only would libraries be a problem, you might also fight a little with both Nim and C compilers and adjusting either your Nim code or nimbase.h accordingly. I did notice a few instances of cpu8 mentioned/reserved in Nim's compiler code, but haven't found a way to expose them yet, or think of a good way to "integrate" it if I were to suggest additions to the compiler.
CC65 is an old compiler and doesn't support C99.
You can cross-compile using LLVM-MOS and have a lot lot lot faster compile times and also get all modern compiler optimizations of LLVM.
Do you mean Nim doesn't have out of the box 8-bit CPU support? If that's the case then, it is indeed a problem.
Well you do need to "hack" the compiler anyway into accepting weird use-cases somehow, and there's only so many platforms that Nim can realistically support…
At least GBA has the benefit of being ARM-based, and ARM devices are still widely used today.
Nice that you found that one niche where Nim excels at while the rest of us mere mortals only use it for scientific computing, OS development, crypto currencies, games, compilers, web services, scripting... Can you now finally use Nim in good conscience? Ah no, here we go...
Do you mean Nim doesn't have out of the box 8-bit CPU support? If that's the case then, it is indeed a problem.
It has good support for 8-bit CPUs, but then you sometimes cannot use some libraries on a 8-bit CPU like JSON so better keep procrastinating.
Also, the reason I can't use Nim is not becuase I'm being an *****, but because I'm too stupid. I usually rely on libraries others make.
You are neither but you should try to program in Nim what you previously did in Python. Now of course the lack of libraries might be a problem but there are Nimble packages out there that allow you to use Python libs with Nim. But if game programming is your thing, there are plenty of libraries for that too, just explore the Nimbleverse.