| Hi! Article author here. I have long, long since waxed poetic about how many bugs and problems this can solve (even just a poor man's library version): https://twitter.com/__phantomderp/status/1381314735174524928 And, very recently, I have begun to scheme and agitate for a feature similar to what your article proposes: https://twitter.com/__phantomderp/status/1424466518797135876 I am not sure people will go for `..`, and I would also like to find a way to enable composition and multi-dimensionality in an easier fashion (nesting arrays, for example, does not require that all of the memory is laid out perfectly flat. This is the case in both C and C++, and is taken advantage of by e.g. ASan and other memory-shadowing runtimes that add shadowing cushion around each array member). As a Standards Committee person, I can't really just demand "and this will go into the standard"; our charter requires 2 existing C compilers/stdlibs to implement the thing (unless the thing is so dead-simple we can just shake hands and implement it because it's not contentious) and then, after that, requires consensus (which is its own roadblock to getting things done when someone doesn't like the syntax/way-you-are-doing-it/gets-in-the-way-of-their-implementation). So, for example, if the C parser in D were to support this syntax, and someone else were to support some kind of syntax for this, and they all got together and wrote a paper for this idea, that would count as two implementations.......... Hint hint. Wink wink. Nudge nudge? 0:D |
The spec, the implementation, and using it. It's by far the simplest scheme I've ever seen proposed for C. You can see this from the article.
I suppose I could add it to D's ImportC:
https://dlang.org/spec/importc.html
even though ImportC's charter is to implement C11 as it stands and not fix anything.
But would the committee accept DasBetterC as an implementation?
https://dlang.org/spec/betterc.html
DasBetterC does implement the slices.