Live data from Hacker News

Swift Achieved Dynamic Linking Where Rust Couldn't (2019)

faultlore.com

91–100 of 279 posts

Re: Swift Achieved Dynamic Linking Where Rust Couldn't (2019)

#91
post #75

Earlier quoted context omitted.

It's a bummer because I feel like I'd really like Swift if I felt it were a real, durable cross-platform language to spend time learning and using. Some of the trade-offs it makes seem really nice But I don't feel like Swift on non-Apple platforms will ever be more than a hobby for the Apple org

What's stopping you from using it on Linux, or your platform of choice? It seems to be supported well enough, and Vapor is a decent toolkit for building a webapp with it.

My understanding is that it's got second-class Linux support, for now. What happens when Apple loses interest? What about Windows? I don't get a sense of commitment from them outside of their own platforms, and that doesn't make me want to commit to learning or starting major projects in the language (outside of their platforms). If I can't have faith my project's foundation will continue to be solid, then I don't want to build it there; if I know I'll never have an employer who wants to let me use Swift (again, outside of Apple apps) then I don't really want to invest the time to deeply learn it (unless I'm going all-in on Apple apps)

I could do a toy project or an iOS app with it, and maybe I will some day, but it's hard for me to feel like it's worth going past that while this is the feeling I'm getting from Apple

(And I'm not really even blaming/judging them here; it makes total sense they would want to have a modern in-house language that's perfectly integrated with their systems and now their chipsets, and lets them ship more effectively. They don't owe anyone more than that. It's just a shame, for me personally, to think about what else could have been)

Re: Swift Achieved Dynamic Linking Where Rust Couldn't (2019)

#92
post #43

A lot of people who are invested in the Apple ecosystem have been trying to present Swift as a general competitor to Rust, but no matter how many bullet points you list, as far as I can tell, it hasn't made any progress at all on that front, and I haven't been convinced that it will change to become closer to that any time soon, either. As far as I can tell, there's really nothing wrong with Swift, and it probably ha…

[deleted]

Re: Swift Achieved Dynamic Linking Where Rust Couldn't (2019)

#93

I have heard great things about Swift but haven't spent a second looking into it because I assumed it's an Apple exclusive language - making it unsuitable for my use case of services deployed on Linux, developed from any OS. To what extent, if any, is Swift exclusive to Apple devices?

[deleted]

Re: Swift Achieved Dynamic Linking Where Rust Couldn't (2019)

#94
post #93

I have heard great things about Swift but haven't spent a second looking into it because I assumed it's an Apple exclusive language - making it unsuitable for my use case of services deployed on Linux, developed from any OS. To what extent, if any, is Swift exclusive to Apple devices?

[deleted]

[deleted]

Re: Swift Achieved Dynamic Linking Where Rust Couldn't (2019)

#96
post #22

Earlier quoted context omitted.

I see no reason for Apple to ever make the UI stuff available on other platforms, I can’t see how that would benefit them. But there’s nothing stopping other UI libraries from making Swift bindings.

Apple surely must run a lot of linux machines internally, I imagine it would be nice for them to have internal services written in swift

That’s my understanding of why it’s on Linux (besides the community).

Apple uses tons of Linux servers, cloud and DC. Swift means they can write high performance networking stuff with memory safety and modern features in a language/library they already use internally instead of using yet another new language (or losing safety with C/C++/Obj-C).

Makes a lot of sense to me.

Re: Swift Achieved Dynamic Linking Where Rust Couldn't (2019)

#97

Could someone help explain the difference between Rust ARC (Atomically Reference Counted) vs. Switch ARC (Automatic Reference Counting)? Do the language designers intentionally chosen the same acronym to confuse us?

Rust's Arc is very similar to C++'s shared_ptr. It's a generic container type, which does reference counting on the inside.

I haven't written Swift, but I believe reference counting is mostly automatic and transparent there, more like a GC strategy than like a container.

Not sure whether anyone's to blame for the name collision :)

Re: Swift Achieved Dynamic Linking Where Rust Couldn't (2019)

#98
post #43

A lot of people who are invested in the Apple ecosystem have been trying to present Swift as a general competitor to Rust, but no matter how many bullet points you list, as far as I can tell, it hasn't made any progress at all on that front, and I haven't been convinced that it will change to become closer to that any time soon, either. As far as I can tell, there's really nothing wrong with Swift, and it probably ha…

People are busy using Swift rather than trying to religiously advocate for Rust on various websites

One example:

Arc is a webkit powered browser written in swift and is crossplatform: https://twitter.com/hursh/status/1612472691747090432

Re: Swift Achieved Dynamic Linking Where Rust Couldn't (2019)

#99
post #58

Earlier quoted context omitted.

That's definitely the elephant in the room. And the fact that it does not have clean and easy C integration. If you could do direct memory stuff and control the ARC stuff, and easily integrate with C ... ... and the docs were clean, and you could easily use something other than XCode ... Then Swift would be huge. It's a neat language but it's just not designed to go beyond Mac. The entire C++ world would move away in…

What do you mean about rust being too specific for most things? It seems like a fairly obvious choic for c++ replacement in a new project, the issue is large c++ codebases already exist, and that migration is painful in my experience. Autocxx type support is still largely missing or in work, diplomat seems reasonable, but I haven't had an opportunity to use it for something real yet.

I think for Rust to truly replace C++, it needs a better dynamic linking story. I wish they would make their ABI stable within a given edition. That would make it much easier for people to rely on dynamic linking, similar to how C++ does it. Without it, Rust binaries are quite huge.

Re: Swift Achieved Dynamic Linking Where Rust Couldn't (2019)

#100

Could someone help explain the difference between Rust ARC (Atomically Reference Counted) vs. Switch ARC (Automatic Reference Counting)? Do the language designers intentionally chosen the same acronym to confuse us?

The designers and implementors are just using standard terminology in the field. In both cases where the concept applies, the underlying objects are being reference counted, with counts being atomically incremented/decremented to allow for thread safety.

Swift builds the behaviour into the language runtime for objects where the behaviour applies, while Rust eschews language runtimes and provides it as an explicit wrapper structure in its standard library.

Post reply on HN