Harman Patil (Editor)

Gambas

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Designed by
  
License
  
Gambas gambaswikiorgwikilogo3pngv

First appeared
  
1999; 18 years ago (1999)

Stable release
  
3.9.2 / January 1, 2017; 2 months ago (2017-01-01)

OS
  
Linux, FreeBSD; version forMac OS X and Haiku in progress; Microsoft Windows through Cygwin

Gambas programming on linux


Gambas is the name of an object-oriented dialect of the BASIC programming language, as well as the integrated development environment that accompanies it. Designed to run on Linux and other Unix-like computer operating systems, its name is a recursive acronym for Gambas Almost Means Basic. Gambas is also the word for prawns in the Spanish and Portuguese languages, from which the project's logos are derived.

Contents

History

Gambas was developed by the French programmer Benoît Minisini, with its first release coming in 1999. Benoît had grown up with the BASIC language, and decided to make a free software development environment that could quickly and easily make programs with user interfaces.

The Gambas 1.x versions featured an interface made up of several different separate windows for forms and IDE dialogues in a similar fashion to the interface of the GIMP. It could also only develop applications using Qt and was more oriented towards the development of applications for KDE. The last release of the 1.x versions was Gambas 1.0.19.

The first of the 2.x versions was released on January 2, 2008 after three to four years of development. It featured a major redesign of the interface, now with all forms and functions embedded in a single window, as well as some changes to the Gambas syntax, although for the most part code compatibility was kept. It featured major updates to existing Gambas components as well as the addition of some new ones, such as new components that could use GTK+ or SDL for drawing or utilize OpenGL acceleration. Gambas 2.x versions can load up and run Gambas 1.x projects, with occasional incompatibilities.

The next major iteration of Gambas, the 3.x versions, was released on December 31, 2011. Early benchmarks of the Gambas 3 development versions showed its Gambas scripting being significantly faster than Perl and Python equivalents.

Features

Gambas is designed to build graphical programs using the Qt (currently Qt 4.x or 5.x) or the GTK+ toolkit (GTK 3.x also supported as of 3.6.0); the Gambas IDE is written in Gambas. Gambas includes a GUI designer to aid in creating user interfaces, but can also make command line applications. The Gambas runtime environment is needed to run executables.

Functionality is provided by a variety of components, each of which can be selected to provide additional features. Drawing can be provided either through Qt and GTK+ toolkits, with an additional component which is designed to switch between them. Drawing can also be provided through the Simple DirectMedia Layer (currently version 1.x, with 2.x support in the works), which can also be utilized for audio playback through a separate sound component (a component for the OpenAL specification has also been added). GPU acceleration support is available through an OpenGL component, as well as other hardware functionally provided by various other components. There are also components for handling other specialized tasks.

With Gambas, developers can also use databases such as MySQL or PostgreSQL, build KDE (Qt) and GNOME GTK+ applications with DCOP, translate Visual Basic programs to Gambas and run them under Linux, build network solutions, and create CGI web applications. The IDE also includes a tool for the creation of installation packages, supporting GNU Autotools, slackpkg, pacman, RPM, and debs (the latter two then tailored for specific distributions such as Fedora/RHEL/CentOS, Mageia, Mandriva, OpenSUSE and Debian, Ubuntu/Mint).

Gambas since version 3.2 IDE has integrated profiler and it started to use Just-in-time compilation technology.

Differences from Visual Basic

Gambas is intended to provide a similar experience as developing in Microsoft Visual Basic, but it is not a free software clone of the popular proprietary program. The author of Gambas makes it clear that there are similarities to Visual Basic, such as syntax for BASIC programs and the integrated development environment; Gambas was written from the start to be a development environment of its own and seeks to improve on the formula.

Its object model and each class being represented in a file, the archiver to package the program is inspired by the Java programming language. Gambas is intended to be an alternative for former Visual Basic developers who have decided to migrate to Linux. There are also other important distinctions between the Gambas and Visual Basic. One notable example is that in Gambas array indexes always start with 0, whereas Visual Basic indexes can start with 0 or 1. Gambas also supports the += and -= shorthand not found in classic Visual Basic. Both of these are features of Visual Basic .NET however.

Adoption

Several programs and many forms of example code have been written using and for Gambas. As of 28 October 2012, Freecode (formerly Freshmeat) listed 23 applications that were developed using Gambas, while the Gambas wiki listed 70; several other specialized sites list Gambas applications and code. There is even a Gambas written application, named Gambas3 ShowCase, that acts as a software center to download or install Gambas 3 applications. Several community sites, including community forums and mailing lists, also exist for Gambas. Gambas Guru offers project hosting, program listing, forums and more for Gambas users.

Availability

Gambas is included in the repositories of a number of Linux distributions, such as Debian, Fedora, Mandriva Linux and Ubuntu. A Microsoft Windows version of Gambas was run under the Cygwin environment, although this version was significantly less tested than its Linux counterparts and was command-line only; Cooperative Linux and derivatives have also been used, as well as specialized Linux virtual machines. An independent contributor, François Gallo, also worked on porting Gambas 3.x to Mac OS X and FreeBSD, based on using local versions of the X11 system. Gambas from version 3.2 can run on Raspberry Pi, but offers no just-in-time compilation there.

In November 2013, the future portability of Gambas was discussed, listing the main concerns being Linux kernel features utilized in the interpreter, components using Linux specific software and libraries, and primarily X11-tying in the Qt, GTK+ and desktop integration components. However, partly due to the need to upgrade to newer toolkits such as GTK 3 (added as of 3.6.0) and Qt 5 (as of 3.8.0), future versions would be less X11 tied, making projects like Cygwin or utterly native versions on other platforms more possible. Benoît Minisini stated that he intended to "encapsulate" X11 specific code to aid in any attempt to replace it, with the X11 support in the desktop component moved to its own component as of 3.6.0.

On October 27, 2016 a screenshot and setup guide was released from the main page for running Gambas fully through Cygwin, including most components, graphical toolkits, and the complete IDE. The relevant patches were mainlined as of version 3.9.2. This replaces the prior recommended method of using freenx forwarding from a Linux server.

Example code

Hello world program with graphical user interface.

Program that computes a 100-term polynomial 500000 times, and repeats it ten times (used for benchmarking).

References

Gambas Wikipedia