Or would linguistics also include the study of accessory languages like esperanto, artificial languages like Klingon, or even programming languages?
I think that some research has been done on artificial languages, but Linguistics mostly deals with natural languages and especially with spoken language. Written language is not totally excluded but sounds, sound shifts occur in spoken language, not to mention that this is where language evolves the fastest.
It's true however that there are many aspects that Linguistics analyses such as Pragmatics, where you study how context contributes and also changes sometimes the meaning of an utterance, e.g. think about saying "Today the sun is shining" where today can apply to any day depending on when you say it. Or also "I sentence the accused to 5 years of prison", where the meaning (and action) changes if it's said by a judge or a friend.
Also sociolinguistics (language and society), psycholinguistics (study about the biological and psychological factors that base acquisition, comprehension and use of language), neurolinguistics (interdisciplinary science between Linguistics, psycholinguistics, psychobiology, cognitive neuroscience and developmental psychology), and so on. They are all within Linguistics but you focus on certain aspects.
I've never heard of Linguistics dealing with programming languages (as something to study), and I doubt they're relevant under that point of view.
The simple answer to your question is YES - linguistics is NOT limited to 'natural' languages. While professional linguists mostly deal with naturally occurring languages spoken by people for daily communication, the field of linguistics is concerned with all symbolic systems used to express meaning for some sort of a communicative purpose.
So there are linguists who study signs, linguists who study chimps and other communicating animals, linguists who study artificial languages (from Esperanto to Klingon), linguists who study art and literature. If it's symbolic with a communicative purpose, it's fair game for linguistics.
I don't know of any linguists who study computer languages (partly because of their very specialised communicative purpose) but they could certainly be studied linguistically in very fruitful ways.
The Chomsky Hierarchy, which starts with simple automata and works it's way up the complexity scale to Turing machines, describes regular, context-free languages. In this sense, "regular" means rule-based and "context-free" means that everything you need to know about the communication is available in the language. Programming languages behave this way such that their interpreter or compiler is exercising the rule system for the language. If you break the rules, you also break the language. The language can only change if you deliberately change the rules.
Natural language is context-sensitive. This means that, while rule-based, a natural language always has many other channels of signal that ultimately determine what is being communicated. This includes prosodic information (things like intonation, stress, timing that don't always make it into the writing system), Body language, situational and environmental factors, etc. We "play" with natural language using metaphors and idioms and such, where what is communicated is not available by looking directly at the tokens and grammar of an utterance. Natural language continually evolves, and rules come and go as they enter into and fall out of usage over time.
Chomsky's big claim is that there is an underlying structure, common across all natural human language, that undergoes a transition to the particular language used by the speaker. Linguists who study syntax under the Minimalist program learn to work with theory that expresses this underlying grammar, and that work is, in my humble opinion, very similar to the work undertaken by a computer scientist developing the compiler for a new programming language in that many of the same skills are used in both efforts.
"Accessory and artificial languages", if they are going to work and survive, must likewise draw from linguistic features already found in natural languages. They must have a lexicon, syntax, morphology, a sound system (phonology) and if they work well they will develop semantic and pragmatic features as they get used. In summary, linguistics is everywhere language is, regardless of it's origin.
Linguistics is just the scientific study of language. This definition does not limit the scope of "language" to just natural languages. "Language" is, loosely, a means of communication of information, i.e., from one entity to another. Many different kinds of entities communicate with each other. Many plants and animals seem to have vocabularies. However, the field of linguistics has not played much of a role in the study of these because of the absence or paucity of syntax in these communications. In the course of training animals, we know that some animals have the capacity to comprehend some syntax. For example, Pepperberg's parrots and great apes have shown they can comprehend simple1 sentences of human languages. This raises the question of whether their native communications have syntax too. If they do, I'm confident that the techniques of linguistics will be applied to study this too, as it will be for the study of robot languages.
Now, coming to the question, there are plenty of academic papers on Esperanto and Klingon. I have not come across the use of linguistic techniques for the study of computer languages, but on an abstract level, these languages are not all that different from each other, and so there is a great deal of overlap in the concepts that are employed to study them2.
1: simple for a human, hellishly complex for a dog.
2: though within sensible limits. I don't think there will be a day when we study the phonology of HTML.
I am a bit suprised that my previous contribution ( which I am keeping unchanged below theline) seems to be considered irrelevant. Hence I am trying to explain it.
It is clear that other answers more or less exclude very formal linguistic expression such as programming languages.
The fact is there is very little literature claiming to relate them to linguistic analysis, and even this claim is rather weak. Furthermore it does not seem to involve recognized linguists.
Another such paper (in addition to the one below) is:
Empirical language analysis in software linguistics, Jean-Marie Favre , Dragan Gasevic , Ralf Lämmel3 , and Ekaterina Pek, Software Language Engineering, Springer Lecture Notes in Computer Science Volume 6563, 2011, pp 316-326 http:/www.researchgate.net/publication/225162167_Empirical_Language_Analysis_in_Software_Linguisticsfiled912f50746a8289574.pdf
However, the point of my contribution was to suggest that there might be a continuum between natural language as commonly studied by linguists and formally defined languages such as considered by logicians or computer scientists. Specialized sublanguages is my approach to suggest such a continuum, starting from the constrained structure of legal documents and evolving through more tightly constrained technical and scientific languages.
The fact is that mathematicians do study very formal languages (algebras or logic formulae), but actually seldom use them for their work which is usually stated more informally, meaning closer to vernacular. It is also clear that they would prefer their statements and proofs to be stated and checked more formally. This gap is now being bridged by new software tools such as proof assistants (see my first answer below). This is not much different from the programming language issue, since a result in logic (the Curry-Howard isomorphism) shows that proving and programming are essentially the same kind of activity.
Hence, if the gap between informal and formal mathematical expression can be bridged, the same should become true of programming expression, allowing in the long run more informal ways for programming computers (a personal opinion).
This relation between formal and informal expression has for me a striking ressemblance to the way analysis of natural sentences will associate them to logical formulae, if only as explained in Lawler's study guide.
Another point is that an analysis of how programming languages evolve or are evolved to encompass more advanced semantic concepts might give some light on what is considered intellectually convenient to think about problems and to express them. Relating the semantic evolution of programming and mathematical languages to analysis of semantic structures in natural language might be interesting from a linguistic point of view, as they strive for more natural ways of stating whatever they have to express.
It seems obvious to me that linguistics cannot be limited to natural languages spoken by humans, if only for one good reason: analysing extreme cases is a good way to test theories, and to understand the nature of a topic. Understanding why the bee communication system (to avoid the word language) is or is not a language is part of understanding what language is.
Another interesting aspect is that human communities develop sublanguages that are specific of groups or activities. My own experience in Legalese writing, for example, was an interesting one, both regarding syntax and semantics. My impression is that such sublanguages nearly form a continuum from usual natural languages to such formal creations as programming languages, with scientific languages as intermediaries.
Another topic worth studying is the evolution of scientific languages, as it is intimately linked with the scientific activity. The evolution of mathematical concepts and understanding has led to changes in mathematical notation and expression. And conversely, these changes lead to new understanding of mathematics as the language becomes more perspicuous with respect to the semantic domains adressed. This is also true of other hard sciences.
An interesting aspect of these remarks is that they are more of a diachronic nature than of a synchronic one ... possibly because the synchronic wiew is linguistically poorer, or maybe too technical.
I would suspect that there is much to be learned too from the diachronic analysis of Legalese (and this was probably done).
The case of programming languages is a bit special. They have clearly a linguistic aspect as they are also intended for human communications. Programmers learn (often the hard way) that they should write programs so that they can read (and understand) them a month later.
The problem with programming languages is that they are supposed to be also used by machines that can interpret correctly only very constrained expressions. Actually they could do a lot more, but we do not trust them (or ourselves) to use more complex means of expressions with machines. To take a simple example, people are reluctant to use ambiguous syntax to communicate with machines, even though they ae very good (much better than humans) at detecting ambiguity and asking for more precision.
I would expect that the development of formal tools for checking proofs and programs, such as the Coq system, will ultimately help to develop programming in a less formal way, with a more natural linguistic expression, akin to the way scientists are now communicating. The formal part would be taken care of by the programming environment. This is only predictive, and not to be too much relied upon, but I think there may be much to be expected in the longer term from the combination of very powerful formal system combined with some AI to provide informal context.
This said, I know of at least one work, actually quite old, that is an attempt to analyze programming languages from a linguistic point of view:
The comparison of programming languages: A linguistic approach. John B. Goodenough, ACM '68 Proceedings of the 1968 23rd ACM national conference, Pages 765-785, ACM New York, NY, USA ©1968 http://dl.acm.org/citation.cfm?id=810641 (abstract)
As I recall, the Harvard dissertation written by Goodenough (circa 1969) is a very big document, but I was not able to retrieve details on Harvard site. Internet search shows that this paper is cited by several others, but it is not clear that it all makes a significant body of linguistic literature on programming languages.