News for hackers. Stuff that matters.
Re:Why I want Concepts, sooner rather than later by lambda on Saturday February 20, 2016 @05:00PM (#11142150)
Meanwhile, you can use Rust now where traits (which fill a very similar niche to concepts) have been available for a long time, and are widely used in the standard library.

Of course, once you do, you find that some of the traits you would like to be able to use aren't expressible without "higher kinded types" (https://github.com/rust-lang/rfcs/issues/324), so there are still some big features that everyone kind of hopes will happen soon but there's no current plan for. But the existing trait system gets you pretty far for a lot of what you want to do.

Re:Why I want Concepts, sooner rather than later by zenbsd on Saturday February 20, 2016 @09:44PM (#11143044)
Traits are not like Concepts. Concepts are for template meta-programming. You're thinking of the "Contracts" proposal which would be like concepts but for normal types, so like traits.

Also, can we have a C++ article where the comment section doesn't turn into a Rust ad?

Re:Why I want Concepts, sooner rather than later by jguegant on Sunday February 21, 2016 @05:07AM (#11143972)
You just reached the Rustwin's point of Hackernews: "As a discussion about C++ or C grows longer, the probability of a comparison involving Rust, as a savior, approaches 1. Afterwards any further discussion is considered null and void".
Re:Why I want Concepts, sooner rather than later by 0xCMP on Saturday February 20, 2016 @11:38PM (#11143328)
We could if C++ wasn't so complicated, overwhelming, and prone to writing bad code that everyone feels compelled to replace it and going as far as starting a project like Rust to solve the issues Python or Go do for C++ with the same level of zero-cost abstractions.

Devil's Advocate: C++ may be complicated, but try comparing hello worlds in each language. Maybe Rust still isn't the holy grail either.

Re:Why I want Concepts, sooner rather than later by lambda on Sunday February 21, 2016 @01:00AM (#11143511)
Rust:

  fn main() {
      println!("Hello, world!");
  }
C++:

  #include <iostream>
  
  int main() {
    std::cout << "Hello, world!";
  }
Re:Why I want Concepts, sooner rather than later by masklinn on Sunday February 21, 2016 @04:54AM (#11143946)
The Rust version adds a newline (hence println) while the C++ version doesn't. Either the Rust version should use `print!`, or the C++ version needs an `<< std::endl`
Re:Why I want Concepts, sooner rather than later by claudius on Sunday February 21, 2016 @09:07AM (#11144528)
Adding '\n' to the string is perfectly fine, no std::endl needed (\n translates to the system-specific newline and the stream is flushed on destruction anyways).