A drawing is better than a long speech. And I'm fond of this kind of diagram that make people think that program design is completly clean and careful thought ;-). You can click on the picture to get details about Gambas architecture...

The Development Environment hides this machinery behind a pretty graphical interface.

Interpreter

The interpreter is a program named gbx. It executes the byte code of the compiled file generated by the compiler.

Project

A project is a set of files stored in one directory. A project can contain source files (forms, classes, modules) or any data files of any types. The project configuration is stored in a file named ".project".

Native Classes

The native classes can be used without loading any component. They are integrated in the interpreter, and can be looked upon as a part of the Gambas language.

Component Interface

The Component Interface is a set of routines and services used by the components to communicate with the interpreter. The interpreter's internals are hidden this way.

Components

Components are shared libraries that are loaded at run time by the interpreter. They can contain new classes and hook routines such as event loop management, shell arguments analyze, etc. They can publish a set of routines as an interface to other components also.

Execution Unit

The execution unit is the heart of the interpreter. It dispatches and executes each byte-code instruction generated by the compiler.

Subroutines

The subroutines are the interpreter functions associated to the corresponding Gambas Basic functions like Sin( ), Left$( ), etc. or operators like +, &, etc.

Class Loader

The Class Loader loads compiled forms, classes and modules into the interpreter. If your project was compiled as an executable, i.e. as an archive, the interpreter maps the file into memory instead of loading it. It is worth doing !

Executable file

A Gambas executable file is just an uncompressed archive of your project, the compiled files included. The archive file is marked as a script with the "#!/usr/bin/gbx" magic header, so that Linux executes it by calling the interpreter.

Compiled files

A compiled file is a binary representation of a class, that contains every information useful to the interpreter : functions transformed to byte code, constants, variables definitions, debugging information, etc.

The Archiver

The archiver is a program named gba. It transforms your project, the compiled files included, in one sole executable file.

The Compiler

The compiler is a program named gbc. It transforms your project's forms, classes and modules files into binary compiled files that can be understood by the interpreter.

The Component Loader

The Component Loader is the part of the interpreter that loads components shared libraries, gives them access to the Component Interface, and that publishes their interface to the other components.