The Freya Programming Language

Program and file structure

See also

The architectural requirements for a modern programming language are very different from those of traditional languages. It has to do both with the paradigm shift, but also with new advances in software and hardware. For instance, most of the traditional compilers fell in the "narrow compiler" class: they acted in several passes on a lineal data structure. So, several traditional languages, Pascal among them, prohibited the use of an identifier before its declaration.

Freya, in contrast, has a file organization and high level syntax that fits better with the requirements of component oriented programming.

In this section

Lexical structure.

Learn how identifiers, string literals, comments and other lexical entities are defined in Freya.

Projects and source files.

You can compile both single files and projects in Freya. Learn how to create and manage Freya project and source files.

Namespaces

Namespaces are the highest level containers in Freya. They can contain other namespace declarations and type declarations.

Implementation sections

The main advantage of the unit feature in modern Pascal versions is that they provides a short "contract form" of a set of classes needing no special tools to extract this view. Freya keeps the best of units, while removing most of the annoying points, and implementation sections play a key role in this.

using clauses

In order to avoid typing the whole qualified name for each type reference, you can specify a list of default prefixes by declaring one or more using clauses.

The entry point

Executable projects must have an entry point: a static method which must be executed to start running the application. You can let the compiler to automatically detect the entry point, but you can also give precise indications about the desired entry point.

See also

The Freya Programming Language
Type declarations
Type members
Statements
Expressions