4 ms·
Swift can't replace Rust in system programming domain because he uses ARC for memory management but Rust gives you choices.
by cyber1 9y ago
Swift can't replace Rust in system programming domain because he uses ARC for memory management but Rust gives you choices.
- zerr 9y agoI don't think ARC is an issue here - it's just a deterministic reference counting - a la implicit using of smart pointers. Besides, Swift also has some unsafe pointer types as well.
- cyber1 9y agoYes, you right according to "deterministic" but you forget about overhead. Rust gives you more safe control on memory management and in most cases, you can always write the fast and efficient safe program without the overhead. Rust give different smart pointers and even sometimes when you 100% understand what are you doing you can use unsafe raw ptr.
- zerr 9y agoYes, there is a trade-off of course. I think Swift is in the middle on Usability - Safety axis (C++ being on the left and Rust on the right extremes).
- imtringued 9y agoFor certain programs a GC can basically make a programming language completely useless (no shared libraries with C abi, no realtime audio, videogames with stutter) regardless how fast the programming language is. This is not the case for swift. It's merely slower than rust.
- pjmlp 9y agoAlso to note that Swift has bindings to the 2D, 3D and real time audio APIs on Apple platforms.
- pjmlp 9y agoApple thinks otherwise on the context of their OSes.
- abiox 9y ago> system programming worth mentioning that this term has a broader meaning than how some rust evangelists use it.
- jdright 9y agoThe Rust "evangelists" version of system is most of the time the broader meaning of it as Rust do not exclude an entire class of systems as some languages out there.
- abiox 9y agoapologies, but i don't quite follow. what do you refer to by 'class of systems'? one common sentiment promulgated by rust evangelists is, for example, that go is 'not a systems language' because it has a GC. however, this definitional exclusion doesn't seem to align with (evidently broader) historical use of the term 'systems language'.
- jdright 9y agoReal real-time embedded systems, low-level operating system components, etc. are some kind of things that GC languages exclude completely, so by definition, the subset of "system programming" set is eliminated from use with ie. Go but not from Rust. Consequently, Rust has wider class of systems which makes it a true system programming language as C and C++.