News for hackers. Stuff that matters.
Re:The State of SwiftUI by contextfree on Monday September 14, 2020 @02:46PM (#24473615)
How can this possibly be true? Web UI frameworks are built on top of the browser platform, and browsers are built on top of native desktop platforms, so aren't native desktop platforms inherently more flexible than web UI frameworks?
Re:The State of SwiftUI by redxdev on Monday September 14, 2020 @02:57PM (#24473761)
Browsers largely aren't taking advantage of native UI frameworks (aside maybe from the window chrome and basic controls). Aside from the minimum required to get an OpenGL context (or whatever graphics tech) onto the screen they don't need to build on native UI.

Sure, they're technically building on top of the native UI frameworks, but only by completely ignoring all of their functionality.

Re:The State of SwiftUI by fauigerzigerk on Monday September 14, 2020 @03:51PM (#24474330)
I am by no means an expert in graphics architectures so I'm sure someone will be able to explain this better and more correctly than I can. But as I understand it, "native" is itself a layered stack of APIs as you can see in this diagram:

https://developer.apple.com/library/archive/documentation/Co...

UIKit/AppKit is layered on top of Core Animation which is layered on top of Metal. Skia, the 2D graphics library that Chrome's rendering engine uses, is built on top of Metal (or at least transitioning to Metal from OpenGL on macOS).

So browsers have the same flexibility in principle as native UI toolkits and they are just as close to the metal. There is no inherent disadvantage. But flexibility is a double edged sword. It includes the ability to diverge from the platform look & feel. So that's where the debate has been raging on for decades.

In terms of performance I think any debate about optimisation of UI stacks pales in comparison to the question of where the data lives, who generates it, and how it gets to the CPU/GPU for processing and display.

Re:The State of SwiftUI by saagarjha on Monday September 14, 2020 @04:00PM (#24474452)
Saying that "both use Metal and have layers in between therefore they are largely at the same place" doesn't really work, because the abstraction layer that they expose is at a vastly different place and the internal pipeline for both is also very different.
Re:The State of SwiftUI by zepto on Monday September 14, 2020 @04:03PM (#24474480)
You are completely correct.

If people want to use web technologies on the desktop, there is Electron.

The converse is not true.

Re:The State of SwiftUI by johannes1234321 on Monday September 14, 2020 @07:32PM (#24476338)
The converse is webassembly+webgl. There are different cases where i.e. SDL-based games are being ported to "Web" also Qt provides WebAssmebly support.
Re:The State of SwiftUI by noahtallen on Monday September 14, 2020 @11:35PM (#24477648)
Right, but only for macOS. I imagine most Swift/SwiftUI development targets iOS, where web is really the only other target available.
Re:The State of SwiftUI by zepto on Tuesday September 15, 2020 @12:17PM (#24483020)
There’s nothing stopping you from using web technologies to develop iOS apps in exactly the same way.

Quite a few of the ‘cross platform’ toolkits work this way.

Re:The State of SwiftUI by pier25 on Tuesday September 15, 2020 @12:29AM (#24477883)
Can you run SwiftUI on Windows or Android?