I believe andrew and loris have been with zig for long enough to have their own bias and no longer be aware of it, thus I believe it's the newcomers' job to hold up the simplicity design premise now...
I believe andrew and loris have been with zig for long enough to have their own bias and no longer be aware of it, thus I believe it's the newcomers' job to hold up the simplicity design premise now...
This article was mostly about pointing out how `inline else` lends itself really well to writing tagged union interfaces, I would expect anybody who actively writes Zig and has metaprogramming experience to not have much trouble using it.
> Maybe finding an alias/new name for "inline" here can be considered before a "1.0".
I would be on board with that, yes.
I am afraid that the designers are blind to it because they are using it every day.
I am also afraid that once a lot of code and libraries are written, it will be difficult / impossible to change the syntax, it might already be too late.
I love Zig but the syntax quirks might considerably slow its adoption.
https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...
On top of that, in this specific case, `inline` has a Zig-specific meaning that pertains to generics and metaprogramming in a way that has not much to do with the C/C++ use of the term.
It's short and concise IMO.
An inlined function is a function that is not called in the traditional sense and instead its effects are replicated as though the function code had been written at the call site.
With `inline for` and `inline while`, the for loop isn't run in the traditional sense and instead is unrolled as though each instance of the loop had been written separately.
With `inline else`, every possible instance not covered by a `case` is expanded as though it had been written separately.
It's a little weird to C programmers only because C doesn't expand the concept outside of functions.
Zig aside, that's an astute observation in general. I think this is an issue in Python where the old guard that have been part of the project for decades and are extreme experts have gotten bored and started cramming in new language features.