A metasyntactic variable is a word or term that stands in for something else, typically used when you're describing an overall pattern, and the subject under discussion could have any name in actual practice. A placeholder.

It's most commonly used in computer science and related fields, and in that community foo is the most commonly used and recognized metasyntactic variable.


The classic example from the C2 Wiki:

Suppose I have a list, foo, with a node, bar, ...

What this allows us to do is now refer to the list as "foo" and and the node as "bar", as in "now, if bar is the last node in foo...", while recognizing that in a program the real "foo" and "bar" could have any name at all.


But here, I'm not asking about "foo" or "bar"¹ or any specific metasyntactic variable, I'm asking about the term metasyntactic variable.

A recent answer on a different question suggested the author Terry Pratchett could have invented it:

Terry Pratchett .. used the idea of a 'Metasyntactic variable' (his own nomenclature I believe but open to correction).

Pratchett didn't invent the term, but the answer prompted me to look into who did, and I'm stumped.


  1. When was the term metasyntactic variable first used, or metasyntactic modifying some other word, giving the same meaning?
  2. Why meta-syntactic?
  3. Was there any specific event or author who popularized it, or was its growth simply organic?
  4. Is the term used with the same meaning in any interesting ways outside of the software world (like the Terry Pratchett example)?

Early uses

Using Google Books and Google nGrams², the earliest use of the full term metasyntactic variable I could find was the 1979 work The MDL Programming Language, which reads, on page 4:

A metasyntactic variable -- something to be replaced in actual use by something else -- appears as a radix:fix, in an italic font; often the variable will have both a meaning and a data type (as here), but sometimes those will be omitted, for obvious reasons.

and on page 44:

TYPE (aren't homonyms wonderful?), just type the appropriate ATOM, like FIX or FLOAT or ATOM etc. However, in this document we will use the convention that a metasyntactic variable can have a type for a "data type": for example, foo:type means that the TYPE of foo is ATOM, but the ATOM must be something that the SUBR TYPE can return.

These paragraphs suggest, respectively, that (a) the term is new enough that it has to be defined (a 1990 Emacs Lisp manual uses the word unselfconsicously and without any definition, because by then everyone knew what it meant), and (b) that it's established enough that the authors have to defend their novel convention that m.v.s may have data types (which is atypical).

Which means this may be an early use, but not the first use.

So, broadening my search, and looking for only metasyntactic, I found ALGOL-Bulletin no. 13, published August 1961, mentioning a memo written in November 1960 which used that word:

Serial no. 10. From Peter Zilahy Ingerman and Kirk Sattley. 7.11.60.  <br/> Subject: Proposed symbols for use in ALGOL translators.  <br/> The authors give a list of letter combinations, corresponding to all basic symbols and **metasyntactic classes** of ALGOL 60, for use in describing ALGOL translators.

But it's not clear whether this metasyntactic had the same sense as it does in the full term metasyntactic variable, as the word "classes" suggest this might be a more specific and technical term of art in ALGOL's design, or computer language design more broadly.

"Meta" syntactic

Aside from its first use, I'm interested in why the term "metasyntactic" was chosen in the first place. What is "meta" about these terms' relationship to syntax?

The canonical source on this, The Jargon File, presents three different concepts (list-ified for clarity):

Metasyntactic variables are so called because
1. They are variables in the metalanguage used to talk about programs etc.
2. They are variables whose values are often variables (as in usages like “the value of f(foo,bar) is the sum of foo and bar”).
3. However, it has been plausibly suggested that the real reason for the term “metasyntactic variable” is that it sounds good.

In addition, I've personally made the argument that their meta-syntacticness arises from the fact that the same words can be used to stand in for any part of speech.

In any case, while (1) or some version of it is probably the first idea that would come to most people's minds, the fact that the Jargon File didn't stop there is telling, and I think finding the origins of the term will shed a lot of light here.

Non-software uses or origins

The Terry Pratchett answer above also got me thinking: do non-computer scientists use the term metasyntactic variable, in a non-software context? Are there people who use this term non-ironically, who are not familiar with its software sense?

I would be particularly interested in answers which show the term pre-dates its use in software. Given that "syntax" is really only studied by one other group, I wonder do linguists or syntacticians of natural languages³ use this term at all? Did they do so before, say, 1950?

¹ Interestingly, foo and bar have their own, detailed etymology, and no, it's not as straightforward as "arising from the WWII acronym FUBAR". See RFC 3092 and the canonical post about foo here on EL&U.

² I actually was forced to use only Google Books for the full term; for some reason, metasyntactic variable doesn't show up in nGram Viewer at all.

³ I once made the case that words like "thingy", "doodad", "whatshisface", etc are "metasyntactic variables", but John Lawler says they're more properly termed "nonce forms" by linguists.

PS: I know I've picked the low-hanging fruit here, with Google Books and Google nGram Viewer, but I would really still prefer scholastic, detailed answers. Speculation will just add noise. Though I'm also happy to accept first-hand accounts from people who lived through the 50s-60s-70s computer era (or very credible second-hand accounts).

  • Meta is used as a prefix in many disciplines to refer to talking about the content of the discipline rather than anything in it. So a metasyntax would be used as a syntax to make statements about some computer language 's syntax The most common one in linguistics (and teaching) is, of course, metalanguage which is used to make statements about an actual language or its use. I don't see how this metasyntactic variable is any different....a variable used in a metasyntax (in computing). This is all off the top of my head, but I believe it is accurate. – Lambie Feb 26 '17 at 17:05
  • @Lambie Yes, that is sense #1 recorded by The Jargon File, but even they didn't commit to it as the canonical or even most plausible origin. That they didn't commit is the reason I ask! – Dan Bron Feb 26 '17 at 17:07
  • But it follows the logic. I don't know its "history". Metalanguage is very common in linguistics and language teaching/learning or any discipline. Close to discourse. Sometimes, there isn't a canon. There is just the first time a term is used. – Lambie Feb 26 '17 at 17:09
  • 1
    @Hugo Awesome! Didn't think to search for foo on EL&U itself. I'll add your answer there to footnote 1, alongside RFC 3092, which I see you also reference. – Dan Bron Feb 26 '17 at 21:41
  • 1
    @Josh See the last section of my starter answer: I haven't found a bridge from metasyntactic to metasyntatic variable, nor do I know when the term was first applied to terms like foo and bar, nor do I have concrete proof that the terms actually evolved from Backus' metalinguistic formulas. In short, I need a canonical answer. I want to settle the etymology once and for all. – Dan Bron Mar 2 '17 at 13:26

Ingerman and Sattley 1960

I decided to pull on the thread of use of metasyntactic by Ingerman and Sattley in their November 1960 memo.

Knuth 1961

Searching for their names in relation to the language name ALGOL quickly revealed an abstract of a paper by Knuth titled ALGOL 60 confidential, written June 1961, which uses the word metalinguistic:

The ALGOL 60 Report, when first encountered, seems to describe a very complex language which will be difficult to learn. The “metalinguistic formulae” admirably serve the purpose of precisely specifying a language, but they are certainly not very readable for a beginner.

Following that lead and searching for the term "metalinguistic formulae" in relation to Knuth, we find Development, Assessment, and Reengineering of Language Descriptions by Alex Sellink and Chris Verhoef, undated but from its bibiliography no earlier than 1999:

In his paper on the syntax and semantics of the proposed international algebraic language, Backus [2] writes: `we shall need some metalinguistic conventions for characterizing various strings of symbols. To begin, we shall need metalinguistic formulae.' Then he introduced using an example what is now widely known as the Backus-Naur Formalism.

Backus 1959

And the light begins to dawn. Backus-Naur Form is the famous notation for describing computer languages. That is, it is a language for describing languages: a metalanguage. Note that the ALGOL Bulletin where we found the earliest use of metasyntactic is in fact compiled by Naur, who co-created the Backus-Naur form.

So, chasing down Sellink and Verhoef's reference [2], we find Backus' The Syntax and Semantics of the Proposed International Algebraic Language of the Zurich ACM-GAMM Conference., written 1959:

Syntax of IAL

In the description of IAL syntax which follows we shall need some metalinguistic conventions for characterizing various strings of symbols. To begin, we shall need metalinguistic formulas. Their interpretation is best explained by an example:

This use of metalinguistic formulas was enthusiastically quoted by Knuth, by Sellink and Verhoef, by several other authors and papers I encountered in this search, and the very wording is emphasized in the relevant Wikipedia article.

Similarly, the Wikipedia article quotes Naur, two years later, in 1961:

The meaning of syntactic formula may be further explained by saying that words enclosed in the brackets < >, like <ab>, denote classes whose members are sequences of basic symbols. Class designations of this kind are found in any description of a language. For describing ordinary natural languages designation like word, verb, noun, are used. Peter Naur (1961)."A COURSE ON ALGOL PROGRAMMING". p. 5, Note 1. Retrieved 26 March 2015.

So it seems it was Backus' use of metalinguistic that galavanized and motivated its use in the early computer industry, and likely inspired the related word metasyntactic used by Ingerman and Sattley, who moved in the same circles.

From "metasyntactic" to "metasyntactic variables"

I haven't yet been able to hunt down the first use of "metasyntactic variable" as applied to terms like "foo" and "bar" but it now seems inescapable that it developed out of the use of metalinguistic formulas as coined by Backus in 1959.

This coinage was adopted in the ALGOL community in the 1960s, to grew to the extent that the "variable" term was applied and understood more broadly in language design circles by no later than the late 1970s (as used by Galley and Pfister in the MDL Language book in the question; MDL was a derivative of LISP, another early programming language).

If I can find a more direct connection, or fill in a few more of the missing links, I will update this answer.

  • 2
    From What is a Grammar? Metasyntactic values, in the sense I'm using here, are descriptive of syntax, as for example the nonterminals of a Chomsky grammar. But I've never been a great fan of his ideas re "genetic encoding of universal grammar", and I more than suspect modern AI-based natural language processing with "non-biological" neural nets will increasingly undermine his thinking. – FumbleFingers Feb 26 '17 at 18:44
  • @FumbleFingers Thanks, good find. However, that looks like it was written in 2011, long after the lines I'm trying to find were well-blurred. If you can find an earlier use of "meta-X" in relation to Chomsky, ideally the 50s or 60s, that would be a very helpful lead. – Dan Bron Feb 26 '17 at 18:46
  • I haven't perhaps been assiduous in grasping exactly what "metasyntax" - or more specifically, "metasyntactic variable" means in the Algol context, but it looks to me like it's just what I would call a parameter, or parameter list if I needed to identify one (when pointing to it in the Syntax; definition line in a programming language reference, for example). – FumbleFingers Feb 26 '17 at 19:25
  • 2
    @FumbleFingers There are three terms, from three different contexts, here. There is "metasyntactic variables" (general use), "metalinguistic formulas" (as used by Backus in the BNF/IAL context), and "metasyntactic contexts" (as used by Ingerman in the ALGOL context). They all mean different things, but in a broad sense, yes, they're all parameters. The reason they're tagged as "meta" is because they're not parameters in functions of a programming language, but parameters for functions for generating a programming language, or describing one. – Dan Bron Feb 26 '17 at 21:46

With a hyphen, I first see "meta-syntactic variable" being used in Software 71: proceedings of a conference sponsored by Software World and held at the University of Kent at Canterbury, July 1971:

Here 'TYPE' and "MODE" are meta-syntactic variables such as used in the definition of ALGOL 68 [reference 3].

R3 TYPE--> procedure | data-structure

Where reference 3 is VAN WYNGAARDEN, A., MAILLOUX, B.J. , PECK, J.E.L., and KOSTER, C.H.A., 'Draft report on the algorithmic language ALGOL 68', Amsterdam Mathematisch Centrum.

Without a hyphen "metasyntactic variable" is used in the May 1972 thesis of Michael Kelly Donegan, CODE GENERATION FOR NEW ON THE RICE RESEARCH COMPUTER. The word "NEW" is underlined in the title and refers to the computer language NEW.

VARIABLE assignation: reference destination, becomes symbol, value source.

The semantic interpretation of the assignation is embodied in the syntax by asserting that the destination is to be elaborated in reference mode and the source in value mode. VARIABLE is a metasyntactic variable whose rule is

VARIABLE: reference; value.

This asserts, in the case of assignations, that the value of an assignation may have two interpretations. The value in reference mode is the value of the destination, while in value mode it is the value of the source.

The plural form "metasyntactic variables" is used in the 1975 book The structure and design of programming languages

The term "syntactic variable" had been in use since about 1950 in the symbolic logic and computer fields.

See for example the 1959 Journal of the Association for Computing Machinery which has a footnote:

Note that the symbols p1, p2, etc. occur here as "syntactic variables." That is, they stand for expressions made up of our symbols.

  • Nicely nicely found. I already upvoted you. I'm particularly pleased with your find of the earlier "syntactic variables". – Dan Bron Mar 3 '17 at 22:56
  • Nice edit! Now since your '71 reference cites ALGOL 68, you might chase that down to find how the phrase was defined in that paper. I think we're on the home stretch here! – Dan Bron Mar 8 '17 at 13:34
  • @DanBron The reference is VAN WYNGAARDEN, A., MAILLOUX, B.J. , PECK, J.E.L., and KOSTER, C.H.A., 'Draft report on the algorithmic language ALGOL 68', Amsterdam Mathematisch Centrum. eah-jena.de/~kleine/history/languages/Algol68-Report.pdf – DavePhD Mar 8 '17 at 13:57
  • I haven't read the PDF yet: does it define metasyntactic variable? Does it cite an even earlier source on that topic? – Dan Bron Mar 8 '17 at 13:59
  • @DanBron I haven't looked at it much yet, over 100 pages. It seems to use tons of "meta" words but I don't see "metasyntactic variable" specifically so far. – DavePhD Mar 8 '17 at 14:01

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.