At the beginning...
This project aims at making a graphical development environment based on a Basic interpreter, so that we have a language like Visual Basic™ under Linux™.
The phenomenal quantity of bugs and inconsistencies that makes Visual Basic so delightful persuaded me to start this project
It seems that Microsoft was aware of the poor quality of its language, as VB .Net is not backward compatible with older versions of Visual Basic. I think they have thrown away the Visual Basic interpreter source code, and VB .Net is just a .Net runtime compiler whose syntax looks like the old Visual Basic one.
I want to clear up any misunderstanding immediately. Gambas does not try to be compatible with Visual Basic, and will never be. I'm convinced that its syntax and internals are far better than the one's of its proprietary cousin
With Gambas, you can quickly design your program GUI with QT or GTK+, access MySQL, PostgreSQL, Firebird, ODBC and SQLite databases, pilot KDE applications with DCOP, translate your program into any language, create network applications easily, make 3D OpenGL applications, make CGI web applications, and so on...
Gambas is a full-featured object language and development environment built on a BASIC interpreter. It is released under the GNU General Public Licence.
Its architecture is largely inspired by Java. So Gambas is made up of:
* A compiler.
* An interpreter.
* An archiver.
* A scripter.
* A development environment.
* Many extension components.
The compiler is a fast little executable written in C:
* It compiles about 128000 non-void lines in a second on my own Athlon 2000. This speed allows a quick code/compile/test incremental development process.
* It does almost no optimization at all at the moment, relying on the interpreter to perform this task at runtime.
* It manages and compiles string translations by using the GNU gettext tools.
The interpreter is a small executable also written in C that is less than 180 Kb:
* It provides all of the native features of the language, by giving indirect access to almost all the POSIX glibc features.
* It loads classes on demand, optimizing the bytecode the first time it is run.
* Linking between classes is done entirely at runtime. This is done as late as possible. So even large executables start quickly.
Finally, the archiver is a program that creates a Gambas executable from a Gambas project directory.
Note that a Gambas executable is just an uncompressed archive of a project. It can include any type of file, not just compiled bytecode, and it is internally accessed by the interpreter like a file system.
The Gambas Language
The main characteristics of the Gambas BASIC language are:
* About 250 keywords and native functions to manage almost everything: arithmetic, strings, input-outputs, files, time...
* Full error management.
* Full process control, with pseudo-terminal management.
* Full support for watching input-output file descriptors.
* Event loop support with timers.
* Native UTF-8 string support.
* Full internationalization and translation support.
* Ability to call external functions in system shared libraries.
But Gambas is a true object-oriented language as well. With:
* Objects and classes.
* Properties, methods, constants and events.
* Public and private symbols.
* Polymorphism, i.e. virtual method dispatching.
* Single inheritance.
* Constructors and destructors.
* Array accessors, enumerators, sortable objects.
The Gambas inheritance mechanism is entirely dynamic, and allows you to:
* Create a more specialized version of an already existing class.
* Reimplement a class and extend it.
* Override some methods or properties of a class.
Any classes can be inherited, reimplemented or overridden, even the native ones written in C/C++.
Finally, a native class named Observer allows you to intercept any event raised by any object.
An Extensible Language
The core Gambas interpreter is a terminal-only program. All other features are provided by components, which are groups of classes written in C/C++, or written directly in Gambas.
These components provide, among other things:
* Access to many database systems: MySQL, PostgreSQL, SQLite, Firebird, ODBC.
* Graphical user interface programming, based on the QT toolkit, or the GTK+ toolkit.
* Network programming, with advanced protocol management: HTTP, FTP, SMTP, DNS.
* SDL programming.
* OpenGL programming.
* XML programming.
* CGI programming with session management.