Hacker News new | ask | show | jobs
by kibwen 3771 days ago

  > 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).
1 comments

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.

Systems programming does not preclude a language from having a good type system or higher level abstractions.

A good example is Phil's OS. http://os.phil-opp.com/. He's designing an operating system in Rust, and it has surprisingly few "unsafe" parts. The rest of it is made safe using some neat zero-cost abstractions.

Higher kinded types isn't going to happen anytime soon. It's something that crops up often in discussions when people want to model something complicated with the type system; but it's a very nontrivial feature that would probably need to wait for Rust 2.0, if ever. Even if it would exist, you can just not use it. Like most of the other features being added.

They are specifically there so that you can write zero-cost abstractions. Yes, people who are hardcore C programmers may not have experience with more advanced type system features, but it's all in service to the goal of writing expressive code that goes as fast and as safely as possible.

As a practical example of higher kinded types, you can't say "this function takes an Rc<T> or an Arc<T>. I just want something refcounted, but I don't care about how." HKT would get you there.

Another common problem it would solve is "I don't want to write both a &T and &mut T version of my function."

Incidentally, the specialization RFC was just accepted https://github.com/rust-lang/rfcs/pull/1210#issuecomment-187...