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.
"Just think of a computer as hardware you can program."
-- Nigel de la Tierre
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:Cross-platform (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.