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 ?
To be fair, if the original poster was trying to understand Optional from the myriad useless monad "tutorials" on the internet, I can totally understand his or her angst.
Really, not confusing? Having like 10 different types of optionals and optional use cases and last minute spec updates to make them work for basic pointer ops, effectively just a shared_ptr in C++.
Yeah, I see you've "learned" your kindergarten Swift and ready for system programming.
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.
You obviously know what you are talking about but I'd have thought it'd be trivial to interface the open source version of Swift with GNUstep. Well, at least they stopped desecrating Objective-C with Java syntax. IMHO, although it's sad they completely removed the dynamic aspect of ObjC, swift is the best of all the toy languages. I was comfortable using it to write a full program right away and I do mostly embedded C. The only downside is that it is a bit of an NP-hard problem to decide whether a correct pro
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.
No. Apple has no plans to make a generic UI library. Doesn't stop someone else from doing so or making Swift bindings for Qt or GTK as there are for numerous other languages.
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.
I bet you've recently converted and yet to do any real work in stupid Swift. Also you do sound like an apple apologist, so I wouldn't trust your opinion.
How cute, you took one of the most common accusations aimed at apple fanbois and somehow tried to apply it to people without a preference. PS Android OS is the most unusable pile of steaming garbage of all time - outside the Apple ecosystem.
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?
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: Cross-platform (Score:0)
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
Re: (Score:2)
If you find optionals confusing, I suggest you do something different to programming.
Re: (Score:0)
To be fair, if the original poster was trying to understand Optional from the myriad useless monad "tutorials" on the internet, I can totally understand his or her angst.
Re: Cross-platform (Score:0)
Really, not confusing? Having like 10 different types of optionals and optional use cases and last minute spec updates to make them work for basic pointer ops, effectively just a shared_ptr in C++.
Yeah, I see you've "learned" your kindergarten Swift and ready for system 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: Cross-platform (Score:0)
Maybe you should go back to school, you imbecile. You are embarrassing yourself and your god apple.
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: Cross-platform (Score:0)
You obviously know what you are talking about but I'd have thought it'd be trivial to interface the open source version of Swift with GNUstep.
Well, at least they stopped desecrating Objective-C with Java syntax.
IMHO, although it's sad they completely removed the dynamic aspect of ObjC, swift is the best of all the toy languages. I was comfortable using it to write a full program right away and I do mostly embedded C. The only downside is that it is a bit of an NP-hard problem to decide whether a correct pro
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:0)
Thanks for the reply!
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:0)
No. Apple has no plans to make a generic UI library. Doesn't stop someone else from doing so or making Swift bindings for Qt or GTK as there are for numerous other languages.
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:0)
It's performant and offers a high degree of correctness through its type system. Also swift is generally very easy to refactor as time goes.
Plus thanks to the obj-c bridging being first class it's very easy to hook into C for performance when it's critical.
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: C++ winds unreadably award by a mile (Score:0)
I bet you've recently converted and yet to do any real work in stupid Swift. Also you do sound like an apple apologist, so I wouldn't trust your opinion.
Re: (Score:2)
(Telltale sound of dripping water indicating Android apologist)
Re: (Score:0)
How cute, you took one of the most common accusations aimed at apple fanbois and somehow tried to apply it to people without a preference. PS Android OS is the most unusable pile of steaming garbage of all time - outside the Apple ecosystem.
Re: (Score:0)
Just the fact that Swift does not support multiple inheritance renders it an incomplete tool targeted at complete tools
ftfy
Re: Cross-platform (Score:1)
IBM has been pushing it pretty hard. Just google IBM and swift.
Re: (Score:0)
What does Cocoa and Cocoa Touch have to do with Swift at all?
Do you consider GDI32, GTK etc part of C?
Re: Cross-platform (Score:0)
Maybe there'll be GTK+ bindings in the future. That's cross platform, and should work on Linux, macOS, Windows, and any up-to-date Unix.
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.
Re: (Score:0)
"Real" UNIX, i.e. UNIX from AT&T, doesn't exist anymore.
All the currently available UNIXes are forks and clones.