Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

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.


sort by: page size:

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.

Congrats to the team!

Could Nim be used to generate a framework for Xcode and the the same code be used in a Windows C++ or .NET project?

I've been looking for ages for a cross platform solution that can be used to create dynamic or static libraries that isn't C++.


Nim compiles to C, C++, Objective C as well.

Yes, Nim is cross-platform.

It also targets C, C++, Objective-C and Javascript, making it possible to run on platforms where using C is not the preferred choice.


I'm excited to see a high-profile project like this in Nim :)

Any challenges with getting Nim on mobile? Do you compile to objective-C for iOS devices?


In that case Nim should make the cut since it transpiles to C, C++, Obj-C, and JavaScript. :)

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.

I've seen it done. Since Nim compiles to C the process of getting stuff running on android or IOS is more or less the same as with C.

AFAIK Nim can use C and C++ libs so yeah, in principle you should be able to produce a cross platform GUI.

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.

Nim generates C, C++, Objective-C and js - so yes, you can target Android and iOS

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.

If you provide a C library then it'll be super easy to add Nim support!

Nim compiles to C, so you can use any existing C toolchain to generate a native executable for whatever platform you care about.

That's a big advantage over Rust, D, OCaml, and similar languages without this feature.


Nim seems like it would do well, since you can just compile to C code.

FWIW, I've made a very-early-alpha thing for making cross-platform apps with Nim: https://github.com/iffy/wiish

For what it's worth, wrapping C++ in Nim is pretty trivial so you could use this fairly easily with Nim.

Well, Nim compiles to JS and cross-compilation to iOS and Android are both possible (I don't know how tricky those last two are).

So you could write your entire stack in Nim too the same way you do with TS. :)

next

Legal | privacy