Hacker News new | ask | show | jobs
by khamidou 262 days ago
> If all the kids love Rust and hate C, then perhaps a switch to Rust might be a necessary evil to ensure we'll have well-maintained coreutils for another generation. You still need to be careful to avoid the fad of the day, but I think it's pretty clear by now that Rust is here to stay.

It's very unclear – to me it seems more like there's a vocal minority on people on here commenting on every C post "someone should rewrite this in a memory-safe language".

People tend to forget that C got so popular because it had very simple semantics (with much UBI ofc). Golang is arguably more popular than rust, has much simpler semantics and is much easier to pick up.

In all my years in tech I've rarely seen a more complex tool beat a simpler one (otherwise we'd all be using VMS), I'm not holding my breath for rust's longevity.

2 comments

Plenty of complex tools have beaten simple ones, especially when it alleviates some other form of complexity.

Version control beat handing around labelled floppies, despite being far more complex, since it's still easier than managing state by hand.

I wouldn't be surprised if rust replaced C for similar reasons. It might be syntactically more complex, but it's still far simpler than stopping your library from being a beginner pwn exercise at a local CTF.

If I understand correctly, in your analogy, golang is floppies and rust is a sophisticated version control system? lol
Golang doesn't fill quite the same niche, though: it's garbage collected, for example. I'd personally question whether we need the main pros of C for basic command line tools (that's a topic for another time), but it does explain why we're seeing far fewer "rewrite it in Go" sentiment. If memory safety was the only relevant metric, we would've rewritten everything in Java decades ago.

Language simplicity also isn't that important. Usage-wise you're missing out on a lot of potential features and benefits, and implementation-wise you're not gaining a lot as everyone just writes LLVM frontends these days. If language simplicity was that important, we'd all be writing Lisp these days.

> If memory safety was the only relevant metric, we would've rewritten everything in Java decades ago.

well for a good 15-20 years the jvm had awful startup times which probably was why it was not attractive as a systems language. Does being garbage collected matter for a tool like cat? I would say no