Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework.
Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework.
Unlike things like react native you wouldn't be actually using the native components necessarily unless you can implement the UI frameworks components in terms of them. Otherwise they would need to be written from scratch.
It looks like the bear is in keeping up with all the platform updates all the time though.
There are tons of existing cross-platform UI frameworks (Qt, wx, libui, JavaFX, TornadoFX, ...). The comment above says "Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework."
And yet people are still wondering why Electron ends up being the technology of choice for so many desktop apps.
probably because of the large number of JS only developers.
Guess what, what in most of them I never had any issues to center elements, or create fake UI elements out of list items.
Also layout managers were already a thing back in 2000.
Main difference is that HTML has affordances to size elements "upwards" whereas in other toolkits you need to do this manually (e.g.: estimating text size is a thing, in html you don't need to care about this)
Now, this also encourages original layouts which are untrue to platforms which is not a good thing imo.
Yet, they don't.
JavaScript is popular for pragmatic reasons (a.k.a. "it delivers results"), so is PHP. They aren't the best languages, but developers who choose them aren't simpletons who can't code in other languages.
I work primarily in JS and PHP.
They are both deeply, deeply flawed (though I have learned to love JS's good parts, while I still hate PHP).
I have programmed in many languages - Java, Python, Scheme, and Bash are all ones I've worked in professionally, and I've spent plenty of time in Emacs Lisp. This doesn't touch on the ones I've tinkered with for fun.
JS and PHP are not the best languages, but they work, they're everywhere, and they're usually what your client already has in place.
Changing languages rarely delivers any actual business or end user value.
So, I work in what the client has.
JS will long outlast PHP, because it's such a massively deployed language and browsers can effectively never remove support for it.
PHP may slowly die out, since it's strictly on the backend, where you can choose your language.
JS is eternal.
How are you using it?
I have spent far too much time on HN recently in related discussions.
Having access to libraries like React and its huge ecosystem is a big plus for productivity (example vs. Qt at https://news.ycombinator.com/item?id=23154315).
Building custom UIs is also very easy with the flexibility that HTML provides (https://news.ycombinator.com/item?id=23164595), even though it can be done with other technologies (and there are some examples of that).
Qt is pretty good but QtQuick can be fairly barren in some areas i.e. if you want a embedded spreadsheet you're out of luck unless you make your own.
Hey, have you checked out https://github.com/ec1oud/spreadsheet.qml?
Creating a good cross-platform
GUI framework is probably harder
than creating a good cross-platform
language.
Way way way way way harder, I'd think. It's basically never been done in the modern era. All the successful ones from the past look (and work) like garbage on a modern desktop computer (I use gnucash for my dad's business, ha ha).SwiftUI is an interesting re-think, though, and as a Windows 10 user, I can tell you that the current "native" experience sucks green potatoes. There are like 9 or 12 different UI technologies I must interact with each month. All with different text sizes and massively inconsistent UI paradigms.
So I think there is an opportunity here.
But, I bet SwiftUI → Web will come first. And if that happens, SwiftUI on Windows, and desktop Linux, will be a no-brainer and will happen.
And if it doesn't happen, then probably SwiftUI won't matter outside of the Apple ecosystem, and that will mean Swift won't matter much in the end, either. (EDIT: I don't mean Apple need do this and I don't expect they will. But SwiftUI is just an API; anybody could port it to whatever environment they want, and there are already some nascent third-party efforts to implement it for HTML/web.)
Full disclosure disclaimer: former NewtonScript programmer
Also never been really tried, except by second tier companies with small recourses like Trolltech/QT, or even smaller open source attempts like Wx.
Then when RIA was a buzzword Sun/Oracle tried to modernise Swing without success. Today the only big Swing apps that I know are Netbeans and maybe IntelliJ (but I think that IntelliJ has tons of customisations on top of it).
So is even hard for a big company too. I guess the problem is that the framework will be always behind the OS, and you need to recreate all the styles or to create a thin layer with the common denominator between platforms.
Is interesting that different approaches to cross-platform UI (draw all vs thin layer) goes back to Smalltalk. AFAIK the idea of Swing drawing all the UI came from VisualWorks, while the thin layer of SWT came from IBM VisualAge
Swing was ill thought from the beginning. Over-engineered, too complex, slow (as if there were 2-3 layers between the code and the drawing engine), and looking bad in every platform...
>So is even hard for a big company too. I guess the problem is that the framework will be always behind the OS, and you need to recreate all the styles or to create a thin layer with the common denominator between platforms.
I'm not so sure that's a problem. You can always look different than the OS, and do a good job at it. Millions use the Adobe Creative Suite, Cubase, Pro Tools, StudioPro, etc, and their non-native UI is the last thing they complain about...
Heck, even Electron apps do that. Why wouldn't users like apps that look different from the OS, the way Electron apps do, but with far less memory usage, much speedier drawing, and better integration options with native widgets when needed?
Instead of providing the same UI that works badly on every device, SwiftUI interprets each concept differently according to the platform.
For example, a Toggle in an iOS and iPadOS app looks like a on/off switch, while on macOS it's rendered as a checkbox. A Picker has is scrolling wheel on iOS but it's shown as radio boxes or a drop-down menu on macOS.
Navigation is also the same. On iOS, a NavigationView offers the drill-down navigation common to iPhone apps, while on macOS it creates a split master-detail interface.
Each implementation does so by using the native UI framework of each platform under the hood, UIKit on iOS, and AppKit on macOS. I don't know how UI development works on Windows, but my speculation is that a SwiftUI implementation would work the same way.
1. Native feeling, but sufficiently inflexible that only very simple, common UI patterns can be implemented
2. An “uncanny valley” native ui, where things are almost native but often feel wrong in subtle ways
I think that’s why Electron has succeeded where so many cross platform UI frameworks failed: it’s so obviously not native that it doesn’t fall into that “uncanny valley” anymore
The way they have implemented it for even their own "cross-platform" needs (where the "platforms" are really basically different versions of the same OS) works very well — the sickening, jaw-droppingly awful apps from Twitter, JIRA, etc that use the "Catalyst" system of porting iPad apps to Mac shows why the approach is really necessary.
(Those apps bring iPad metaphors to the Mac, so what should be a single interaction, picking something from a menu, is a jarring series of taps, swipes, and animated fuckery.)
If that "render the concept using the OS's native widgets" approach was necessary even for cross iOS-macOS apps, it will be even more necessary across Mac and Windows, where a lot of the UI conventions are wildly different, and sometimes literally the opposite (e.g. the standard placement of buttons).
And it's obviously the only way it could work for web apps.
That being said, my experience with SwiftUI users is that they don't like it because it is so different from the standard Mac experience (props and re-renders and state...). And the documentation is poor (IMO has been Apple standard from MapkitJS to iOS Swift documentation to SwiftUI) which leads to a negative dev experience. Try finding what causes a component to re-render in SwiftUI vs React. If you find it great and please post it, but it's not easy to find in my simple research.
In fact, most of the time I found myself staring at a “type too complex, add annotation” error. That one doesn’t actually mean your type is too complex, it just means you’re passing the wrong thing somewhere and instead of a useful error message the compiler just gave up and broke.
You can change state without all the annoying purely functional programming stuff ([... previousState, newValue]). Just change it.
You can change a prop passed in and even pass a new value up to the parent. So you know the pass a function down so the child can change a value in the parent? Just pass the variable you want changed down with @binding.
If the SwiftUI code were opensource it would be much more pleasant - I could paw through the code if I needed to, file issues, and so on. But the whole experience compared to writing typescript with VS Code is shockingly bad. With the preview open Xcode sometimes stutters so much that it misses key presses - so I’ll type a function name and it’ll come out missing letters, because apparently I wasn’t typing slowly enough for my $3000 computer from 2016 to keep up.
That Xcode gets trounced in developer experience by vs code - an IDE running on electron - is really a testament to the work Microsoft has put into performance. And it should be hugely embarrassing for Apple.
They used to release things where you see they put a lot of thoughts into it. Now they are half baked. This isn't so much a problem on Apps ( The Product ) where it is constantly being updated and tweaked. But with code you have the hassle to try and keep up. And the pace of improvement is very very slow. To put things into perspective, Swift UI has been development for 4 years. Not exactly the state of things I would like it to be.
Apple also isn't dogfooding much with Swift. And I think that is great. In many ways I starting to feel Swift is like Dylan [1], it is new, it is exciting, and it is fun. But somehow after nearly 6 years Objective-C stills feels better. The syntax may still be god damn awful, but it is small enough to be called elegant. While Swift felt like C++ with better Syntax.
[1] https://en.wikipedia.org/wiki/Dylan_(programming_language)
That's because it didn't have a stable ABI until Swift 5, released last year. Now that it does, a lot of their iOS/iPadOS apps have been rewritten, at least partially but sometimes fully, in Swift; this includes some of their Catalyst apps on Mojave and Catalina.
The only app I know for sure to be fully written in Swift, thus far, is the Apple Developer app (previously called WWDC), but I know there are others (they were mentioned in last year's WWDC sessions).
> Swift UI has been in development for 4 years
I must have missed this. Where did you hear this? I'd love to see more info about that.
Chris Lattner said in one of the pod cast, I think it was Accidental Tech, where Swift UI started before he left Apple. Since that was 3.5 years ago, Swift must have been close to 4 years of work.
This experience is shared by basically nobody? I used to love Objective-C, which was unusual even before Swift, but I would not in a million years switch back to using it. Swift is so much better in every single way.
Swift really is much more readable than Objective-C, too.
Swift is absolutely less readable than Objective-C. Objective-C is known for its verboseness, which makes it easy to read. Swift has all kinds of easy ways to make it less readable, like the question mark. There is no way one can objectively argue Swift is more readable than Objective-C.
Windows, Android, and the web, constantly changing so that there's never really been any sense of stability, blind a lot of developers to the fact that good design is both functionality AND looks.
When people complain about designs of controls being out of date, they don't only refer to looks. They refer to how they feel, behave — or more succinctly, don't correspond to the expectations set up by the rest of the system.
To reduce the debate down to looks vs. functionality is reducing things down to the wrong level, missing the forest for the trees, and ignoring the user — a person who often isn't able to express what they need but knows what they want, not often realising that they're the same thing.
Depends on your audience.
When flutter for desktop lands into beta I think it will pick up even more pace and would be very hard to ignore for a lot of companies.
But Swift doesn't run on Android, does it?
Swift is a programming language created by Apple, it's been cross-platform for a while but is now going to be officially supported on Windows. Swift is Apache licensed.
SwiftUI is a UI framework created by Apple for the Swift language, it's only available on Apple platforms, and it's proprietary.
Swift looks to be Apache licensed. I'm fairly confident SwiftUI wouldn't have a commercial license, which is a major topic with using Qt.
Here is a Qt C++ example:
QString str = "/a/b/c/";
auto parts = str.split('/');https://en.wikipedia.org/wiki/List_of_language_bindings_for_...
For what it is worth I can't see anyone mentioning mobile and however weird this sounds, for me at least cross platform always implicitly meant across desktop platforms.
Cross platform on mobile never really happened, thanks to Steve Jobs, and I am kind of happy for it so far.
In what concerns work, we use a mix of mobile Web, Xamarin, Cordova/PhoneGap, C++ with native views, depending on the customer requirements.
But if you want to go to actual cross-platform-beyond-desktop, Qt is still massive on other devices. From cars to TVs to smart fridges.
Kotlin + TornadoFX + native-image (if it is supported) sounds like a pretty comfortable to use UI stack.
Not really. I'm sure there are plenty who will just stick with Qt based options or even Electron.
I've seen a lot of stuff built in PyQt by people who aren't strictly developers and who learned Python only because it fits with some other aspect of their job. There isn't a lot to incentivise them in learning a new language.
Maybe befause React native uses OS UI components while Flutter creates everything from scratch. https://microsoft.github.io/react-native-windows/
I don’t remember which video it was exactly, but one of the higher ups talked about future technologies within Microsoft and how they were doing more and more GUI-based thing with react. And if you look at it, they’ve done pretty amazing things within the JavaScript eco-system in general. Office 365 is amazing, Visual Studio Code is amazing and it just wouldn’t make sense for them to go from typescript to dart.
Especially when you consider how unfinished flutter is. We’re a C#/power shell with a little Python shop with a lot of Enterprise Microsoft techs. We still considered Flutter because Xamarin wasn’t working out for us and we’re not big on JS or big enough to do native, but flutter just doesn’t fill our needs either. That’s anecdotal, but the difference is that react and react native are proven techs and flutter still isn’t.
It looks like they are making progress, Chris Sells, a Flutter PM, tweeted
"While things have been delayed on the desktop side for Flutter due to the current crisis, the team has been working hard to bring both Windows and Linux support to alpha. I think you're going to be happy about what you see." https://twitter.com/csells/status/1261036199294062592
Like, isn’t VSCode all JavaScript? Surprisingly, this is probably what allowed Microsoft to build software that runs on both Window, Mac, and Linux! The JavaScript platform, ultimately became what Java dreamed of becoming back in the 1990s. And without the need to install a separate virtual machine layer, but at the expense of more inefficient code.
But VSCode is painfully slow, if you run it on an older PC.
And you’re not going to be running Windows 10 on a 15 year old PC anymore.
So could this mean, that software companies are going to force people to buy newer hardware, to run their programs? Most likely. Apple has programmed the consumer into spending unnecessarily for new hardware every year.
I wouldn't. I don't like Swift's syntax. The ecosystem would likely not be mature enough either.
But when I did use it, I loved it. I've written in quite a few languages, and it is my favorite, but not my go-to because of its limited environment.
C# isn't really missing features vs swift but it might have a less modern syntax
Not to mention that developing C# in Visual Studio or Rider feels years ahead of what's considered good enough IDE assistance in other languages. Comparable with Java even.
The more flexible memory management model added recently, native binaries, (as the default option) and even identifier: Type over type identifier is also a nice plus for me, I agree that the IDE situation is heavily in C#'s favor.
If C# is a nicer Java and Kotlin is a nicer C#, then Swift is a nicer Kotlin.
What would you argue C# has going for it over Swift?
What would you argue C# has going for it over Swift? feature wise I don't know but it clearly has a far bigger lib ecosystem which is the most important criterion
Swift was designed to seamlessly blend functional and OO styles from the get go.
Fundamentally, there's still classes and inheritance everywhere in C#, which is also what I hated about Cocoa and using it from Swift before they came out with SwiftUI.
Now don't get me wrong, I am not saying C# is a bad language, just that when you compare it with Swift, Kotlin, Rust etc, it's clearly playing catchup.
> far bigger lib ecosystem which is the most important criterion
Going by that metric, you could argue there's no point to C#, because Java likely still wins handsomely on that front and maybe Java should just give it up to JavaScript anyway.
Clearly we don't just evaluate languages solely by the size of their ecosystem. There's a critical mass that needs to be achieved, but at some point there's 2-3 libs for everything you may want to do and simly having 5 more is not magically better, the same way having "millions of apps" on the App Store doesn't mean much if most of them are not that great and people stick to just a few.
As an example, the GUI situation on Windows clearly offers more choice for C# devs as to how they want to go about their GUI, but I'd argue the Windows GUI situation is a bit of a hot mess right now and SwiftUI seems like a breath of fresh air compared to that.
btw. it's the other way round. most modern stuff was in c# while the others played catchup and some still do. no language has async/await implemented as good as c# has, no language has nullable value types as good as c# no languages has a reflection api that is really easy to use and if that isn't enough there are also expressions which are more like macros and due to the way how generics are implemented no internal api sucks. btw. c# even has channels.
swift has nothing over c# and all features swift has were more likely be in c# before they were in swift.
And of course Electron, which is somehow even worse than Java.
wtf.
Just out of curiosity, what was your colleague doing?
Its super common to misconfigure Java to use all of your ram. You could have a terabyte and tell it to use everything and it will
However for the desktop, a good real table, with columns, would be nice.