Skip to main content

Introduction for developers

GeLB is a community project. If you want to join us, this guide is for you!

How you can contribute#

TODO docs (you don't need to be a programmer -- or you can be "just" a GeLB programmer :) in order to contribute) or code (for contributing to the compiler)

General recommendations#

If you want to contribute to GeLB, we recommend to:

  1. [first] Familiarize yourself with GeLB, by reading this manual,
  2. Read the TODO-linkto-ARCHITECTURE.md file, to get a high-level overview of how GeLB works under the hood.
  3. Head over to the TODO-linkto-devguide, for more developer-oriented information.

Implementation languages#

Most of the code (especially the gelbc compiler) is implemented in Python (and distributed as the gelb package on PyPI). Code written in other languages is usually related to editor/IDE plugins, which make working with .gelb files much more pleasant.

:::todo Integrate in dev-docs

ANTLR4 context objects record everything we know about the recognition of a phrase by a rule [REF: A4 book, pp. 29, Sec. 2.4]

:::

Annotated list of references#

Prior knowledge about compilers is great, but not a requirement for you to be able to contribute to the development of GeLB. However, if you want to contribute to the compiler, you will want to become accustomed to some of the basic concepts. The following list of references should serve as a good start:

  1. Parr, Terence. The definitive ANTLR 4 reference. Pragmatic Bookshelf, 2013.

    Since gelbc is based on ANTLR4, this is the first reference we recommend. In particular, pay attention to:

    • the Visitor mechanism, which is used for constructing the initial abstract syntax tree (AST), and to
    • the Listener mechanism, which is used for validating the syntax of GeLB programs.

    Unfortunately, this reference does not focus on compiler design, which is why the next reference (also by Terence Parr) is still valuable.

  2. Parr, Terence. Language implementation patterns: create your own domain-specific and general programming languages. Pragmatic Bookshelf, 2009

    Although the examples in this book are for ANTLR3, it is worth reading for its (low-theory) explanations of compiler design and internals.

  3. Tomassetti book

  4. Dragon book (2ed)

  5. Stephen A. Edwards' "Programming Languages and Translators" lectures notes (COMW W4115, Columbia University, Fall 2003)