As far as I know, that should be doable. Nim can compile to Objective C as well as C++, and has a `when` statement that makes it easy to produce code for a specific OS or language target. Not an Xcode or .NET expert though, so not sure how difficult it is to hook into those platforms.
Sounds great! What about debugging? I understand that Nim compiles to C/C++ so I am curious if I can use Xcode on a Mac and Visual Studio on Windows to debug the generated C/C++ code.
Considerations like these have lead me to Nim. I don't have it working yet, but the vision is that if I constrain myself to a simple enough UI then I can then compile the same code to Objective C for iStuff, C++ for Android and desktop, and Javascript for web. Those apps can each then evaluate arbitrary nimscript in a platform agnostic way. I've log ago forgotten what the app I wanted to build was, but if I remember it, nobody will be able to stop me from running it anywhere. I hope.
Never even gave Nim a thought. Just read some and now I think I will try a little pet project with it. Really looks very interesting. I am wondering how the C, C++ , Objective C and JavaScript from one compiler works. personally I never want to touch JavaScript but it might be interesting how this works.
As the others have said it should be possible. Nim is already pretty good at cross-compiling, but it is also able to just spit out the C files it generates and allow you to play with those.
Nim uses C/C++/Obj-C as a sort of abstracted assembly. While it's possible to follow the generated code with some formatting and effort, it's made to be optimally machine-parsable and optimizable. I suggest giving Nim a try and checking out the generated sources to see for yourself.
reply