1
$\begingroup$

What is the term in programming language creation that is the rationale for symbol reuse? Though potentially confused with overloading, it is not so much the application of symbol reuse, but the logical result of a limited vocabulary in the world of common symbols.

I seem to recall running in to the term when reading about the development of C - that one eventually runs out of simple symbols, so the language designers took a reasonable approach to use familiar symbols to mean different things, rather than invent new symbols for every new need. Additionally, they desired to stay within the 7-bit ASCII alphabet. The particular meaning is determined by the number/type of operators used or the broader context.

An example is from C/C++ where < is used as

  1. a delimiter in template definitions (template <int N>)
  2. #include delimiter, searching system headers first (#include <filename>)
  3. a less-than comparison operator (x < y)
  4. left bit shifts (x << n)
  5. the ostream operator (std::cout << val << std::endl)

Point - there are cases of symbol reuse beyond strict overloading, and I believe that there is a one-word term whose definition is something like "the condition of using the same symbols for different purposes by necessity or for the sake of maintaining familiarity."

$\endgroup$
  • $\begingroup$ Are you talking about characters or tokens? In the context of compilers, the term "symbol" usually means the latter. The former is not an issue at all, due to how compilers work. $\endgroup$ – Raphael May 27 '15 at 6:45
  • $\begingroup$ Characters. I'm only referring to the human input side of a programming language, before lexical conversion to tokens or symbols. It's not that I'm saying context to distinguish amongst meanings is an issue, just that there is a term for the reason we ended up doing it. $\endgroup$ – it's scientific May 27 '15 at 16:49
  • $\begingroup$ In that case, I don't think there is a term for it. For instance, digits are used for identifiers and number atoms -- of course they are! -- and that is as natural as anything. Since this is not a problem as long as your token set is prefix-free (or has rules to break ties), I doubt there is a name for the phenomenon. $\endgroup$ – Raphael May 27 '15 at 17:33
  • $\begingroup$ @it'sscientific: The C++ specific term for what you're looking for is operator overloading. In particular, the ostream operator << is often used as an example of operator overloading because that's how it's implemented. $\endgroup$ – slebetman Oct 23 '15 at 8:08
2
$\begingroup$

The main reason is very mundane. At the time C was designed, and notations for many things, we did not have any form of graphics, or very seldom (like one graphic screen for the whole university, even in major places). Actually, the main output devices were the teletype or the line-printer, with a standardized and limited character set. Even the alphanumeric screen came later for most. No windows or mouse excepts in rare labs (Xerox).q

So that was a general constraint for everyone. For writing papers, we could add hand-written symbols in blank spaces left by the typist. But for more mechanized works such as programs listing (i.e. the printed text of programs) and for execution result, we had to do with what characters were available on the printing device.

Another problem was that increasing the number of symbols was limited by the standard encoding in seven or eight bits. Memory was very costly. The syntax of Fortran (the version of that time) was influenced by the format of punched cards.

Then there is a tradition. Mathematicians have been reusing symbols too. And so does natural language. We get diversity by composing them, or using context. And this was fortunate for Gutenberg, and made writing generally much easier. Compare Chinese and Latin writing.

Regarding how this could be called, I must say there is no word that comes to my mind. Not even the feeling that there was a specific word for that. I did quite a bit of theoretical and practical work on programming language syntax and I do not remember this as an issue, except as explained below.

Short of knowing what word you may look for, I can try to guess, and some obvious candidates would be homonymy or homography. Or maybe polysemy.

A specific case, but which concerns more identifiers, is scoping rules. In some languages they apply also to operators.

So far, that is the best I can contribute to this onomasiological issue.

$\endgroup$
  • $\begingroup$ Thanks for the background; however, I'm almost certain that there is a one-word term that encompasses the idea of symbol reuse as a result of the practical limitations we've discussed. I haven't been able to google-fu the answer from anywhere - it gets muddled with overloading on the common answer forums. $\endgroup$ – it's scientific May 26 '15 at 22:19
  • 1
    $\begingroup$ I was mislead by the title of your question. It should state it briefly, but it seems to be asking for the reason, not for the name. I remember using "overloading", but I have no memory of using another word. We talked of lexemes representing a given symbol of possibly multiple charracters. It it had many uses that is disambiguated by syntax analysis. I do not know whether that helps. $\endgroup$ – babou May 26 '15 at 22:34
  • $\begingroup$ I tried a bit further, but that is probably not what you want. $\endgroup$ – babou May 27 '15 at 7:37
  • $\begingroup$ Thanks for the update. Polysemy seemed close to what I recall, but more closely describes the phenomena - the use of a sign for multiple meanings; however, they are usually related meanings in Polysemy. Per my <, example, they don't have to be related. I suppose my case is a general form of homonymy with character symbols. Maybe I'm just misremembering if the professor was discussing the phenomena or the reasons for it... :-\ $\endgroup$ – it's scientific May 27 '15 at 20:56
  • $\begingroup$ Onomasiology is the exact type of problem I have though. Great word! $\endgroup$ – it's scientific May 27 '15 at 21:05
0
$\begingroup$

Parsimony - after weeks of racking my brain, it finally hit me, but it's not a CS-specific word.

Generally, the word just means "miserliness in resource usage" or "stinginess," but it's a good word for what the professor intended. Language designers want to minimize resources, for reducing both character sets and the required familiarity of the programmer with character sets. Again, C designers for instance, wanted to stay within 7-bit ASCII.

An even closer application of 'parsimony' is the Maximum Parsimony problem. The goal is to find the minimum number of genetic sequences that can compose a given set of genotypes. It's particularly important in understanding evolutionary trees and gene inheritance, and generally NP-complete. Regarding programming languages, one might want to find the minimum number of character symbols required to express all necessary tokens, unambiguously, to the compiler.

Here is a Stanford project on the matter of Halotyping.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.