Hacker News new | ask | show | jobs
by berkes 1090 days ago
> using a language which is far more complicated, less clear, and readable/reviewable to far fewer people?

By that reasoning we should rewrite all these tools in JavaScript or Ruby, Python or some such. Clearer (than C), more readable and readable/reviewable to far more people.

Edit: to be clear: I think that would be an extremely dumb idea.

2 comments

> By that reasoning we should rewrite all these tools in JavaScript or Ruby, Python or some such. Clearer (than C), more readable and readable/reviewable to far more people.

> Edit: to be clear: I think that would be an extremely dumb idea.

I dunno if it really is that dumb.

Why can't sudo be rewritten in Go? The performance difference is not likely to be noticed and there's no runtime platform dependence (as with Python, et al).

And, with managed memory, you'll have even fewer memory-safety bugs than with Rust.

What exactly makes Rust a better fit for sudo than Go, bearing in mind that Go is a whole lot safer than Rust.

How is Go a lot safer than rust?
Any GC language is a lot safer than Rust.

Seriously, anytime you have to manage memory yourself it's going to include the danger that you mismanage it. Rust does not prevent all types of memory mismanagement.

What's more, the burden is on the programmer to manage memory; all the Rust compiler tells you is where there are potential (not actual) memory errors. The programmer still has to fix them, and even with that there are still a number of memory errors that will get through.

Compare to a GC - allocate an object and then forget about it. No problems at all.

All of JS, Ruby, and Python are vastly more complicated languages than C. They do have a shallower learning curve. It's unclear to me what degree they have a bigger review audience: there are an awful lot of write-only JS programmers! :)