logoalt Hacker News

CooCooCaCha04/01/20252 repliesview on HN

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];`


Replies

andyferris04/02/2025

It’s targeting C/C++ programmers accustomed to initializer lists in C/C++.

throwawaymaths04/02/2025

you couldn't do that in zig because a type is potentially a valid value:

.{i32, 3} is a valid term in zig.