Remix.run Logo
worik 8 hours ago

I am unconvinced

I have used Swift (stopped about two years ago) and use Rust extensively these days.

People commenting here have mentioned the dreadful Xcode. But if you want to build systems on Apple, without investing a lot in setup, you are stuck with Xcode.

To be clear it's failures as an editor or build system are not the main problems with Xcode (albethey very frustrating when the intermittent problems show up) it is the abject failure of the tooling.

We never got the profiler to produce anything intelligible after days of trying, spread over several weeks.

SwiftUI is not part of the conversation here, and I limit the amount of UI building I do, but it shares all the problems of declarative UI frameworks - mainly "where is the code?". Debugging logic problems is nigh impossible in code you're unfamiliar with

The very worst part of Swift were the thread control. Trivial to overwrite shared memory, "DispatchQueus" (?IIRC?) are a thin wrap of fork, and do nothing but add complications

Swift is probably better than Objective C, the latter being from the 1980s, and things have moved on, if your target is iOS and friends, and you are sure you never want to port, then obeying Apple is a wise business decision. Other than that stay away from it. Use Go for most things, and Rust when you must

frizlab 7 hours ago | parent | next [-]

I’m sorry but reading your comment, you have not understood much about Swift (and GCD).

In particular “"DispatchQueus" (?IIRC?) are a thin wrap of fork, and do nothing but add complications”, in addition to having typo, is as wrong as it can get.

> if you want to build systems on Apple, without investing a lot in setup, you are stuck with Xcode.

If you want to do in Swift the same type of dev you do in go/rust/whatever, Xcode is more than not mandatory, it is generally recommended to use something else, including in the Swift community. Also, you can build native apps in Swift using something else than Xcode (if it is possible to do that in rust for macOS, it is obviously possible with Swift).

> We never got the profiler to produce anything intelligible after days of trying

You mean Instruments? That app is incredibly good, I fail to see how you failed to get anything out of it.

> The very worst part of Swift were the thread control

Already talked about that one, but Swift has async/await now, also.

worik 5 hours ago | parent [-]

Async/await is not a solution to poor thread models.

Async/await is cooperative multitasking and is no help at all for cpu bound problems.

For i/o intensive systems it makes non-blocking i/o look like blocking i/o, and people find that helpful.

I do real-time i/o so I need more control and Async/await is unhelpful.

It is a worthy adition to Swift I agree. But they sorely lack Rust's excellent design in this area

airstrike 7 hours ago | parent | prev | next [-]

I can relate so much to this comment I need to check my house's CO2 level to make sure I didn't write it

Well, the only difference is I'm allergic to Go and just use Rust 99% of the time these days

worik 5 hours ago | parent [-]

> is I'm allergic to Go and just use Rust 99% of the time these days

I confess I have not used Go. I am allergic to Typescript, let alone, Javascript, and Node.js should be deleted.

I do mostly real-time audio, so I too am Rust (job control in Shell). But what decent choices are there for garbage collected systems?

And garbage collection, for most systems, is crucial

satvikpendem an hour ago | parent | next [-]

I guess you could use OCaml / ReasonML now, the latter especially feels like Rust with a GC.

positron26 5 hours ago | parent | prev [-]

Leptos etc. WASM is mature enough to just go for it. Same code sharing arrangement as using TS on the backend but using the backend language on the frontend instead.

positron26 5 hours ago | parent | prev [-]

Yeah. You can bind C in swift. You can expose C interfaces from Rust. Write non-iOS code in Rust, then bind. Now you have iOS support with common client code in Rust.

You can compile Rust to WASM. You can run Rust on the backend. It's gaining popularity on k8s for memory consumption. You can write music visualizers in Rust. You can pivot to killer drones or embedded in Rust. It has very few foot guns compared to C and all of the advantages of C.

The people who want Swift to succeed off of Apple hardware are basically waiting for someone else to do it. Rust users will just invade Apple from every side. It is very clear which platform is the better investment of anyone's time.

I can't believe I'm even wasting keystrokes thinking about this. I saw a bunch of upvotes and can only imagine this has to be wishful thinking from Swift users.