News for hackers. Stuff that matters.
Re:Electron 7.0 by Razengan on Thursday October 24, 2019 @01:38PM (#21347044)
I'd rather see SwiftUI or something like it ported to other systems with a "driver" that translates it to each platform's 100% native UI.

It's already amazing in how it abstracts common elements for such distinct environments like desktop, phone, TV and watch while still exposing OS-specific features. Why not other operating systems?

Re:Electron 7.0 by scrollaway on Thursday October 24, 2019 @01:45PM (#21347151)
Insert any framework in place of SwiftUI. You're describing Qt, essentially.

The approach has been tried, and succeeded to some degree. But the web is the only app where cross-platform is the default, and it's truly hard to avoid it. Even if the widgets all look different. Even if nothing looks native (people got used to it anyway).

And to be clear I want the status quo to improve in this regard, especially in terms of accessibility (nobody should have to reimplement eg their own dropdown especially if it breaks eg. keyboard shortcuts, mobile UIs and so on). But I can't see anything from today that isn't either a web technology, or web-compatible (and web-accessible, not the Qt webgl hack that's on the frontpage right now) making it in the long term.

Re:Electron 7.0 by coldtea on Thursday October 24, 2019 @02:42PM (#21347804)
>Insert any framework in place of SwiftUI. You're describing Qt, essentially.

Only Qt never had the funding or resources or will to get native UI right.

Their non-native widgets are always off, in a way that even Electron, is not (because it being web-based means it at least follows familiar conventions for all web users, where a mimicked native GUI enters the uncanny valley).

There are also custom native but not platform-native (meaning close to the metal, no web-based) GUIs like Adobes, Fruity Loops, and others, that look good on all platforms and users have no issues with them.

Re:Electron 7.0 by blueprint on Thursday October 24, 2019 @02:06PM (#21347364)
> But the web is the only app where cross-platform is the default

That's just because it describes its own embedded rendering system.

Re:Electron 7.0 by Razengan on Thursday October 24, 2019 @02:11PM (#21347410)
> Insert any framework in place of SwiftUI. You're describing Qt, essentially.

SwiftUI's syntax feels closer to a markup language than code, though, so it might be more appealing to web frontend devs.

Re:Electron 7.0 by bryanlarsen on Thursday October 24, 2019 @02:21PM (#21347541)
QT Quick also uses a markup language.
Re:Electron 7.0 by kick on Thursday October 24, 2019 @02:25PM (#21347586)
Not a good or reasonable one, though. This is no slight against Qt devs, and I think they're fixing it in Qt6, but it's just not good.
Re:Electron 7.0 by inferiorhuman on Thursday October 24, 2019 @03:21PM (#21348239)
QML is basically javascript with some syntactic sugar. I loathe javascript as much as anyone but that's not dramatically different from Electron.
Re:Electron 7.0 by kick on Thursday October 24, 2019 @03:57PM (#21348563)
I didn't claim Electron was good, either.
Re:Electron 7.0 by bb88 on Thursday October 24, 2019 @02:17PM (#21347485)
>But the web is the only app where cross-platform is the default

No. Chrome is the only platform that is cross platform by default. But IE, eg, has definitely had behavior differences in the past.

On the other hand, Qt is cross language, but not necessarily cross platform (it excludes iPhone and Android, say)

Re:Electron 7.0 by adev_ on Thursday October 24, 2019 @03:21PM (#21348241)
> Qt is cross language, but not necessarily cross platform (it excludes iPhone and Android, say)

Qt supports Android and iPhone.

Re:Electron 7.0 by saagarjha on Thursday October 24, 2019 @04:32PM (#21348850)
Chrome is not the only web browser out there.
Re:Electron 7.0 by luckydata on Thursday October 24, 2019 @01:50PM (#21347207)
I don't. The reason is UI kits on different OSs are so different that allowing this stuff makes for haggard looking apps. Using the web at least brings consistency to the experience. There's no workaround I can think of, you either write one UI per OS (even with QT you still need to adjust for conventions, spacing etc...) or you make an OS agnostic UI with Web tech.
Re:Electron 7.0 by Razengan on Thursday October 24, 2019 @01:52PM (#21347227)
> (even with QT you still need to adjust for conventions, spacing etc...)

That is what I'm talking about: SwiftUI automatically uses the recommended conventions for spacing, padding, etc. which are different for macOS vs. iOS etc., and it also takes user environment settings into account, like font sizes and other accessibility options.

Re:Electron 7.0 by big_chungus on Thursday October 24, 2019 @08:02PM (#21350430)
It can do this only because Apple exercises such tight control over all platforms. When everything is developed under the same roof, it is significantly easier to make it, "Just work." On the other hand, making three, independently-developed platforms look the same is nearly impossible. On a windows or linux box, you cannot guarantee things like screen resolution, ppi, dimensions, specs, compatibility, and the innumerable other things that cause trouble.
Re:Electron 7.0 by Razengan on Friday October 25, 2019 @12:49AM (#21351994)
There are almost no technical reasons, only political, for why we don't have a truly cross-platform, truly native UI framework by now.

The whole situation is bizarre and comical if you look at it from a distance:

Everybody ALREADY puts tremendous effort in making sure things look and work the same everywhere: Browsers!

Not just Apple, Google, Microsoft and Mozilla, but the thousands of third-party maintainers (like yes Electron) in this newly-created circle of Hel that is the JavaScript ecosystem.

And now we're trying to turn the browsers into operating systems!!

Everyone keeps trying to reinvent a wheel that doesn't travel very far to begin with (see all the missing features from web apps that native apps get, being discussed on this page.)

Re:Electron 7.0 by luckydata on Thursday October 24, 2019 @04:42PM (#21348940)
I don't think it's possible to do it in a way that consistently looks good. I've been around my fair share of cross platform frameworks and worked at companies that built them commercially, they never work beyond apps that aren't supposed to look great.
Re:Electron 7.0 by jcelerier on Thursday October 24, 2019 @05:12PM (#21349227)
Qt does that, too, but that is not nearly enough if you really want to make pixel- and interaction- perfect things. A "native" macos app is fundamentally different from a "native" windows app. Dock vs systray, different usage of menus, mouse and keyboard. Different widgets - Windows does not use baloon widgets and sheets. etc etc...
Re:Electron 7.0 by Razengan on Friday October 25, 2019 @01:06AM (#21352064)
> A "native" macos app is fundamentally different from a "native" windows app.

The visual and interactive differences between a macOS app and a Windows app are actually less stark than the differences between a macOS app and a watchOS app (crown) or a tvOS app (remote), but so far, despite its early bugs and limitations, SwiftUI does a great job of outputting the native controls on all [of Apple's] platforms.

Things like NavigationViews and TabViews produce different beasts on macOS, iOS, iPadOS, and tvOS, from the same code.

See WWDC 2019: SwiftUI On All Devices: https://developer.apple.com/videos/play/wwdc2019/240/

Re:Electron 7.0 by hnbroseph on Thursday October 24, 2019 @02:46PM (#21347851)
Unfortunately swift doesn't have a meaningful windows story, and giving up on 100s of millions of users is less than ideal for most "crossplatform" contexts. :/
Re:Electron 7.0 by Razengan on Friday October 25, 2019 @04:47AM (#21353047)
Swift is open-source at least, and I expect/hope SwiftUI will be too once the "secret" Swift features it relies on, have matured.

So even if Apple doesn't want to port SwiftUI, maybe other people could.