11 ms·
> . It is hard to think that any Windows programmer would prefer Swift as a language over .NET languages, as many commenters pointed out on Reddit, but a port o
by judge2020 7y ago
> . It is hard to think that any Windows programmer would prefer Swift as a language over .NET languages, as many commenters pointed out on Reddit, but a port of Swift UI on Windows could be a game changer.
Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework.
- ashtonkem 7y agoCreating a good cross-platform GUI framework is probably harder than creating a good cross-platform language.
- davidcorbin 7y ago100% correct
- choward 7y agoPossibly, but that's if you include the part about making it look/feel native. If you just provide the tools the are just focused on the language and framework and let the people who care about making it look native on whichever platform it's running focus on that then I think it's doable. 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.
- giancarlostoro 7y agoHeck if you go the Sciter route you can have a very well known approach but without going full Electron about it.
- ashtonkem 7y agoA native look and feel is definitely an implicit assumption I held. You’re right that eliminating this requirement changes the level of difficulty significantly.
- jolux 7y agoI’ve thought enough about this problem that I don’t think it’s possible to recreate a “native” experience with a cross-platform app. You end up compromising on the nativeness every time. It makes more sense to me to use native GUI frameworks and program your functional logic in something like Rust.
- fmxexpress 7y agoEmbarcadero was able to do it with Delphi. Android, iOS, macOS, Windows, and Linux. Single codebase single UI. It looks like the bear is in keeping up with all the platform updates all the time though.
- realharo 7y agoWhether it is actually good is subjective 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.
- chadcmulligan 7y ago> Electron ends up being the technology of choice for so many desktop apps. probably because of the large number of JS only developers.
- yoz-y 7y agoI’d say electron became popular thanks to HTML, not JavaScript. IMO HTML is by far the “easiest” to use GUI framework because it is so unconstrained. It will end up a mess, but eventually you can get the result you want. This is not the case with native frameworks which come with a larger sets of rules on how they can be used.
- veidr 7y agoCreating 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
- coldtea 7y ago>Way way way way way harder, I'd think. It's basically never been done in the modern era. Also never been really tried, except by second tier companies with small recourses like Trolltech/QT, or even smaller open source attempts like Wx.
- andrekandre 7y agodidnt openstep use the native win32 for the ui on windows?
- coldtea 7y agoYes, for like 2 years, then it went under...
- diegof79 7y agoSun tried with Swing.. and they were not a second tier company at the time. Also previous versions of OSX (before the rename to macOS) included a special theme of Swing to make apps to look more native in OSX (Jobs was happy to announce that OSX supported Java... when Java was sexy). 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
- tinus_hn 7y agoRight now people are using Electron. ‘Better’ is not that high a hill to climb.
- fetbaffe 7y agoPersonally I wouldn't mind creating a new UI for every platform I need to support as long as I could use the same language with the same build tools and reusing components between them.
- jakearmitage 7y agoLazarus would like to have a word with you.
- viraptor 7y agoWhat would it provide that Qt + QML don't right now? (if we assume that the crossplatform GUI is the killer feature)
- pfranz 7y agoI'm sure licensing is a big one. It looks like SwiftUI is MIT license and Qt is dual licensed.
- JimDabell 7y agoI think you are mixing up Swift and SwiftUI. 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.
- pfranz 7y agoThanks for the correction! I knew of the distinction, but in my haste I was looking at a different repo (and I blanked that the source hasn't been released and licensed). 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.
- rapsey 7y agoPricing and not being c++
- Raymonf 7y ago> Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework. I wouldn't. I don't like Swift's syntax. The ecosystem would likely not be mature enough either.
- Diesel555 7y agoBest part about maturity. It matures. I would jump ship in a heartbeat to Swift. I don't use it because I can't use it in most places, and I am slowly learning to choose what I become an expert in. It sure isn't everything. 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.
- skohan 7y agoWhat don't you like about the syntax?
- ken 7y agoThat's a big if. From what I've read, SwiftUI isn't even a great Mac/iOS GUI framework yet. And Windows and Linux are drastically more different than those two.
- Diesel555 7y agoI really enjoy swiftUI. It appears like it tried to emulate react and succeeded on a few fronts, is better in a few fronts (child modifying parent variable), and worse in a few fronts (side effects). 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.
- sophiebits 7y agoCurious to hear more about what SwiftUI does better than React… any place I can read more?
- doteka 7y agoThe official Apple tutorial gives you an idea what they were going for, but in practice it’s nowhere near that smooth. 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.
- kitsunesoba 7y agoErrors in SwiftUI are significantly better in the recently released Swift 5.2, so this is clearly something they’re working on.
- gman83 7y agoIf that were true wouldn't we be seeing a big increase in Dart adoption because of Flutter as well? I'm not seeing it.
- stu_k 7y agoAlthough it technically has cross platform GUI, Flutter has actually reimplemented all the native OS widgets. As soon as the OS changes some look and feel your app will look out of date.
- vijaybritto 7y agoYes it will look out of date. But whats important? A functioning app or good looking one? We all know that websites written for ie6 are out there today making millions in revenue. It always comes down to the functionality not the looks
- akmittal 7y agoIt probably will be good looking just wont be aesthatically consistent with new OS looks.
- DagAgren 7y agoBoth. If you have only one, you have a shit product nobody wants.
- vijaybritto 7y agoI'm not advocating for garbage looking products. All I'm saying is that lets be tolerant on looks because functionality matters the most
- zapzupnz 7y agoYou can be as tolerant as you want, that's not how things go for iOS apps. It's certainly not how things go on macOS except when there are no available alternatives. 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.
- qaq 7y agoSwiftUI lacks many basic widgets like table.
- cerberusss 7y agoTo specify, it does contain what SwiftUI calls a List. And each row in the list can of course contain a number of widgets, so you can approximate a table. However for the desktop, a good real table, with columns, would be nice.
- qaq 7y agoCreating a quality table widget would likely take more resources than the app in many cases
- dep_b 7y agoA CollectionView alternative you probably mean?
- akmittal 7y agoMicrosoft is working on cross platform GUI framework. I am not sure how i feel them choosing react native instead of something like Flutter. Maybe befause React native uses OS UI components while Flutter creates everything from scratch. https://microsoft.github.io/react-native-windows/ https://microsoft.github.io/react-native-windows/
- oblio 7y agoMicrosoft also has Xamarin, which is a bigger deal for them than React Native.
- virvar 7y agoI think they are choosing react native because they genuinely like react. 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.
- sebe 7y agoYeah Flutter's main focus is mobile, they are working on Desktop Flutter, you can try it out on the master channel. 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 https://twitter.com/csells/status/1261036199294062592
- eggsnbacon1 7y agoI have doubts. We already have cross-platform languages with decent GUI like Java (people give it tons of shit but I bet you use a Java GUI every day without knowing it). Python has some decent ones too though. And of course Electron, which is somehow even worse than Java.
- mpfundstein 7y agoA colleagues computer lastly crashed. turned out pycharm took 14gb of ram.. wtf.
- enitihas 7y agoPyCharm, by the virtue of running on JVM, doesn't take any more memory than allocated to it in VMOptions. So unless you go out of your way to give it too much memory, I am not sure PyCharm is going to take 14GB of memory. I am a heavy user of IntelliJ based products for a long time and I can't remember them taking enough memory to be a problem on a 16GB laptop. Just out of curiosity, what was your colleague doing?
- mpfundstein 7y agowould have to ask. i just recite his report :-)
- eggsnbacon1 7y agoI have had IntelliJ open with multiple million+ line projects with thousands of source files and it hovers around 3GB. Its gotta be his settings. Java will use as much ram as you tell it to, it uses the extra ram to collect garbage less often. 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
- blackrock 7y agoWhat is the relative efficiency penalty these days, for using JavaScript to build the GUI, as opposed to using native code? 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.
- rblatz 7y agoTrying to pull a reverse os/2, interesting.
- tjpnz 7y ago>Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework. 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.
- berti 7y agoQt licensing can be problematic depending on your project. They also no longer publish LTS releases under an open-source license. Swift UI would presumably not be encumbered in this way.
- AsyncAwait 7y agoSwift is also a much nicer language than C# in my opinion.
- The_rationalist 7y agoCould you argue why?
- AsyncAwait 7y agoA lot more emphasis on functional programming & nicer syntax around it, preference of value types over reference types and immutability by default/opt in mutability, nicer parsing with Codable, nice pattern matching and destructuring syntax, native binaries by default, more flexible memory management.
- The_rationalist 7y agoModern C# has both destructuring and pattern matching in switchs. The memory model of swift seems obscolete, reference counting does not catch reference cycles and swift isn't faster than C# C# isn't really missing features vs swift but it might have a less modern syntax
- AsyncAwait 7y agoIn regards to the memory model, I am not talking about reference counting, but rather [1]. 1 - https://swift.org/blog/swift-5-exclusivity https://swift.org/blog/swift-5-exclusivity
- hu3 7y agoI'd argue the other way around. 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.
- AsyncAwait 7y ago
- mertnesvat 7y agoI think main goal is to increase market share in server-side development for swift.