Hacker News new | ask | show | jobs
by jasonjei 3744 days ago
I agree. I think it's cool that somebody is trying to create a JS API runtime for Win32, but the same criticism for using RubyMotion to build iOS apps applies. It ends up feeling too unnatural and stressful to use, with an extra dependency you have to rely on for support.

I believe that using Win32 API in C/++/# (maybe one day with Go if all the OS functions are mapped) is much more natural than forcing yourself to do it in JS. A lot of the Windows APIs still require you to manage some memory (I'm not sure how much is abstracted in C#, but if you are doing it through DllImport, Win32 will still expect you to free memory if you are using OS API functions as it was designed for C).

On top of that, you will spend a lot of effort trying to box/re-package documentation intended for the C/++ (ATL/MFC/WTL/etc) or C# (WPF) audience. This is probably the greatest cost. In the end, I suspect NativeScript code looking a lot like the C equivalents. Consuming third party libraries written in unmanaged code is likely to produce very ugly code.

I tried using RubyMotion a long time ago for iOS development. All of the sample code I found was in Objective-C, and I pretty much spent most of my time rewriting the code in Ruby, or parsing docs in ObjC and figuring out the Ruby way to do things. In the end, it was simpler to just do it in ObjC.

Writing the app in a SDK with a lot more support is just much better. Your sanity will thank you. And if you are writing cross-platform code, C has endured the test of time.

1 comments

NativeScript is targeting UWP, not Win32/WPF. The UWP API's are way better and C#, C++, and JavaScript are supported out-of-the-box. But if you go the JavaScript route, only HTML is officially supported for UI. You can get native-looking widgets using WinJS, but the XAML framework is the real deal. XAML sits directly on top of DirectComposition, so no DOM\Webview.