←back to thread

Introducing tmux-rs

(richardscollin.github.io)
857 points Jtsummers | 2 comments | | HN request time: 0.409s | source
Show context
uecker ◴[] No.44456333[source]
I like this post, one can learn a lot.

It seems automatically translating Rust to C is not a very good idea: "I threw away all of the C2Rust output and decided I would translate all of the files into Rust manually from C.". Neither seems doing it manually: "I introduced many bugs while translating the code. I’d like to share the process of discovering and fixing a couple." Or using AI: "That’s because when using cursor to translate the code it would still occasionally insert bugs, just like me. So, I spent as much time reviewing the generated code as it would have taken me to write it myself."

As a hobby project, all power to you. But otherwise, maybe better not rewrite working code....

replies(4): >>44456413 #>>44456755 #>>44459370 #>>44459965 #
antonvs ◴[] No.44456755[source]
> But otherwise, maybe better not rewrite working code....

Except that the eventual result allows for extension and improvements in a memory-safe language.

replies(2): >>44456866 #>>44458838 #
uecker ◴[] No.44456866[source]
There seems to be some rather irrational obsession about this.
replies(2): >>44456899 #>>44457353 #
wat10000 ◴[] No.44457353[source]
It comes from the fact that nearly every useful program written in C has multiple security vulnerabilities just waiting to be found. In the unlikely event that you have a codebase that's free of them, you risk introducing one with any significant change.
replies(2): >>44458107 #>>44458499 #
1. ozgrakkurt ◴[] No.44458499[source]
As someone using rust for over 7 years and recently switched to zig for personal projects, there is a lot of nuance. Yes rust is very reliable, it is really good even if you set memory safety aspect aside. But developing in rust is just so painful compared to using a simple language like c or zig and just enjoying the process.

Also dev time is massively shorter and the time I gain is spent on adding more features and tests.

Would recommend building low level projects in something like zig, if you care about build time and don’t want to use a dependency for everything.

replies(1): >>44458942 #
2. wat10000 ◴[] No.44458942[source]
I like C and various parts of C++ and I'm still writing new code in those languages. But for any component that could be exposed to malicious data, security is a never-ending game of whack-a-mole. I'm not saying everyone must move away, just that when people do, this is a big reason why.