This blog-post marks the final report on bringing Swift to Haiku in the Google Summer of Code period. My introductory post on this project can be found here for a brief overview of the project.
Only the programming language was ported, not the whole libraries from iOS.
So for now it will be restricted to comand-line apps. Maybe latter on graphics apps, but using Haiku’s native widgets.
I don’t even know if the GUI toolkit from iOS has an open source implementation?
You wouldn’t be able to compile applications/libraries made specifically for Apple platforms using open-source Swift. They use libraries such as Cocoa, UIKit, etc which are only available on Apple platforms.
@PulkoMandy I think cocotron aims to be the open-source reimplementation of the Cocoa APIs. However it uses the Objective-C runtime, so that won’t be useful for the Swift port anyway.
Also, open-source Swift has no way of directly calling C++ code, so you can’t use the Haiku APIs without some sort of C interface to them, like libcharlemagne or Habid.
Although these libraries are very outdated, the former did have a working demo of calling the Haiku API from C and then to Lua.
I dont think you can. NSFoundation etc isnt ported, I dont think you can use LibDispatch either (for threading (GCD)). If it get mature it would be nice to have a HaikuUIKit, etc so we can write apps in Swift instead of C++.
@iQQator The issue in regards to porting Foundation is the hard requirement of Libdispatch (Which needs low-level APIs such as epoll and kqueue.) I’m planning to implement a workaround for this using Haiku’s wait_for_objects() equivalent, but haven’t found enough time to do this.
I have still kept the Swift port updated over at swift-haiku-build which I use to build and test the port. As for the build error, you might need to wait for this patch to land in HaikuPorts first.
I think issue is build system in the Haiku, for example pkgman not contain sqlite3_devel
What llvm I need install ?
llvm (this is 5 in Haiku pkgman) or llvm7 ?
What’s packages do I need install on Haiku for build can be complete ))
In the internet I read float128 is problem of gcc, gcc 6.9 should be fix this issue… but in Haiku I can’t find newer gcc
My patch when merged will allow you to build using at least llvm6-6.0.1-4 or llvm7-7.0.0-2. However those versions won’t be available yet until this pull request is merged.
Actually the proper, generic way to do this is “pkgman install devel:libsqlite3”. Then it will find the package providing development files for libsqlite3, no matter how it’s named.
@iQQator The LLVM versions (6.0.1 and 7.0.0) should be now updated to include the __float128 fixes, so you should be able to build Swift again using llvm6_clang-6.0.1-4 or llvm7_clang-7.0.0-2.