News for hackers. Stuff that matters.
Re:Nim Community Survey 2019 Results by Koshkin on Sunday February 23, 2020 @06:12PM (#22400227)
> Efficient, expressive, elegant

  let people = [
    Person(name: "John", age: 45),
    Person(name: "Kate", age: 30)
  ]
Verbosity at its finest. Compare with C++:

  Person people[] {
    { “John”, 45 },
    { “Kate”, 30 }
  };
Re:Nim Community Survey 2019 Results by kazinator on Monday February 24, 2020 @12:10AM (#22401823)
This is a false comparison because you're really comparing by-order-of-argument initialization/construction ("BOA constructors") versus keyword-value initialization/construction.

BOA is more compact, but it's possible to get the arguments wrong, and the type system won't save you if you exchange two arguments of the same type.

There is no reminder anywhere that 45 and 30 are ages.

That's also true in function calls that do not use keyword arguments (the vastly prevalent paradigm in mainstream languages), but function calls specify a function name which can reveal something, like set_age(john, 45).

Some languages have both.

No knowing anything about Nim, I have no reason to believe that it has no way to achieve a compact way for initializing an array or list of objects using just positional arguments, and no repetition of the type name. If nothing else, surely there has to be a way to write an array of tuples, and that aggregate can surely be passed to some function that iterates over it and constructs the implied Person objects.

On the C++ front, I seem to recall C++ recently adding C99 designated initializers or planning to. If so, then { .name = "John", .age = 45 } will be possible, and C++ coders will end up using it.

Re:Nim Community Survey 2019 Results by pjmlp on Monday February 24, 2020 @01:18AM (#22402060)
C++ designated initializers are not like C99 designated initializers, rather a subset.

For example, just like initialization lists on constructors, initialization order is relevant.

Re:Nim Community Survey 2019 Results by kazinator on Monday February 24, 2020 @09:59AM (#22404475)
Order is unspecified in C initializers, including designated ones. That quickly becomes relevant when the program depends on it for expected behavior.
Re:Nim Community Survey 2019 Results by staticassertion on Sunday February 23, 2020 @06:34PM (#22400341)
We reading the same code? The nim code is way simpler.

Maybe if you'd used auto (if that's possible - now I understand that auto is out of fashion due to sometimes forcing copies) it'd be closer.

`let people = [`

vs

`Person people[] {`

Just for starters...

Re:Nim Community Survey 2019 Results by agumonkey on Sunday February 23, 2020 @07:08PM (#22400507)
ah, syntax debate. * goes back to lisp
Re:Nim Community Survey 2019 Results by willbw on Sunday February 23, 2020 @06:34PM (#22400339)
I am going to give you the benefit of the doubt that this is a joke.
Re:Nim Community Survey 2019 Results by nimmer on Tuesday February 25, 2020 @11:38AM (#22414584)
You can use tuples in Nim and it would be almost identical.