3 ms·
Swift has a nice mix of features that allows you to write pretty close to functional while also allowing you to write code that compiles to the same code as equ
by dep_b 8y ago
Swift has a nice mix of features that allows you to write pretty close to functional while also allowing you to write code that compiles to the same code as equivalent C (albeit a bit more verbose).
I don't think there are any languages out there outside of Rust (which has it's own niche since Swift is ARC and Rust is more or less manual) that does the same.
F# should get a bit more love by Microsoft.
- pjmlp 8y agoARC is just a GC implementation algorithm with a couple of compiler optimizations to reduce counting operations. Plenty of GC books describe such algorithms, including the canonical "The Garbage Collection Handbook". All the languages I referred do compile to native code as well. So you can also check the generated Assembly, just like with C. They also do provide ways of doing C pointer style tricks, use value type allocations or manual memory management. Then there is ATS and ML Kit as well. As language greek I do like Swift, but it isn't really meaningful outside Apple's ecosystem.