5 ms·
There will always be unsafe and often be C dependencies. There is no community goal or plan to do away with unsafe. Until we have an easy to use fully dependen
by Avi-D-coder 6y ago
There will always be unsafe and often be C dependencies.
There is no community goal or plan to do away with unsafe. Until we have an easy to use fully dependent and linearly typed language, there will be some degree of unsafety. Even if Idris 3 and ATS 4 come out with magical proof inference, we will assert many more complicated proofs.
- dragonsh 6y agoRust community has been very vocal placing Rust as C replacement and based on your statement it is not. So it’s better for systems programmer to first focus on C/C++ to be closer to hardware and when needs some higher level work look at Rust for writing higher level libraries not dealing directly with hardware.
- dbaupp 6y agoThe grandparent didn’t say anything about why C dependencies will often exist: in almost all cases, it is not because they must exist due to missing functionality in Rust, but because it is easier to use a C library than rewrite/translate into Rust. Once someone has done that process (or implemented something equivalent), using a pure Rust dependency is nicer for many reasons, but reimplementing a complicated library is always hard, no matter the language used.
- dragonsh 6y ago> it is not because they must exist due to missing functionality in Rust This is the precise reason, Rust is a decade or two away from being a useful replacement for C/C++ like other contending systems programming language like go and Swift which are at present more popular than Rust for writing systems program for networking, servers and controlling Apple hardware directly.
- Avi-D-coder 6y agoZig, Nim, Crystal, Go and Swift all use C libraries extensively. Nim and Zig even make lower boiler plate C inter-op a key selling point. Mozilla, Microsoft, Amazon, Apple and other's investments in Rust, clearly demonstrate the value of writing new systems software in Rust, alongside and inside existing C/C++ code bases. Rust is clearly monetarily useful, despite not being a systems programing panacea.
- dragonsh 6y agoThe difference is most of those language don’t proclaim to replace C and are explicit in support of C. Rust evangelist promote Rust as replacement for C and frown upon anyone who has a contrary view including direct attack on those opinion. Rust has a value like other programming languages and not a panacea As you said, it’s just not a C replacement for another decade or two or may be never.
- Avi-D-coder 6y agoZig is attempts to be a C replacement candidate, like Rust. What would make Rust or Zig a valid replacement in your opinion?