Announcing the Swift SDK for Android
34 points by dayanruben
34 points by dayanruben
I never managed to figure out how exactly Swift on Linux works, even. It was very confusing, particularly between the "Foundation" library and the standard library. It all still seems very Apple-centric.
I wonder if they've improved on that in the meantime, with Swift embedded and now this.
Well for one thing, it should be easier to get a toolchain now that Swiftly is the blessed CLI.
Foundation makes more sense if you know it was there in the Objective-C days as a core OO layer atop the C standard library. Basic data structure and string objects lived there, for example, but so did HTTP requests, so as a core layer it was pretty rich. In Swift, the standard library is enlarged to include the basic data structures and strings, but Foundation still supplies HTTP and such. So it is kind of an upper core layer today and you're probably going to use them both.
Curious to know when you tried it last. We've invested a huge effort in improving this over the last year or so, across installer technology, library improvements, package management and testing, and deep VSCode support. Would love your feedback if you still see big gaps -- perhaps we still have some blind spots.
[Disclosure: I work on developer tooling and frameworks at Apple.]
It was around that time-frame, a year or so ago. It was definitely before the VSCode extension got moved.
I remember reading about the new Foundation library, and I was confused by whether or not this was an aspiration or if open source Foundation was already shipping with Swift, and I couldn't find a way to tell.
I was confused by how Foundation docs and the stdlib docs were on a separate Apple website.
Foundation felt like it still pushed a more Apple-centric model of the OS. I'm by no means against that style of API, where there's a clear “standard” way of doing specific semantically meaningful things, that more easily integrates into platforms like iOS, where files are more abstracted away for the end user. But it seemed scattershot as to what things were given what kind of interface, and I had to repeatedly search for "How do I open a file in Swift" and similar things instead of straightforwardly searching in the documentation.
I also didn't like how the documentation for the swift CLI, package manager, etc. was separate from everything else, and somewhat hidden. I still don't know the import resolution system, though I grant that Swift isn't the only language with an annoyingly obtusely specified import resolution system (Python comes to mind).
I'm the sort of person who reads a language reference for fun, so the first thing I did was read The Swift Programming Language front to back, and it didn't tell me anything about the standard library, Foundation, the compiler, the package manager, the CLI, etc.. It seemed to describe the language in an idealised vacuum.
I then learned about new features like parameter packs and iterating over them, and they weren't mentioned in the “reference” section at all. So it seemed unclear to me what the actual reference or documentation for the language was. It didn't help that the documentation page was confusingly laid out, requiring me to click multiple links with confusing names to get to the reference. As I remember TSPL is called a “reference” in one link, but only a part of TSPL is an actual reference.
Another thing to note is that my Linux distribution of choice, NixOS, didn't package Swift properly, and generic tarballs won't work on it, so I installed Swift inside of a container running Ubuntu, unpacking the tarball, etc.. That's not much of a hassle though.
It's also confusing that there seem to be multiple websites called “Swift Package Index” or something along those lines, now, and I can't figure out which is the “real” one and what the hell the other one is.
PS: To give you perhaps a glimpse into the style of language learner I am, to frame these experiences, let me link two bugs in Swift that I reported at the time (which haven't been fixed, judging by the issue labels): https://github.com/swiftlang/swift/issues/74478 https://github.com/swiftlang/swift/issues/74645