Remix.run Logo
kreco 14 hours ago

That's a very nice project.

List of remarks:

> var ints: int[5] = {1, 2, 3, 4, 5};

> var zeros: [int; 5]; // Zero-initialized

The zero initialized array is not intuitive IMO.

> // Bitfields

If it's deterministically packed.

> Tagged unions

Same, is the memory layout deterministic (and optimized)?

> 2 | 3 => print("Two or Three")

Any reason not to use "2 || 3"?

> Traits

What if I want to remove or override the "trait Drawing for Circle" because the original implementation doesn't fit my constraints? As long as traits are not required to be in a totally different module than the struct I will likely never welcome them in a programming language.

jdmichal 8 hours ago | parent [-]

C uses `|` for bitwise OR and `||` for logical OR. I'm assuming this inherited the same operator paradigm since it compiles to C.