▲ 86 ▼ 'Rust makes coding fun again': Why Linux is moving away from C, according to Greg Kroah-Hartman (www.zdnet.com) submitted 1 month ago by cm0002@suppo.fi to c/linux@programming.dev 26 comments fedilink hide all child comments
[–] victorz@lemmy.world 3 points 1 month ago (2 children) For the same purpose, would you recommend Rust over Zig? permalink fedilink source parent hideshow 4 child comments replies: [–] mschae@discuss.mschae23.de 13 points 1 month ago (2 children) As someone who has used both (but not for any serious, large projects), I'd say they target different audiences. First and foremost, Zig is not memory-safe in the way Rust is. On the other hand, Zig is way easier to write than unsafe Rust. Rust comes with a lot of features and libraries, while Zig is an intentionally small language, almost minimalistic (kind of like C, but modern). There are lots of different tradeoffs being made, so yes, I'll give the boring answer and say they are good for different kinds of projects :) If it's specifically low level programming (I'm envisioning programs where you need fairly direct control over memory, IO, etc.), you'd probably quickly need a lot of unsafe in Rust, which can quickly get very complicated to use safely. So I'd probably recommend Zig for that purpose. permalink fedilink source parent hideshow 4 child comments replies: [–] victorz@lemmy.world 5 points 1 month ago I should've known it's a "it depends" answer. 😆 It's programming languages after all. 😉 Thanks for the insight though, I appreciate it! 🙏 permalink fedilink source parent [–] farooqkz@realbitcoin.cash 2 points 1 month ago Thank you so much for sharing this. I always wondered about Zig :) permalink fedilink source parent [–] psud@aussie.zone 1 point 1 month ago (1 child) I know nothing about Zig permalink fedilink source parent hideshow 2 child comments replies: [–] victorz@lemmy.world 1 point 1 month ago Alright, thank you. permalink fedilink source parent
[–] mschae@discuss.mschae23.de 13 points 1 month ago (2 children) As someone who has used both (but not for any serious, large projects), I'd say they target different audiences. First and foremost, Zig is not memory-safe in the way Rust is. On the other hand, Zig is way easier to write than unsafe Rust. Rust comes with a lot of features and libraries, while Zig is an intentionally small language, almost minimalistic (kind of like C, but modern). There are lots of different tradeoffs being made, so yes, I'll give the boring answer and say they are good for different kinds of projects :) If it's specifically low level programming (I'm envisioning programs where you need fairly direct control over memory, IO, etc.), you'd probably quickly need a lot of unsafe in Rust, which can quickly get very complicated to use safely. So I'd probably recommend Zig for that purpose. permalink fedilink source parent hideshow 4 child comments replies: [–] victorz@lemmy.world 5 points 1 month ago I should've known it's a "it depends" answer. 😆 It's programming languages after all. 😉 Thanks for the insight though, I appreciate it! 🙏 permalink fedilink source parent [–] farooqkz@realbitcoin.cash 2 points 1 month ago Thank you so much for sharing this. I always wondered about Zig :) permalink fedilink source parent
[–] victorz@lemmy.world 5 points 1 month ago I should've known it's a "it depends" answer. 😆 It's programming languages after all. 😉 Thanks for the insight though, I appreciate it! 🙏 permalink fedilink source parent
[–] farooqkz@realbitcoin.cash 2 points 1 month ago Thank you so much for sharing this. I always wondered about Zig :) permalink fedilink source parent
[–] psud@aussie.zone 1 point 1 month ago (1 child) I know nothing about Zig permalink fedilink source parent hideshow 2 child comments replies: [–] victorz@lemmy.world 1 point 1 month ago Alright, thank you. permalink fedilink source parent