Is the meaning very context dependent, or can it be defined in general terms? Does the meaning change by author or period?
Sometimes it's used to refer to anything that stays within a specific tonal key or context, but sometimes when people talk about diatonic scales they refer to seven note scales specifically, even though other scales (like pentatonic) can be diatonic too. Sometimes it's just used as opposite of "chromatic".
According to Encyclopedia Britannica:
Diatonic, in music, any stepwise arrangement of the seven “natural” pitches (scale degrees) forming an octave without altering the established pattern of a key or mode—in particular, the major and natural minor scales. Some scales, including pentatonic and whole-tone scales, are not diatonic because they do not include the seven degrees.
But in Sound on Sound we can read that church modes are diatonic too, so it's not really about major and natural minor scales:
The definition of a diatonic scale is that there are five whole-tone and two semitone intervals in the series and that the semitones must always be separated by at least two whole-tones. Using '2' to symbolize the whole-tone steps and '1' for the semitone steps, the major diatonic scale corresponds to the interval series 2212221. No matter what note you start on, following this prescription yields a major diatonic scale — the white keys starting on C is one example. It turns out that all possible diatonic scales are constructed by starting somewhere in the major diatonic scale and continuing until you reach the same note you started on. Those are generally referred to as the church modes: Dorian for 2122212, Phrygian for 1222122, Lydian for 2221221, and so on.
Are harmonic and melodic minor not diatonic then? The i V i progression isn't diatonic?
According to Wikipedia, "diatonic" can apply to:
Musical instruments, intervals, chords, notes, musical styles, and kinds of harmony
And also puts a time context to the concept
They are very often used as a pair, especially when applied to contrasting features of the common practice music of the period 1600–1900.
Even when staying within similar contexts, the concept can take various very similar forms, but that still differ in something important. There's maybe a place where the definitions converge? Or is it just one of those concepts that vary among authors?
Exactly what does "diatonic" mean?