Note: I have zero background in linguistics, so I do not know if my question is valid, and I am probably not going to use proper terminology. Thank you for reading. Here goes.
Can the use of a word change from formal to informal, or vice versa, while the meaning of the word remains the same?
For example, take the word "sweet", as in:
"The exam has been cancelled? Sweet!"
"I just downloaded a sweet app."
"He's got a sweet jump shot."
Here, the meaning of "sweet" is something like: pleasing to the mind or feelings; gratifying (thefreedictionary). This use of "sweet" is decidedly informal.
But I just read that the use of "the sweet science", to refer to the sport of boxing, dates back to 1813. It seems that in this context "sweet" also meant pleasing to the mind or feelings; gratifying. What about the register (in 1813): was it formal, or informal?
More generally, can the formality of a word change over time, while its meaning remains the same?