Hacker News new | ask | show | jobs
by e63f67dd-065b 731 days ago
I'm primarily a C++ developer these days, and if the C++ interop is actually good then I'm very excited for the future. For app-dev type stuff it really does seem like it's better than Rust, and I can definitely see a world where we start migrating some code into Swift.

Edit: back from watching the video, and a few observations:

- Swift does not suffer from Rust's refusal to add things into the standard library. gasp regex support in stdlib? Async/await runtimes?

- Default testing framework is a godsend, especially when integrated into the build system

- Rust but better for everything that's not low-level systems development is the impression I get

3 comments

I'm not a (direct) user of the C++ interop, but everything I've heard about it has been quite positive. A few hopefully relevant resources, first a couple of videos:

- "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" (John McCall; CppNow 2023) https://www.youtube.com/watch?v=lgivCGdmFrw

- "Swift as C++ Successor in FoundationDB" (Konrad Malawski; Strange Loop 2023) https://www.youtube.com/watch?v=ZQc9-seU-5k

And then a series of blog posts by Doug Gregor:

- "Swift for C++ Practitioners" https://www.douggregor.net/posts/

And finally:

- "Mixing Swift and C++" (Swift.org) https://www.swift.org/documentation/cxx-interop/

Apple is using it for some low-level stuff and they appear to be trying to improve that every year.

I think they want to be able to use a limited subset of it in their kernel. Actually I think they already are but I’m not positive.

Obviously it started as an application level language but I do think they’re trying to move it down the stack as well.

The default testing framework made my jaw drop a bit - I have a very hard time seeing Rust have the enthusiasm or momentum to implement something like that right now.
But Rust has had a default testing framework since 1.0?
Why do you think they wouldn't? (I don't keep up with Rust+its community closely enough to know.)