Originally posted by NateHubbard
View Post
Fish Shell Outlines Their Successes & Challenges Going From C++ To Rust
Collapse
X
-
Originally posted by lowflyer View PostIt's sad to see such commonplace unspecific "reports" from the development. They say:
As a C++ developer I am very much interested in exactly which features they found easier/less annoying in rust.
The whole thing really just looks like another attempt to bash C++.
Despite our commitment to using safe patterns in C++ we are fallible humans, the most experienced C and C++ devs I've had the pleasure of working with readily admit that. Might as well let that powerful CPU+compiler spend cycles taking care of object lifetimes and shared data access for us so we can concentrate on the logic.
Comment
-
-
Hmm, I don't know... how to start this without starting another vim vs emacs... uh, I mean, rust vs c++ war? Some already know me as a kernel dev criticizing the shit out of everything. For the ones who didn't came across me yet. I'm a mainline kernel dev, means I'm a C guy and yes, also writing a tons of libs and apps using C++. I also code using Rust, Zig and since GCC 13.2 I started to have a lot of fun coding Modula-2. I even ended up being also a GCC dev fixing and enhancing the Modula-2 frontend. Well, I have fun. I also retry my kernel stuff in Rust where possible (the kernel does not support Rust everywhere yet), just to be able to have more perspectives about the issues. I actually follow two rules, "there is a proper tool for a specific problem" and "ignore the hype". And I must admit, I don't get the Rust guys, and I don't get the C++ guys, either. Yes, C++ is unsafe, especially if you have a fucking skill issue. And this is on purpose, because at the same time C++ is more flexible than Rust. Don't believe me? Implement a fast double linked list example and we speak again. But Rust is memory safe! Uhm, just search github for "memory leak rust example" (or similar). It is something like a contest now on how to find the funniest and most simple way to show how Rust fucks up.
Ah well, and here comes my fish shell in Rust critique:
Code:/tmp % git clone https://github.com/fish-shell/fish-shell.git /tmp % cd fish-shell /tmp/fish-shell (git)-[master] % git tag ... /tmp/fish-shell (git)-[master] % git checkout 4.0b1 /tmp/fish-shell (git)-[tags/4.0b1] % cargo build --release ... Compiling rust-embed v8.5.0 Finished `release` profile [optimized] target(s) in 47.66sā /tmp/fish-shell (git)-[tags/4.0b1] % ldd target/release/fish linux-vdso.so.1 (0x000072842ee0a000) libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x000072842e45d000) libpcre2-32.so.0 => /usr/lib/libpcre2-32.so.0 (0x000072842e3d2000) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x000072842e3a5000) libm.so.6 => /usr/lib/libm.so.6 (0x000072842e2b6000) libc.so.6 => /usr/lib/libc.so.6 (0x000072842e0c5000) /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x000072842ee0c000)ā /tmp/fish-shell (git)-[tags/4.0b1] % cargo --version cargo 1.83.0 (5ffbef321 2024-10-29)ā
Last edited by Akiko; 29 December 2024, 01:59 PM.
Comment
-
-
Originally posted by Akiko View PostHmm, I don't know... how to start this without starting another vim vs emacs... uh, I mean, rust vs c++ war? Some already know me as a kernel dev criticizing the shit out of everything. For the ones who didn't came across me yet. I'm a mainline kernel dev, means I'm a C guy and yes, also writing a tons of libs and apps using C++. I also code using Rust, Zig and since GCC 13.2 I started to have a lot of fun coding Modula-2. I even ended up being also a GCC dev fixing and enhancing the Modula-2 frontend. Well, I have fun. I also retry my kernel stuff in Rust where possible (the kernel does not support Rust everywhere yet), just to be able to have more perspectives about the issues. I actually follow two rules, "there is a proper tool for a specific problem" and "ignore the hype". And I must admit, I don't get the Rust guys, and I don't get the C++ guys, either. Yes, C++ is unsafe, especially if you have a fucking skill issue. And this is on purpose, because at the same time C++ is more flexible than Rust. Don't believe me? Implement a fast double linked list example and we speak again. But Rust is memory safe! Uhm, just search github for "memory leak rust example" (or similar). It is something like a contest now on how to find the funniest and most simple way to show how Rust fucks up.
Ah well, and here comes my fish shell in Rust critique:
Code:/tmp % git clone https://github.com/fish-shell/fish-shell.git /tmp % cd fish-shell /tmp/fish-shell (git)-[master] % git tag ... /tmp/fish-shell (git)-[master] % git checkout 4.0b1 /tmp/fish-shell (git)-[tags/4.0b1] % cargo build --release ... Compiling rust-embed v8.5.0 Finished `release` profile [optimized] target(s) in 47.66sā /tmp/fish-shell (git)-[tags/4.0b1] % ldd target/release/fish linux-vdso.so.1 (0x000072842ee0a000) libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x000072842e45d000) libpcre2-32.so.0 => /usr/lib/libpcre2-32.so.0 (0x000072842e3d2000) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x000072842e3a5000) libm.so.6 => /usr/lib/libm.so.6 (0x000072842e2b6000) libc.so.6 => /usr/lib/libc.so.6 (0x000072842e0c5000) /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x000072842ee0c000)ā /tmp/fish-shell (git)-[tags/4.0b1] % cargo --version cargo 1.83.0 (5ffbef321 2024-10-29)ā
I like C so much more than C++, and from the outside it really does seem like Rust is trying to be a more functional, "better" C++, while Zig just wants to improve C ergonomics.
Also, have you taken a glance at C3? I read a few interesting bits about the language, but haven't even opened the documentation even if to see subtitles...
Comment
-
-
Originally posted by DumbFsck View Post
From your specific POV, what are some of your general opinions on Zig?
Comment
-
-
A good crate can still have limited and targeted use of "unsafe" in performance-critical areas. This doesn't defeat the purpose of all of Rust's safeties, and isn't a "downside" compared to other languages that provide no guarantees at all.
Just use cargo geiger to audit the use of unsafe in a crate and its dependency tree.
Comment
-
Comment