Hacker News new | ask | show | jobs
by gnu 3771 days ago
Rust is nice. But the article miss one important point. Modern software engineering is a collaborative effort (well, it has always been, afaik). I write code for others to understand. I find Rust code significantly hard to read (I am saying this as an experienced C/C++ programmer and as an intermediate haskeller). Yes, one can write write-only code in any language. I think it is extremely important to write code that others can understand and imho, it trumps all other reasons. Not trying to underplay the value of type safety. It is fantastic. My Haskell programs have much much less bugs and I tend to get it to work, much faster than when I do C/C++ code. I would expect some of that goodness to be in Rust programming as well.

It would have been fantastic, if Rust took only a few steps further from Cyclone. I also wish that Rust authors stop adding more and more features. The target audience, namely low level system programmers, tend to work close to hardware and think along those lines, so bombarding them with type theory concepts is only going to shoo them away.

Just my 2 cents.

4 comments

And as a Rust and Python programmer, I find C++ hard to read (I can never shake the feeling that the ampersands are always in the wrong place), and I'm nearly hopeless at deciphering Haskell. :P I suppose this is just something that comes with experience.
Haskell syntax is really nowhere near as complex as C++'s or even Rust's. It's not indecipherable, it's just different and not C-like. It's in the same family as SML, OCaml and F# so if you learn one of those, the others come easily.
I suspect Haskell's syntax isn't as much of an issue as the typical style that Haskell code tends to be written in; really short, abbreviated variable names, and very high code density.
Indeed, this isn't meant as a knock against Haskell in particular, merely an observation on unfamiliarity. :)
It's also missing the important point that rewrites don't happen just by talking about them and making grandiose statements.

I counted about two people in the entire thread that have actually written code to support this much desired rewrite. The rest are chitchatting.

  > I also wish that Rust authors stop adding more and more 
  > features.
I'm not sure what this is referring to. Rust hasn't added any features since the stable 1.0 release last May, and I also don't believe it added any features in the six-month beta period prior to that. And it's not an especially feature-heavy language in the first place, likely comparable in size to Python (e.g. a medium-sized language).
I was referring to the RFCs. They also seem to include language changes. Happy to be proved wrong.
We have and will add language features; though we haven't added any HUGE things in a while. You are right that RFCs contain language changes. A lot of them are small. Some of them are big, and there's certainly more big ones on the horizon.
May I ask what those big ones are? How is it going to affect/improve the life of a systems programmer?
The most recent one off the top of my head is the ? syntax RFC, which should reduce the amount of error-handling boilerplate.

The big ones though are:

* Specialization. This will allow you to write ultra-performent generic code by special-casing when you have the knowledge. It also will be a building block for the next few features.

* The bag of features colloquially known as "inheritance", though that's not really a good name.

* Non-lexical borrowing, and various other borrowck usability improvements.

* Abstract return types, which will allow for you to remove some allocation and make certain type signatures much better.

* Incremental compilation.

Those are the ones on the short list. There are others too, like higher kinded types.

Great. They all look great. The ones like higher kinded types are the ones that I am highly suspicious of. The typical C programmer who pokes around hardware data sheets and writes drivers and stuff will likely not pay much attention to Rust if such complex features are added.

Also features like that makes me wonder if you folks are really targeting C/System programmers. Sorry if I sound negative, that isn't my intention.

Another gripe I have is that the Rust Book examples are all targeted at non-system programmers. It would have been nice if certain programs written in K&R book or from one of those books from the Bell Labs Unix folks (like "The practice of programming" or "software tools") is written in Rust as a demonstration.
You should be much happier with the second edition of the book.

(One of the reasons it's this way is largely historic: so much was changing in the lead-up to 1.0 that I couldn't add many examples, as things kept changing out from under me.)

Thanks. Where can I see the second edition draft?

edit: This one? https://github.com/rust-lang/book.git