Are Tuples Structs?
ziggit.dev·4d
📏Linear Types
Preview
Report Post

January 6, 2026, 7:05pm 1

I kinda think they aren’t! I think they’re a clean different thing, which is overloading the struct keyword, and maybe that part should change.

  • A file is “just a struct”

  • But a file can’t be a tuple

  • But it can’t be an extern or packed either

  • But tuples don’t take a modifier!

  • We have @Struct coming up, do we use it to make a tuple?

  • Nope! We use @Tuple. So why is its @typeInfo a .@"struct"? Of type Struct?

  • Tuples are structurally typed, every .{ bool, bool } is the same type.

  • Structs are very much not structurally typed, Foo{ .a: bool, .b: bool } is not at all a Bar{ .a: bool, .b: bool }.

  • We can destructure a tuple, but not a struct, them we just construct.

  • Tuples have a .len “field”, structs… I mean the…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help