← Back to context

Comment by klysm

3 days ago

Sure but I don’t think those examples really matter once you establish basic familiarity with a language. The semantics and constructs a language provides are much more important and debating syntax is missing the forest for the trees

The array syntax is very offensive: `const a = [3]i32{ 1, 2, 3 };` A set is denoted by braces, not an array.

  • 1. using [] drops context-freeness. what is: foo[1]? is that foo type array with one element? or accessing the foo array at index 1?

    2. how do you feel about array initialization in C?

    3. you can think of {...} as defining memory regions, curlies around code are defining "a memory block of instructions"

  • According to your familiarity yes, but how is this such a problem? It’s easy to get past

  • This is exactly why I find the language unintuitive. I don't understand why they made the choices they made. For example, why curly brackets?

    I find the rust equivalent much more intuitive `let a: [i32; 3] = [1, 2, 3];`