Hacker Newsnew | past | comments | ask | show | jobs | submit | teho's commentslogin

In Dart if you want to narrow down a nullable final class variable, it is not enough to do

if (value == null) { // value is still nullable here }

instead you need to first capture the value

final value = this.value if (value == null) { // value is non-null }

Swift's guard and if let syntax seems way nicer here. In swift, it's also nice to destructure nested nullable values using if let.

if let value = object.object?.value { // value is non null }

In dart you'd need to first assign this into a local variable and then do the null check which is unnecessarily verbose.


In Dart 3 instead of declaring the variable and then comparing you can simply write an if-case pattern:

    if (value case final value?) {
      // value is a fresh final variable 
    }


So Dart is moving in the Swift direction, which has

    if let value = value {
      // a new binding named ‘value’ refers to value, unwrapped 
    }
or (newer syntax that I initially found even weirder than the older one, but both grew on me)

    if let value {
      // a new binding named ‘value’ refers to value, unwrapped 
    }
(The old version will remain, as it is more flexible, allowing such things as

    if let baz = foo.bar(42) {
      // a new binding named ‘baz’ refers to foo.bar(42), unwrapped 
    }
)


The more you know, I had totally missed this.


You could create a trigger that always keeps the value the same unless user has privileges to change it. Or alternatively the RLS rule could check if the column is being updated and abort the call if it is. I’m using a different table that is read-only to regular users to accomplish this.


I'm working on an app that is running on the latest version of Flutter with Impeller enabled. The performance seems good as long as you do not embed platform views inside a list. However, when you drop even a single platform view (web view, video player, google ads...), the performance drops to unacceptable levels even on the latest iOS devices. This is related to another issue with the Flutter ecosystem, it has close to zero support from third parties and therefore you end up having a lot of these platform views. Even things like Google Ads have no native Flutter support and therefore adding a single ad on a list ruins the app. Reading Flutter issues about the performance related issues is sad as the same issues have been there since the beginning and there is no end in sight.

However, if your app can do without any platform views, the performance seems pretty good.


You might be interested in Compose Multiplatform, it's from JetBrains and is a combination of Jetpack Compose and Kotlin Multiplatform. You can transparently use both platform views and CM views together in a way that I haven't seen in Flutter.

Here is a video about this where the JetBrains employees go over a demo of building a cross platform app in 100% Kotlin, just as would be the case with Flutter [0]. Check out the timestamp 41:37 where they talk about the above interoperability. They have an example of a messenger app where the messages are in CM while the text input box is in Swift, so that this ensures that you are not reimplementing the native text editing controls as Flutter does, so I see that as a clear advantage for specific things like that.

Also see timestamp 51:23 where they talk about graceful decomposition where if you decide to remove CM, you are left with a regular Android app as CM is backwards compatible with Jetpack Compose.

I use Flutter quite a bit but it seems like Compose Multiplatform might be the future, since it has a number of clear advantages due to how the architecture of CM is set up.

[0] https://www.youtube.com/live/IGuVIRZzVTk


That Compose Multiplatform interoperability with the native views and other way around looks really nice, especially because it matches how SwiftUI deals with UIKit/AppKit interop. However, at this point it is hard to say if they will hit very similar performance issues that Flutter deals with as rest of the UI is not native and is drawn with Skia (as done by Flutter before it moved to Impeller for improved performance). It is definitely very valuable feature nonetheless.


Yeah it might be that JetBrains will eventually realize and move to Impeller or write their own renderer like Rive.app has done for their use case.


What kind of performance drop are you seeing?


Flutter apps have god awful performance when there is even a single platform view on the screen. In effect this means that if the app is monetized by ads, have any video, map embed or anything of the sort, it will have sub-30fps and very janky scroll even on iPhone 15 Pro and it really seems that there is no hacks to save you.


That hasn’t been true for over a year maybe two at this point.


It is absolutely true still, it is especially bad on iOS and the worst when you have a ProMotion device. They did hard lock the max fps to 80fps on scrollable elements on ProMotion devices, which really is telling enough but it doesn't solve the very noticeable jitter either.


I'm writing a game in Flutter. The game has ads, shaders, custom gesture detectors, ... . I can tell you, it is absolutely butter smooth on iOS.

I tried something similar a few years ago and I would have said you're absolutely right. But with the one I'm writing now, it is quite the different experience.


Is there any solid proof of this? It seems that Flutter is not used in any notable apps and React Native is used even by the big players in the field. I have yet to see a single high quality app made with Flutter and literally the only app I’m using that is made with it is the one I’m working on. React Native seems massively popular in comparison. It really feels that the stats that show Flutter being popular are not really measuring real life use. The Flutter ecosystem seems especially tiny and it has close to no support from 3rd parties, even Google treats Flutter as a second class platform when it comes to libraries like Google Ads.


> Plus, apparently, they don't have per app notifications, and some are saying that push notifications can be unreliable.

iOS does have per application notification settings. Also apps have to ask permissions to even send them. You can also change how each app's notifications behave. It's also possible to group all notifications from an app or a group of apps to be shown at certain time of a day, all at once. I don't think there's any reliability issues.

https://appleinsider.com/articles/21/11/01/how-to-manage-not...

The focus modes expand this so that you have even more power to control how notifications work at certain time of day (or location etc). Focus modes also apply to all your Apple devices at once.

> iOS apps also seem to often cost a few bucks, despite free equivalents existing for Android. Perhaps because they are more expensive to make, or because they can't rely on a data collection business model, whatever the case pretty much everything seems more expensive.

This has a benefit that there are more high quality apps on iOS than on Android and the apps aren't abandoned as often.


This is also holds true in Finland. UHT milk is sold in Supermarkets but it's not something that people regularly consume. I personally haven't seen it served anywhere in the past decade.


This keeps getting repeated, but I don’t understand how that would lead to it being the most popular OS there is. There is way more embedded systems than there is Intel CPUs on the market and they often run Linux. Android phones are sold more than four times the amount of PCs a year. I’d assume that most Intel CPUs are deployed in the data centers... that run Linux.


but the cpus deployed in datacenters also run minix. even the ones running linux. or windows


Yeah, but the point was that there is without a doubt more Linux instances running on ARM than there is Intel CPUs in total. Then even from the Intel processors that do have Minix, a sizable amount is running Linux. Therefore Minix can’t be nearly as widely used as Linux.


What about the ones that are on fridges?


But they said "widely deployed", not "popular". No one is claiming Minix is the most popular OS in the world.


Upstart was started before sytemd unlike Mir and Unity (in comparison to Wayland and Gnome 3) and it's creator having come in support of systemd[1], Ubuntu's upstream, Debian, going with it and on top of that Shuttleworth already admitting defeat. I have to seriously doub that.

[1] https://plus.google.com/111820116102071851808/posts/4eHMc2tv...


Kaveri is also finnish for a friend.


Friend, yes, but colloquial, so a more accurate translation might be "buddy". To a Finn, it's rather amusing to see it used as a processor codename.


Aver (plural - averi) - means friend in bulgarian too (I'm bulgarian, but more commonly people would use "priatel" or "drugar")


The words may be etymologically related. The word kaveri has two suggested etymologies; the first is that it's originally a variation of toveri (which is more formal; also means "friend", but has a leftist connotation, like "comrade"). The latter is fairly straightforward loan from the Russian товарищ (tovarištš), which is probably closely related to the Bulgarian aver. Interestingly, the ka- in kaveri may originate from the Swedish kamrat, quite clearly related to the English "comrade".

The other hypothesis is that kaveri is from the Yiddish חבֿר (khaver), which is a direct loan from Hebrew.


Thanks! I forgot about tovarish (and russian was the first foreign language I've learned in school).


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

Search: