Home / doc / release 
Article on the Release of Gambas 2.0 RC1
After almost two years of development, I am happy to announce the first release candidate of Gambas 2.

We're making this announcement now in the hope of attracting more testers users to this project during the release candidate cycle. This will help us find any bugs we might have missed.

Introduction

The new logo of Gambas 2
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 largly inspired by Java. So Gambas is made up of:

The compiler is a fast little executable written in C: The interpreter is a small executable also written in C that is less than 180 Kb: 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:

But Gambas is a true object-oriented language as well. With: The Gambas inheritance mechanism is entirely dynamic, and allows you to: 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:

All these features are covered by only 351 classes and 4197 symbols (at the current time). There are only a small number of concepts to learn when compared with other languages. Moreover, we tried to make the names of these symbols as coherent as possible.

All this helps to make Gambas relatively easy to learn.

Components written in C/C++ are stored in shared libraries, and components written in Gambas are just Gambas projects like any other project.

They are loaded by the interpreter at program start-up, or when needed during program execution.

Developing a component in C/C++ is a bit like developing a device driver for the Linux kernel:

The documentation about writing components is not yet finished, but all the required help will be provided on the developer mailing-list.

A Scripting Language

Gambas recently obtained support for becoming a scripting language. This feature is provided by the scripter, a small Gambas executable that allows you to dump any Gambas code into a text file.

Here is a little script example:

#!/usr/bin/env gbs2

' This script returns the memory really used by the system, the cache and swap being excluded.

FUNCTION GetUsedMemory() AS Integer

  DIM sRes AS String
  DIM aRes AS String[]
  DIM cVal AS NEW Collection
  DIM sVal AS String

  EXEC ["cat", "/proc/meminfo"] TO sRes

  FOR EACH sVal IN Split(sRes, "\n", "", TRUE)
    aRes = Split(sVal, " ", "", TRUE)
    cVal[Left$(aRes[0], -1)] = CInt(aRes[1])
  NEXT

  RETURN cVal!MemTotal - cVal!MemFree - cVal!Buffers - cVal!Cached + cVal!SwapTotal - cVal!SwapFree - cVal!SwapCached

END

PRINT Subst("Used memory: &1 bytes", GetUsedMemory())

Database, GUI & Desktop Independence

Gambas components are not just bindings. They try to abstract the underlying library they are based on, so that coherency and simplicity win.

Consequently, with Gambas, you can write programs that are:

For example, Gambas provides a database manager tool that:
The database manager under KDE The database manager under XFCE

Moreover, we tried to provide desktop independence too, by:

The Development Environment

Gambas provides a full-featured IDE, which is itself written in Gambas.

You can create forms, insert controls just by drawing them, edit your code, and do many other things similar to other rapid application development systems.

The IDE in design mode The IDE in debugging mode

The Gambas development environment provides the following features:

The source code editor The icon editor The translation dialog

The three first tabs of the project property dialog

Moreover, it can make installation packages for many distributions, and also tar.gz installation packages based on GNU autotools.

The following GNU/Linux distributions are supported:

The packages made by the IDE work only if the target distribution correctly packages Gambas as specified on the How To Package Gambas page of the wiki. Alas, this is not always the case at the moment...

Finally, even though the development environment is strongly tied to the Gambas language, you don't have to use it to create Gambas programs.

Caveats

So that people will not claim this essay simply looks like an advertisement :-), we should mention that there are still some caveats in Gambas.

The main one are:

Hopefully, the goal is to solve these problems in the next release.

The Future

...is not predictable, especially the Gambas one.

Thanks to a Perl script using the Positronic::Variables and Quantum::Superposition modules, we were able to guess that the next release will provide:

Gambas is free software. So, contrary to proprietary software, what is promised may not always be delivered on time, or may not be delivered at all. :-)

Download Gambas and Other Links

You can download Gambas at http://gambas.sourceforge.net/download.html.

For more information on Gambas, here are a few links:

You can report problems and bugs either on the mailing-list or on the bug tracker at http://gambasrad.org.

We hope that you will enjoy Gambas as much as we do! :-)

BenoƮt Minisini

"When you are doing something, you have against you every people doing the same thing, every people doing the opposite thing, and the very large majority of people doing nothing." - Confucius.