Swift on and for Haiku

Hmm, could be interesting. It would be interesting to colaborate with them since the language is beeing formed.

But: their coms are discord and github, and they need a cla.
(no xmpp, no irc, no email)

edit: apparently also google drive and google calendar… funky

Those are too many hurdles for me to contribute. Too bad : /

100% interoperability with C++ wouldn’t be my priority. I mean, everyone’s going to decide for themselves what creek they want to paddle up, but there are a lot of languages with other attractive features and not that one, and you don’t really need it. I mean, I’ve used the Be API with Python, Haskell and Ocaml, and they sure aren’t C++ interoperable.

Swift seems nice, but to me not really a typical open source project. The things we bring on board to Haiku are typically sort of guerilla projects for a while, that is, back at headquarters they may not know about the existence of a Haiku port right away, until it becomes a real thing that’s worth upstreaming patches etc. That seems somewhat foreign to Swift world, and I wonder how easy it will be to get Haiku on the list.

1 Like

This is due to being very early stage. C++ interoperability is available from Swift 5.9.
I think it will be polished and improved over time.

We already have bindings to the Haiku API for C# and Python but with their own caveats and limitations, though.

No, I would like to use an alternative to C++ to write Haiku apps.

4 Likes

Has Swift 6.0 been ported yet?

1 Like

Fortunately, I could successfully build the Swift 5.9 (sorry, not a new version) with @return_0e 's repo and Haiku R1 beta6 environment. It requires small workarounds to build, but it succeeded and it seems to work.

I’m interested in packaging this for the Haikuports, but it has somewhat weird build step which source dependency checkout script. It resembles Rust packages depend on other packages with Cargo.toml and cargo tool.

@Begasus can I run such a checkout script which pulls LLVM and build it in Haikuports build? The first checkout and building it on my VM on the MacBook Pro 2017 took probably 4-5 hours with 4 core and 8GB RAM.

Or packaging prebuild binaries like rust_bin or early Iceweasel builds is viable?

1 Like

Network access is removed from haikuporter on buildmasters, so a script pulling sources won’t work in a recipe, you could do that on a local build with an extra line in the haikuports.conf file.

Had a look at swift the other day, drove me nuts so didn’t go any further :rofl: but I would like to help out where possible (IIRC the issue is with older ICU/boost versions in use in the recipe).

If nothing else works I guess a _bin package would be good enough for now. But trying to get some local build up and running would be nice first.

2 Likes

@Begasus Thank you for the info. I’ll look into the checkout script when I have some time, and give it a try to local build.

2 Likes

In case multiple sources are needed to be pulled in, SOURCE_URI_* could be used.

2 Likes