Live data from Hacker News

Rust vs C Pitfalls

garin.io

51–60 of 379 posts

Re: Rust vs C Pitfalls

#51
post #25
post #15

>

That counts as a personal attack, and those are not allowed on HN—especially not against brand new users, which most new accounts belong to. Please don't do this again. We detached this subthread from https://news.ycombinator.com/item?id=13266687 and marked it off-topic.

Let's get real, this looks like classic astroturfing to me. (edit: ok, it was not)

Re: Rust vs C Pitfalls

#52
post #13

The kind of safety guarantees Rust provides are, in my opinion, insufficient justification for experienced developers to move from C or C++. Rust has other features that make it generally superior in certain (many) contexts. The safety is a nice "add-on" effect, I suppose, but my view is that constantly hyping safety as the biggest selling point is missing a mark.

I completely agree. The biggest reason I haven't seriously tried Rust yet is because, despite all the vocal pro-Rust opinions we've all been inundated lately, I struggle to name a single interesting thing about the language apart from "safety". I wish the Rust evangelists would come to terms with the fact that to many developers memory safety is not a particularly important concern (for many different and often very…

Rust did a nice job with algebraic data types. Haxe has a very similar approach, and I've loved it since I first saw it. I think this is a very elegant way to define data structures. I listed plenty of complaints about Rust in my other comment, but this one stands out as a "single interesting thing" worthy of praise.

Re: Rust vs C Pitfalls

#53
post #19
post #13

The kind of safety guarantees Rust provides are, in my opinion, insufficient justification for experienced developers to move from C or C++. Rust has other features that make it generally superior in certain (many) contexts. The safety is a nice "add-on" effect, I suppose, but my view is that constantly hyping safety as the biggest selling point is missing a mark.

If only these mythical experienced developers that never shoot themselves in the foot actually existed.

> If only these mythical experienced developers that never shoot themselves in the foot actually existed.

Rust is a great language, but people have to stop "marketing" it by saying things like: no matter how great you are with C, you're going to fuck up at some point, so that's why you should be using Rust. Like Go or whatever other language, the main grab needs to be a positive: you know what you're doing, and here's how (a, b, c... etc.) Rust will make you even better at what you do.

Another point, it's safe to say C isn't going away anytime soon, it sits nicely at the next approximately natural level (in abstraction) above assembly. That was a design point in the language. Yes it can be a rough tool to use, but that's a reality when you get closer to the metal. You get tremendous flexibility and that comes at a price, as all things do.

Re: Rust vs C Pitfalls

#54
post #32

Earlier quoted context omitted.

I doubt that a significant amount of C programmers will switch to Rust. On the other hand, rust is very attractive for us C++ programmers.

To me it's almost the opposite. I like C a lot, but I ended up compromising on C++11 because in some programs I need more features to keep the implementation clean. I pay the cost of a messy language (C++) when implementing my libraries in order to have simpler applications that use those libraries. I've written C-like programs in Rust, and that goes very well. But I really like function overloading, generic operator…

> But I really like function overloading, generic operators that I can overload from the left and the right, integer parameters for my templates/generics, copy semantics as the default [etc.]

I do too, and I'd like to think that rust needs all those things to be a replacement, but realistically I think that the only killer feature that rust is still missing is reasonable interoperability with C++ (which admittedly might require implementing a few of those features).

Disclaimer: I have been following rust since Graydon initial announcement, but I have yet to write a single line of code in it.

Re: Rust vs C Pitfalls

#55

Earlier quoted context omitted.

> What do you feel is actually missing from Rust? A solid NumPy-like library, for one.

Like you I need something like NumPy and SciPy for my work. I'd also like an IDE. An IDE goes a long way to helping me feel comfortable to use a language.

Rust's had great IDE support for more than a year now.

- There's Atom with Tokamak, which you must also install racer and clippy via cargo to get rapid in-line linting.

- Then there's Visual Studio Code with RustyCode which you can also integrate with racer and clippy, that provides faster code completion and hovering over items will show a tooltip that documents that items.

- Some people like IntelliJ Rust, but I've not tried it myself.

As for installing racer and clippy, it's been made a lot easier recently via rustup:

rustup component add rust-src

rustup component add rust-docs

rustup toolchain install nightly

rustup run nightly cargo install clippy

rustup run nightly cargo install racer

Now you're good to go.

As for NumPy, there's official crates like the `num` family, which provides a plethora of useful numerics capabilities. It's not my forte though so others would know more about the best numerics crates outside of the `num` family. If you know what functionality you are looking for, it may already be created and is searchable at Crates.io.

Re: Rust vs C Pitfalls

#56
post #26

Earlier quoted context omitted.

I'm terribly sorry you've never encountered an experienced developer who uses C or C++ before, or think we're non-existent, or that using extremes like "never" is a reasonable position instead of an incredibly terrible hasty generalization. If there were as many blown off feet as comments on HN suggested technology even as it currently is simply wouldn't function. Do you even understand how much mission and safety cr…

No one has ever argued that it's impossible to write c code, but just because you haven't found those kinds of bugs in your code, doesn't mean that it isn't there. We're still finding 10+ year old bugs in Linux.

I'd like to see if Rust is still around in 10 years and then look before we declare the winner on this.... All software has bugs.

Re: Rust vs C Pitfalls

#57
post #2

If you're fighting, you've lost. The way to convert everyone to Rust you need to be better the the competition. Not just better as in "look at my features that will make your code safer". People may see the value but think "I get on just fine without the borrow checker so it isn't too important". You need to be far better then the replacement by providing the following: * Great Tooling ( IDEs ) * Great Libraries ( Ev…

It's very rare that any programmer switches computer languages. You're probably going to retire as a c programmer. What are they going to teach in school? What are new systems programmers going to start with? I suspect it'll be rust and go, not c.

[deleted]

Re: Rust vs C Pitfalls

#58

Earlier quoted context omitted.

Rust has gc, no?

Depends on your Rust implementation. You can have an implementation without one and use it to make, say, an operating system.

There is only one implementation of Rust, and it does not have tracing GC. The language does not include semantics for one, so it would be an extension of the language.

Re: Rust vs C Pitfalls

#59
post #10

Earlier quoted context omitted.

Rust has by far the best tooling and documentation support out of all languages I've seen. Library support is great too, at least in that Cargo is an amazing platform and it's too easy to import C libraries. What do you feel is actually missing from Rust? Nothing has stopped me from replacing C entirely on the low end, and even the high end for application software development.

> What do you feel is actually missing from Rust? A solid NumPy-like library, for one.

There does exist an entire family of official `num` crates. Chances are that what you are searching for is already done.

Re: Rust vs C Pitfalls

#60
post #4
post #2

If you're fighting, you've lost. The way to convert everyone to Rust you need to be better the the competition. Not just better as in "look at my features that will make your code safer". People may see the value but think "I get on just fine without the borrow checker so it isn't too important". You need to be far better then the replacement by providing the following: * Great Tooling ( IDEs ) * Great Libraries ( Ev…

Well, I can't speak for tooling or productivity comparison to C/C++, but Rust has one of the best programming language documentations I have ever had the pleasure of reading [1]. [1] https://doc.rust-lang.org/stable/book/

Thank you! Carol and I are working on the second edition, you can read what we have so far here: http://rust-lang.github.io/book/

(I think it's even better, but I'm biased)

Post reply on HN