Skip to content
linkrope edited this page Oct 16, 2022 · 11 revisions
gamma

What Is Gamma?

Gamma is a compiler generator. Like a parser generator generates a parser from a (context-free) grammar, gamma generates a compiler from two grammars tied together. The two levels of grammars are called extended affix grammar. As extended affix grammars are compiled into compilers, gamma could also be called a compiler-compiler.

What Is Gamma For?

Gamma shines when the target language has a rich structure, which can be nicely defined by a grammar. So gamma can be a good choice for a transpiler. While gamma can also be used to generate compilers with machine (assembly) language as target language, compiler optimization is not really supported. Also, compile-time function evaluation is quite difficult with gamma.

What are Extended Affix Grammars?

The extended affix grammars are tamed two-level grammars. So the same implementation techniques can be used as for an attribute grammar. However, no separate programming language must be used for the calculation of the attributes. The calculus remains closed: syntax, validation, type checking, and semantics are all expressed in a grammar-oriented way.

Why "Gamma"?

The Greek letter gamma (γ) stands for both "c" (as in compiler) and "g" (as in generator). It all started with the compiler generator eta of the TU Berlin in the 1980s. In the late 1990s, epsilon was implemented as a redesign of a reduced system. And gamma is now a revival of epsilon. So we stay true to the tradition of the Greek letters, if only because they look so scientific.