Re:IBM says Swift is ready for the enterprise
by hellofunk on Monday September 26, 2016 @10:20AM
(#12581987)
Well, technically Swift's memory management is the same as what C++ offers via smart pointers, the only difference is that in C++ it is opt-in (and still very popular). Swift is quite unlike Go or Java's memory management; it is not a GC in the sense that they use it.
[ Parent
| on HN ]
Re:IBM says Swift is ready for the enterprise
by pcwalton on Monday September 26, 2016 @11:54AM
(#12582879)
Swift memory management isn't nearly as expressive as C++ when it comes to references (i.e. unmanaged pointers). You can use in/out/inout parameters on functions and that's about it.
I agree with the parent that Swift memory management is basically like Go or Java: everything is GC'd (reference counting being a form of GC).
Re:IBM says Swift is ready for the enterprise
by hellofunk on Monday September 26, 2016 @02:15PM
(#12584208)
You don't need in/out params to get references; in Swift, anything defined with "class" is always passed by reference.
Re:IBM says Swift is ready for the enterprise
by pcwalton on Monday September 26, 2016 @04:25PM
(#12585243)
Unmanaged references. Regular old class references aren't unmanaged (they adjust reference counts).
Re:IBM says Swift is ready for the enterprise
by themihai on Monday September 26, 2016 @12:34PM
(#12583271)
Swift does have a runtime though. In its current form I can't see it replacing C or C++. It may provide more deterministic performance than Go but it's not C. If it were to be designed as C replacement I would expect a roadmap for embedded environments, praise about its mapping to the hardware, how it trashes or at least matches C/C++ on its application domain(i.e. low level/ hardware interface or performance) etc but it's clear that is not the case and its focus is on "apps" first, servers second and maybe a bit of low level.