Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
Meta as a prefix


1. Meta as a prefix
In the field of computer science (and related fields) one often hears the term "meta" used as a prefix to other words.

2. Meta
The term meta, as a prefix, often means something that refers to something like itself.

The Greek word «μετά» (meta) means "after".

3. Greek words
The English word "metamorphosis" comes from the Greek word «μεταμόρφωσης» which means, literally, "after form". That "after form" became known as a "changed form".

The English word "repent" in Greek is «μετάνοια» which means, literally, "after mind" or "after thought" or "after thinking". This re-thinking took on the meaning that in English is "repent".

4. Aristotle
In the 4th Century BC, Aristotle wrote many important books, including a book on physics.

Note: Aristotle was the personal tutor of Alexander the Great who command an army of 10,000+, traveling over 10,000 miles in 15 years, never losing a battle, and conquering the known world at the time.

The next book that Aristotle wrote was «τα μετά τα φυσικά», or, literally, "the (book) after the physics".

5. Metaphysics
In the "after the physics" book, Aristotle addressed causation, mathematics, and a divine creator God.

The topic of the word "metaphysics" became known as heavenly or out-of-world ideas (religious, etc.).

6. Self reference
MirrorsThat "out of the box" or "above" idea of "meta" is used in computer science as a prefix to describe something about itself.

7. Meta-data
One advantage of representing meta-data like data is that you can do searches, queries, etc., of the meta-data using the same tools and techniques that you use to search and query the data.

8. Meta-language
An English class can use English to describe the syntax and semantics of the English language.

9. Language learning
When learning languages (German, Greek, Russian, etc.) I enjoy getting to the point where I can start learning more of the language by reading books in that language that talk about the language. To learn, say, some Russian, it is useful, knowing German and Greek, to read books in German and Greek that teach Russian - reinforcing the other languages while learning a new language.

10. Meta-characters
A meta-character is a character that describes or represents another character. Usually, that character is used for special purposes so that a character that is different than that character needs to be used.

Sometimes an escape character is used that precedes the character that is to be given special treatment.

The term escape character and meta-character are sometimes used interchangeably.

11. Common meta-characters
Here are a few common meta-character escape sequences used in many languages.

12. Meta-questions
A meta-question is a question about questions.

Can I ask a question?

You just asked a question. Did you mean, can I ask another question? (The first question being a meta-question).

13. Meta-data and meta-tables
Meta-data is data about data.

The meta-data of a phone conversation (in security terms sometimes called traffic analysis) includes the fact that you made a call, who you called, when you called, how long the call lasted, etc., but not the actual contents of your phone conversation.

14. Meta-compilers
A meta-compiler is compiler that compiles (or helps write) a compiler, called a compiler-compiler.

A popular Linux-based meta-compiler or compiler-compiler is YACC (Yet Another Compiler Compiler) or an improved version called Bison (a play on the animal name yac as being pronounced similarly to YACC).

15. Meta-programming
Metaprogramming in .NETA meta-program is a program that writes a program.

In computer science, the term reflection refers to using a program to look at it's own code in a meta-programming way.

16. Programs that write programs
The field of programming languages in computer science is concerned, in part, with programs that write programs.

For some simple examples in C, see Programs that write programs .

17. C/C++ preprocessor
The C++ programming language has a Turing-complete meta-programming system that is an extension and improvement of the C directive preprocessor that has directives such as include, define, ifdef, etc.

18. C example
Here is of the C preprocessor for limited meta-programming.

For the define, C does an exact textual replacement, so adding a semicolon ";" at the end of the define would cause a syntax error in C after replacement.

19. C program
Why does the following program not compile?

Here is the C code.

The meta-programming preprocessor starts with the following.
   print("%d\n", MAX);

The pre-processor would literally replace "MAX" with "10;" to get the following.
   print("%d\n", 10;);

The added semicolon ";" creates a syntax error in the resulting code. To avoid issues such is this, a semicolon is not appropriate at the end of a defined literal.
   print("%d\n", 10;);

Here is the error text of the C code.

The simple C preprocessor acts, in part, as a string/term rewriting system similar in concept to, say, splitting a repeated children's nursery rhyme into similarities (the C code) and differences (the define replacements) and merging them to get the desired result.

The C++ template feature allows additional functionality and string/term replacement, etc.

20. Decisions

21. Processes
A meta-process is a process about processes.

22. XML and DTD
An XML DTD (Document Type Definition) is a meta-language for describing XML schema.

A DTD is somewhat hard to work with. For one company project, I ended up representing the DTD grammar as EBNF, using the Lua PEG (Parsing Expression Grammar) to recognize

23. EBNF syntax diagram
EBNF (Extended Backus Naur Form) and BNF (Backus Naur Form) are notations for describing other languages (including EBNF itself). Here is a syntax diagram of EBNF that describes EBNF.

Syntax diagram for EBNF

24. EBNF textual grammar
Here is the associated EBNF grammar.
Syntax = { Production } . Production = "Variable" "=" Expression "." . Expression = Term { "|" Term } . Term = Factor { Factor } . Factor = "Terminal" | "Variable" | "[" Expression "]" | "{" Expression "}" | "(" Expression ")" .


25. Language grammars
Almost every programming language has a grammar that has been expressed in EBNF. For example, search the Internet for the following.
C language ebnf grammr


26. C statement grammar
Here is a (simplified) grammar of C statements as covered in most introductory programming courses and expressed as an EBNF syntax diagram (ignoring some statements as goto, switch, etc.)

Syntax diagram for EBNF

27. C statement textual grammar
Here is the textual EBNF grammar of the above syntax diagrams.
stmt =    "if" "(" expr ")" stmt [ else stmt ]    | "while" "(" expr ")" stmt    | "do" stmt "while" "(" expr ")" ";"    | "for" "(" [ assg ] ";" [ expr ] ";" [ assg ] ")" stmt    | "return" [ expr ] ";"    | assg ";"    | id "(" [ expr { "," expr } ] ")" ";"    | "{" { stmt } "}"    | ";"    .

Note: The full grammar precisely defines where semicolons are needed and where they are not needed and where they are optional.

28. Meta-acronyms
Some acronyms are meta-acronyms or otherwise recursive. The C compiler often used in an introductory programming course is gcc which stands for GNU C Compiler.

29. Unix
Unix was the original operating system developed together with the C programming language. It was created at Bell Labs in the 1970's by Ken Thomson, Dennis Ritchie, etc.

The name Unix comes from a play on words of another operating system of the time, Multics.

Unix was the first portable operating system and mostly written in the C programming language.

Unix systems are characterized by a modular design with encapsulation, etc.

30. Linux
Linus Torvalds created a better Unix (specifically, the Unix kernel) that became so popular it became known as Linux (based on his name, Linus). Linus also created the distributed version control and repository system known as Git.

31. End of page

32. Multiple choice questions for this page

33. Acronyms and/or initialisms for this page