Is “Decl” becoming a user-facing term?

in swift, we seem to have a longstanding tradition of spelling out the vowels in the names we give to things. for example,

  • ObjectIdentifier and not ObjID
  • Substring and not Substr
  • UnsafeMutableRawBufferPointer and not UnsafeMutRawBufPtr
  • LazyPrefixWhileSequence and not LzyPfxWhileSeq

i’m not going to wade into the debate of which style is better, i am only pointing out that there is an established tradition in swift API naming. which is why i am surprised that esoteric truncations like Decl and Expr are becoming entrenched in the user-facing API of SwiftSyntax.

i’m well-aware that ‘Decl’ and friends have lived in the swift compiler for as long as it has been written in C++, but i always assumed that if it were ever to get surfaced in user-facing API (as SwiftSyntax will become once macros become widespread), that it would be known as Declaration.

Is Decl going to become a user-facing term, like Int, func, etc.?


The Swift Syntax APIs aren't subject to Swift Evolution review. But yes, as you've observed, "Decl" and "Expr" are terms-of-art adopted in the user-facing API of Swift Syntax.


It's a fair point. I think within SwiftSyntax "Expr" and "Decl" count as terms of art, but I'm glad the macro attributes, which can appear in any module, spell them out in full.


“Exper”. And these are “abbreviations of art” within the compiler community, so the pronunciation’s pretty set. :person_shrugging: