Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How is Nim for mobile development?


It isn't. And it would be hard-pressed to be, since there's no JVM backend. It could work on iOS via the C target, but you're probably better off with Swift. It could work in the browser via the C target and emscripten, but again, you probably don't want to go through so much trouble when you could just use C++. There's a JS backend, but at that point you're better off with TypeScript.


You can do Android with the C backend, but that's through some Java interop hackery, and there isn't anything in the ecosystem that would make Nim attractive for mobile development


> that's through some Java interop hackery

Honestly - you don't want to go there. Really. The JVM is known for a high cost for native calls, and JNI is pretty painful to write for in the first place. The Android NDK doesn't provide native equivalents to application-level APIs and concepts. You, technically, can make an app with a GUI in C for Android, but as I said: unless you're a masochist and enjoy the pain, you don't want to do that :)

As an aside: Tizen uses a GUI framework written in C - EFL - and it can be accessed from native and JavaScript code. I'm actually not sure how the JS APIs are mapped to the underlying framework's, if at all, but theoretically it shouldn't matter (other then what's expected between C and JS) whether you use native or JS for your apps. Unfortunately, Samsung is unable to replicate Google's level of development and (even more painful) documentation (maybe unless you're fluent in Korean). This made the transition to Android/Wear OS for new Samsung watches a welcome change, even though Tizen was arguably better in its design and some capabilities. I haven't checked recently, but I think Tizen is basically dead at this point - some smart guys at Samsung will have a blast playing with systems-level programming, but external developers will stop even considering writing for it. A pity. It was an interesting design.


It has Android support, but no wrappers for anything you'd actually want to do. Some successful Android builds of things like Raylib games with the Naylib wrapper exist, but nobody's really doing anything.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: