Pigeon Core - Introduction

If you are new to Pigeon, you should probably learn the regular Pigeon Syntax first.

This part of the documentation describes the core language, from the bottom up. Along the way you will learn how to write macro functions, how to extend the parser, and see how these features have been used to implement the higher level syntax. If you aren't at least somewhat familiar with that syntax, you will probably find this terribly confusing. In fact you might find it confusing in any case. Don't worry about it. You don't need to understand the core in order to write normal Pigeon programs. This material is for people who want to extend the language itself, or to implement an entirely new mini-language, or perhaps are just curious, or who like Lisp.

Pigeon Core is basically Lisp, or maybe a bit closer to Scheme. It is a very simple kind of Lisp, though, because it has been designed to be generated by the parser rather than written by hand. If you were going to write a whole program directly in Pigeon Core, it would be worth setting up some macros to make it work a bit more like a conventional Lisp.

Note that Pigeon Core is not truly a separate language, and does not have a separate interpreter. In fact the interpreter only ever truly understands programs written in this core subset! The rest of the syntax is implemented as a collection of macros and parser extensions, themselves written in Pigeon Core, which translate normal Pigeon programs into the core form. These extensions are automatically loaded when the interpreter starts up, although that may be hidden by them being precompiled and linked directly into the executable. If you want to start right from square one, there are switches that skip loading the standard syntax modules, but this is rarely neccessary. The full Pigeon syntax is a superset of Pigeon Core, so you can feed core expressions directly into the regular interpreter.

Note also that most of the Standard Types are implemented in C++, so strings, lists, and hashes are always available, and work exactly the same in Pigeon Core as they do in the regular language.

Differences From Lisp