←back to thread

Introducing tmux-rs

(richardscollin.github.io)
861 points Jtsummers | 6 comments | | HN request time: 1.255s | source | bottom
1. ◴[] No.44457515[source]
2. jonpalmisc ◴[] No.44457553[source]
I don't think anyone is suggesting that the generated Rust is nicer than the original C.

It is auto-generated with the purpose of maintaining the exact same semantics as the C code, with no regard to safety, best practices, etc.—of course it is messier than actual, handwritten Rust.

As c2rust says in its documentation [1], it's meant to be the first step in an otherwise manual and incremental port of a codebase from C to Rust, and the author recognizes this in their closing remarks:

> The next goal is to convert the codebase to safe Rust.

[1] https://github.com/immunant/c2rust/raw/master/docs/c2rust-ov...

replies(1): >>44458625 #
3. _danielle_ ◴[] No.44457563[source]
I mean what else would you expect when C is ported directly to Rust? Rust programs typically aren't written anything like C programs are.
replies(1): >>44458498 #
4. Jaxan ◴[] No.44457828[source]
You should read one paragraph further. They did use c2rust but found it really bad and threw that out of the window. Then did it manually. So in the end it is not c2rust.
replies(1): >>44458494 #
5. _danielle_ ◴[] No.44458949{3}[source]
Then why make the original comment? :')
replies(1): >>44463166 #
6. johnisgood ◴[] No.44463166{4}[source]
I was stating facts. It is a c2rust project. I do not care about some image they used. I want to see results. For now, it is definitely a c2rust project.

It is not a good look on the community that comments that quote this get flagged:

> https://github.com/richardscollin/tmux-rs/issues/9

> 120 comments and nobody has mentioned the use-after-free triggered by closing a window. Rust truly is the safest language.

Whatever floats your (or their) boat though.

If you have anything against the quote, engage instead of down-voting, or am I expecting much?

And for what it is worth, let me quote the article:

> For the 6 months or so I’ve been quietly porting tmux from C to Rust. I’ve recently reached a big milestone: the code base is now 100% (unsafe) Rust. I’d like to share the process of porting the original codebase from ~67,000 lines of C code to ~81,000 lines of Rust (excluding comments and empty lines). You might be asking: why did you rewrite tmux in Rust? And yeah, I don’t really have a good reason. It’s a hobby project. Like gardening, but with more segfaults.

Don't you think this is slightly amusing? :D I cannot tell if this is satire or not, by the way.

6 months!