How cross-platform is Swift ? Are the GUI libraries platform-dependent or independent ? I.E: can i write a single Swift program with a GUI that will compile, work the same and look similar on multiple platforms: Linux, Mac OS, Real Unix-es & BSDs, AIX, Windows ?
Chris Lattner has a wife, I am pretty sure he does not want to fuck you. But if the features are so compelling that you want to have sex with him, they can't be all that bad, no?
Also, ruby, Java, Python and, em, pretty much no other language have direct C++ interop. C, sure. C++, not often.
Chris Lattner has a wife, I am pretty sure he does not want to fuck you. But if the features are so compelling that you want to have sex with him, they can't be all that bad, no?
Also, ruby, Java, Python and, em, pretty much no other language have direct C++ interop. C, sure. C++, not often.
That's because C++ is an absolute JOKE of a "Language". Created SPECIFICALLY to be hopelessly complex and wasteful.
Seriously. It's the worst of the worst, and considering the other horrible languages it has to "compete" with, that's saying something.
GNUstep has an implementation of the core GUI frameworks (AppKit and a few others), but the open source version of Swift doesn't have Objective-C interop, which is really the only compelling feature for Swift: it's a good incremental language if you have a lot of legacy Objective-C code.
I'd have thought it'd be trivial to interface the open source version of Swift with GNUstep
Unlike Clang, the Swift compiler doesn't have very clean interfaces for abstracting the different Objective-C implementations (clang does because I wrote them, before Apple added support for their runtime). Instead, when you build Swift, you have a bunch of #ifdef __APPLE__ things that turn off the Objective-C interop for non-Apple platforms. This also means some quite big ABI changes, for example the Swift CoreFoundation implementation has different object layouts to the ones that Apple uses and the way
That doesn't mean you can make a cross platform wrapper that will interact with the is GUI API using the same commands. So if I were to say. LINE (10, 10, 500,10,#FF0000 ) It would draw a horizontal red line 490 pixels. Now this would require different API calls on different systems. But you translate that command to the different OS. That is what java does.
Swing works in principle, but a Java app always looks loke a Java app, which is a bit...different. That said, have written quite a few Swing apps in my life.
Swift is an open-source cross-platform language (there's even a Linux server version), but the Cocoa and Cocoa Touch APIs on OS X and iOS are platform specific.
Looking at? That doesn't answer my question. Is it being used for something else than a toy? And why? If I were to develop a Linux server application, Swift wouldn't even be in my top 10 language choice.
Swift is in fact more confusing and convoluted to read than the ubiquitous C++.
I've done a lot of C++ in the past and a lot of Swift in the present. At its worst Swift is 10x more readable than the average C++ code. Even if for some reason you are looking at the name managed output of class/method names in the debugger just compare that to the multi-page joy that was (is?) template class debugger output...
Just the fact that Swift does not support multiple inheritance lends it the automatic win.
How cross-platform is Swift ?
Are the GUI libraries platform-dependent or independent ?
I.E: can i write a single Swift program with a GUI that will compile, work the same and look similar on multiple platforms: Linux, Mac OS, Real Unix-es & BSDs, AIX, Windows ?
Are you implying that macOS is NOT a "Real Unix/BSD"?
You know, of course, you're doing nothing but showing your Apple Hate, AND your monumental ignorance [stackexchange.com], right?
Oh, I forgot: You're a typical Slashdotter.
There is no likelihood man can ever tap the power of the atom.
-- Robert Millikan, Nobel Prize in Physics, 1923
Cross-platform (Score:5)
How cross-platform is Swift ?
Are the GUI libraries platform-dependent or independent ?
I.E: can i write a single Swift program with a GUI that will compile, work the same and look similar on multiple platforms: Linux, Mac OS, Real Unix-es & BSDs, AIX, Windows ?
Re: (Score:1)
None of Apple's GUI libraries are open source or cross platform and they never will be.
Re: (Score:2)
If you find optionals confusing, I suggest you do something different to programming.
Re: (Score:2)
Chris Lattner has a wife, I am pretty sure he does not want to fuck you. But if the features are so compelling that you want to have sex with him, they can't be all that bad, no?
Also, ruby, Java, Python and, em, pretty much no other language have direct C++ interop. C, sure. C++, not often.
Re: (Score:2)
Chris Lattner has a wife, I am pretty sure he does not want to fuck you. But if the features are so compelling that you want to have sex with him, they can't be all that bad, no?
Also, ruby, Java, Python and, em, pretty much no other language have direct C++ interop. C, sure. C++, not often.
That's because C++ is an absolute JOKE of a "Language". Created SPECIFICALLY to be hopelessly complex and wasteful.
Seriously. It's the worst of the worst, and considering the other horrible languages it has to "compete" with, that's saying something.
Re: (Score:2)
Swift is stupid and ugly, that's why. And I'm talking about their language.
No direct C++ interop, stupid confusing optionals, never ending spec updates and deprecation... Fuck you Chris Lattner
Again, Slashdotters show their debate skills...
Re: (Score:3)
Re: (Score:3)
Re: (Score:3)
I'd have thought it'd be trivial to interface the open source version of Swift with GNUstep
Unlike Clang, the Swift compiler doesn't have very clean interfaces for abstracting the different Objective-C implementations (clang does because I wrote them, before Apple added support for their runtime). Instead, when you build Swift, you have a bunch of #ifdef __APPLE__ things that turn off the Objective-C interop for non-Apple platforms. This also means some quite big ABI changes, for example the Swift CoreFoundation implementation has different object layouts to the ones that Apple uses and the way
Re: (Score:2)
That doesn't mean you can make a cross platform wrapper that will interact with the is GUI API using the same commands.
So if I were to say.
LINE (10, 10, 500,10,#FF0000 )
It would draw a horizontal red line 490 pixels.
Now this would require different API calls on different systems. But you translate that command to the different OS. That is what java does.
Re: (Score:2)
That works really well, yeah...not.
Swing works in principle, but a Java app always looks loke a Java app, which is a bit...different. That said, have written quite a few Swing apps in my life.
Re:Cross-platform (Score:5, Informative)
Swift is an open-source cross-platform language (there's even a Linux server version), but the Cocoa and Cocoa Touch APIs on OS X and iOS are platform specific.
Re: (Score:2)
Not asking about the Apple GUI ones.
Just curious if there's a generic one (like Qt, or Swing) or at least a plan to have one in the future.
Re: (Score:2)
There are, in fact, several GitHub projects where people are experimenting with Qt and GTK.
Re: (Score:1)
Why would Swift need a separate UI library? Just create language bindings for an existing UI toolkit as is done for plenty of other languages.
Re: (Score:2)
Is there a single swift program actually being used by more than 2 people in a basement which is NOT using these Apple APIs?
Re: (Score:2)
Re: (Score:2)
Looking at? That doesn't answer my question. Is it being used for something else than a toy? And why? If I were to develop a Linux server application, Swift wouldn't even be in my top 10 language choice.
Re: Cross-platform (Score:1)
Tell that to pissed revs who have to deal with never ending depreciations in Swift.
I hate to disillusion you, but Swift is in fact more confusing and convoluted to read than the ubiquitous C++.
C++ winds unreadably award by a mile (Score:2)
Swift is in fact more confusing and convoluted to read than the ubiquitous C++.
I've done a lot of C++ in the past and a lot of Swift in the present. At its worst Swift is 10x more readable than the average C++ code. Even if for some reason you are looking at the name managed output of class/method names in the debugger just compare that to the multi-page joy that was (is?) template class debugger output...
Just the fact that Swift does not support multiple inheritance lends it the automatic win.
Re: (Score:2)
(Telltale sound of dripping water indicating Android apologist)
Re: Cross-platform (Score:1)
IBM has been pushing it pretty hard. Just google IBM and swift.
Re: (Score:1)
How cross-platform is Swift ? Are the GUI libraries platform-dependent or independent ? I.E: can i write a single Swift program with a GUI that will compile, work the same and look similar on multiple platforms: Linux, Mac OS, Real Unix-es & BSDs, AIX, Windows ?
Are you implying that macOS is NOT a "Real Unix/BSD"?
You know, of course, you're doing nothing but showing your Apple Hate, AND your monumental ignorance [stackexchange.com], right?
Oh, I forgot: You're a typical Slashdotter.