News for hackers. Stuff that matters.
Re:Comparing Parallel Rust and C++ by jandrese on Thursday November 07, 2019 @01:12PM (#21475674)
I've had the impression that Rust developers come from a more pure-math background than most language designers. People who read mathematical notation all day probably find Rust to be more natural than a typical programming language. For people coming from a traditional computer language background the number of sigils on each line is a point of pain.

IMHO Rust may have tried to roll a little too much into the language. It has the air of the second system effect to it, where every good idea from every language is added together to get something that is less than the sum of its parts and you get code that is hard to decipher until you've learned a full college course worth of syntax.

Re:Comparing Parallel Rust and C++ by pcwalton on Friday November 08, 2019 @12:01AM (#21480073)
I designed the lifetime syntax and I'm far from having a pure math background. There aren't any sigils in Rust that C doesn't have, other than the lifetime syntax, which needs separate syntax as it's a novel feature.

Can you name a specific feature you want removed from Rust?

Re:Comparing Parallel Rust and C++ by jandrese on Friday November 08, 2019 @12:40PM (#21484663)
I'm not sure I'd want it removed, but generics tend to be pretty horrific looking to people new to the language.

An example:

  fn largest<T>(list: &[T]) -> T {
    let mut largest = list[0];

    for &item in list.iter() {
        if item > largest {
            largest = item;
        }
    }
I'm sure experienced Rust devs look at that and say it's fine, but that's definitely a hurdle for new developers.
Re:Comparing Parallel Rust and C++ by slavik81 on Friday November 08, 2019 @09:45PM (#21489220)
You need to specify the properties of T that you use. So, that first line should be:

  fn largest<T: PartialOrd + Copy>(list: &[T]) -> T {
https://tomtongue.com/docs/rust-wk-20.html#trait-bounds
Re:Comparing Parallel Rust and C++ by pcwalton on Friday November 08, 2019 @02:22PM (#21485745)
What would you want to see instead? That's pretty much the same syntax as generics in Java.