On Tuesday, 20 January 2026 at 13:43:02 UTC, libxmoc wrote:
Timon's attempted PR did try to add tuples to core D,

Do you have a link? I don't see anything on https://github.com/dlang/dmd.

but it still pulled in runtime library code - that's exactly the problem. A language feature that depends on library code violates the clean separation: it's either core or library, not both. I hope it won't be accepted, tuples should be native to the language, meaning it should not depend on runtime code, the compiler should support that by default, just like `struct`.

Tuples could be zero-library, but why do you think that is a significant benefit? A druntime Tuple wouldn't require GC (except if instantiating `toString`) so it should work with any custom runtime, it should be only a struct template (and a factory function template), no library to link against. And it would be a lot of extra compiler complexity to have zero druntime dependencies. Lowering language constructs to druntime means less bugs and a less complex compiler, which is itself good for correctness. Plus easier to extend if needed.

People have in fact been changing druntime hooks into templates so that the compiler has fewer special cases and the templates are more capable than the compiler was, because they are easier to work with. Using a Tuple template is consistent with that.

Reply via email to