Hacker News new | past | comments | ask | show | jobs | submit login

Swift is a language that feels right to me in ways that others don't. I code on Linux and Windows, not on Macs. Swift on Linux works OK, but it's there that you really see how few pure Swift libraries there are. For example, on the project we were exploring, the only Swift library for handling zip files--and we asked the community several times--was a personal project with 14 stars. That was not going to work for our enterprise.

The port of Swift to Windows barely functions and in every dimension is in worse shape.

It's a shame b/c the language is truly beautifully designed.




Don't swift and rust share a few of these things that make it "feel right"? With rust the whole ecosystem thing seems to be a lot better. Also rust has C(++) interop (so you have every library you could wish for), does swift not have that?


It does have c interop so you could just use libarchive. Though writing c in swift is a bit less magical.


While technically true you then have to use pointers in swift and they made it hard by design to do that.


Last time I looked, Swift didn't have a stable way to export C-compatible ABIs.


@_cdecl exists, although it's underscored.


I was under the impression that this feature wasn't stable, but it's been years since I've thought about it.


Second this. IMO Swift is extremely easy to pickup, especially if you're coming from C++ land like me. But sometimes I feel its ecosystem being...obscure.


well yeh if you can pick up c++ then swift is easy, but apple is positioning it as a first language which it is definitely not.


I don’t think the story is ever going to change much on non Apple platforms. It just doesn’t make sense for them.


> It just doesn’t make sense for them.

It does though. As least for me. Better support on Windows and Linux would increase the number swift developers which would the in turn result in more and better open source libraries.

For Apple this could mean that their own open source libraries could get better, they have more tools/libraries to choose from, or simply that they have a greater pool of talent for hiring.

Looking at Go (and Rust) I think this is somewhat shown. There are a lot of different factors, but I think the development tools of Go is the #1 reason why it is basically the only "new" language in a long time that gained a large enough popularity to become mainstream - as in you actually find jobs developing in Go. Which is in some ways sad. It seems like Swift could be the very good fit for backend/serverless development.

I guess the real question is how much effort would it take to get the development tools like editor support to the next level?


Swift is designed to be a lock-in to Apple development for Apple. If it was otherwise, why WOULDN'T you also provide compilation to Wasm and Javascript, etc., if you are a company with the resources of Apple? Don't get me wrong, Swift is great, but it is a big lock-in.

I have programmed for the last 4 years or so almost exclusively in Swift, but I am now switching to TypeScript in general. Writing my libraries in TypeScript, I will still be able to access them from Swift and other languages via embedded browser engines.


> why WOULDN'T you also provide compilation to Wasm and Javascript

Because it's useless save for a single kind of development (websites) and the main issue is not even in spitting out WASM but making the language runtime and libraries work in the browser. Most languages have no first-party WASM or Typescript support either.


Yes, because those other languages are made by other companies with equally vested lock-in aspirations.

You are right, Apple has no interest in supporting Javascript, what good would it do them except more work and hassle?

It would help many programmers though, to make their code more portable and available on more platforms. It would not be that easy to do, but also not that difficult. Rust is supporting WASM, Scala is supporting Javascript. Kotlin as well. Apple can't do it? Come on.

Just stating the obvious: The interests of Apple and programmers are aligned in some aspects, and opposed in others.


If you are still looking for a pure Swift ZIP handling library, you can check out ZIPFoundation: https://github.com/weichsel/ZIPFoundation


You could take a look at either Rust or OCaml, Swift feels like it's between the two.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: