News for hackers. Stuff that matters.
Re:Kivy: Cross-Platform Python Framework for UI Development by baybal2 on Monday December 21, 2020 @01:43AM (#25492647)
We used Nativescript in production, and it is unending train wreck.

I advise everybody to avoid Nativescript for as long they self-qualify their project as anything serious.

The ecosystem, and upstream looks really much like the Wordpress plugin world, and is grossly unprofessional.

On the technical side, you will be always struggling with OOM, I/O performance, and the fact that you will be spending MORE time on native code for both Android, and Ios than if you did them separately.

Re:Kivy: Cross-Platform Python Framework for UI Development by hardwaresofton on Monday December 21, 2020 @03:22AM (#25493082)
Would you mind expanding on the OOM and I/O performance issues you ran into? The ecosystem being less than enterprise-grade was known to me, but I did not run into any OOM or I/O performance issues.

Also, did you try either Flutter or React Native afterwards or go straight to native? Did you find them better?

Re:Kivy: Cross-Platform Python Framework for UI Development by yagodragon on Monday December 21, 2020 @05:27AM (#25493635)
Flutter provides an amazing developer experience. Dart is a great and modern programming language and built specifically for the needs of this framework. Everything just works out of the box. It's backed by google, it's completely open source, it doesn't need any native dependencies. It's a better version of Qt,RN, NS
Re:Kivy: Cross-Platform Python Framework for UI Development by hardwaresofton on Monday December 21, 2020 @09:56AM (#25495435)
Typescript fits my sensibilities and desire for expressive type-systems much more than Dart.

Back when I tried it, it also had a much more incomplete ecosystem, though the google marketing machine was in full swing. I remember not being able to even use the sqlite library without actually spinning up an emulator (as in, I couldn't use it with just plain dart). Dealing with generics was actually difficult/painful (as in just something simple like printing JSON). BLoC seemed like a hack and was more complex than I was comfortable with for using at large scale. Maybe it's better these days.

I will take Typescript over Dart all day every day. I would even take JS with all it's warts over Dart.

That said, Flutter I think is amazing because it is probably going to be hands-down the easiest way to write apps that hit a large number of screens. I think Google will get there first-ish (they have a lot of money and a lot of platforms to support).

Re:Kivy: Cross-Platform Python Framework for UI Development by baybal2 on Monday December 21, 2020 @04:24AM (#25493353)
> OOM and I/O performance issues you ran into?

Sure, very simple react and vue apps regularly run into memory leaks upon navigating views, with most memory being leaked in UI part managed by nativescript, and not in the JS logic. NS does not do it's job freeing memory from UI.

The natural JS leakiness gets amplified if a leaked part references any JS object.

Performance suffers whenever any native API gets called from a JS loop, as exporting Java's objects into JS, and accessing them is very resource intensive. The only way around it was to move loops to Java side of the code.

> Also, did you try either Flutter or React Native afterwards or go straight to native? Did you find them better?

Flutter is not much better, though feels to be a bit more professionally done. It's too a memory hog, it's too a CPU hog, and it's still gets way more issues over a native app to warrant its use just for economic reasons.

RN also shares the same Java-JS interop issues as NS.

Re:Kivy: Cross-Platform Python Framework for UI Development by hardwaresofton on Monday December 21, 2020 @09:52AM (#25495401)
Thanks for explaining more, appreciate it and hopefully others will find this as useful as I did.

> Performance suffers whenever any native API gets called from a JS loop, as exporting Java's objects into JS, and accessing them is very resource intensive. The only way around it was to move loops to Java side of the code.

One of the gotchas around nativescript (and react native) was that trying to do intensive calcuations was never supposed to happen on the main thread. Nativescript was first to add support for background workers[0] which alleviate this.

I do believe of course that you found CPU intensive tasks/looping to be slower on the JS side of things though.

> Flutter is not much better, though feels to be a bit more professionally done. It's too a memory hog, it's too a CPU hog, and it's still gets way more issues over a native app to warrant its use just for economic reasons.

This I'm somewhat surprised to hear, I thought it would have been way better on the memory side of things since Flutter is essentially a rebuild-the-world approach.

> RN also shares the same Java-JS interop issues as NS.

This is inline with what I expected -- the thing about RN when I tried it was that it just didn't have the ability to access native objects from JS as if they were JS objects. Maybe that's changed since I last tried it.

[0]: https://docs.nativescript.org/core-concepts/multithreading-m...

Re:Kivy: Cross-Platform Python Framework for UI Development by baybal2 on Monday December 21, 2020 @07:00AM (#25494101)
> The natural JS leakiness gets amplified if a leaked part references any JS object.

* The natural JS leakiness gets amplified if a leaked part references any Java object.

Re:Kivy: Cross-Platform Python Framework for UI Development by Apocryphon on Monday December 21, 2020 @04:46AM (#25493445)
What kind of app was it?