Gambas in XXmiglia market.jpg
   HOME

TheInfoList



OR:

Gambas is the name of an
object-oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of " objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of p ...
dialect of the BASIC programming language, as well as the
integrated development environment An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools ...
that accompanies it. Designed to run on
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, w ...
and other
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
computer
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
s, its name is a
recursive acronym A recursive acronym is an acronym that refers to itself, and appears most frequently in computer programming. The term was first used in print in 1979 in Douglas Hofstadter's book '' Gödel, Escher, Bach: An Eternal Golden Braid'', in which Hofs ...
for ''Gambas Almost Means Basic''. Gambas is also the word for
prawn Prawn is a common name for small aquatic crustaceans with an exoskeleton and ten legs (which is a member of the order decapoda), some of which can be eaten. The term "prawn"Mortenson, Philip B (2010''This is not a weasel: a close look at nature' ...
s in the
Spanish Spanish might refer to: * Items from or related to Spain: **Spaniards are a nation and ethnic group indigenous to Spain **Spanish language, spoken in Spain and many Latin American countries **Spanish cuisine Other places * Spanish, Ontario, Can ...
, French, and
Portuguese Portuguese may refer to: * anything of, from, or related to the country and nation of Portugal ** Portuguese cuisine, traditional foods ** Portuguese language, a Romance language *** Portuguese dialects, variants of the Portuguese language ** Portu ...
languages, from which the project's logos are derived.


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 earlier versions of the GIMP. It could also only develop applications using Qt and was more oriented towards the development of applications for
KDE KDE is an international free software community that develops free and open-source software. As a central development hub, it provides tools and resources that allow collaborative work on this kind of software. Well-known products include the ...
. 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 same is true for Gambas 2.x to 3.x, but not from Gambas 1.x to 3.x. The next major iteration of Gambas, the 3.x versions, was released on December 31, 2011. A 2015 benchmark published on the Gambas website showed Gambas 3.8.90 scripting as being faster to varying degrees than
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offic ...
5.20.2 and the then-latest 2.7.10 version of
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
in many tests. Version 3.16.0 released on April 20, 2021, featured full support for Wayland using the graphical components, as well as parity between the Qt 5 and GTK 3 components.


Features

Gambas is designed to build
graphical Graphics () are visual images or designs on some surface, such as a wall, canvas, screen, paper, or stone, to inform, illustrate, or entertain. In contemporary usage, it includes a pictorial representation of data, as in design and manufacture ...
programs using the Qt (currently Qt 4.x or 5.x since 3.8.0) or the
GTK GTK (formerly GIMP ToolKit and GTK+) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and propriet ...
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 in an
event-driven Event driven may refer to: The term event-driven refers to a methodology that focuses on events and event dependencies. Examples include * Event-driven finite-state machine, finite-state machine where the transition from one state to another ...
style, but can also make
command line A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
applications, as well as
text-based user interface In computing, text-based user interfaces (TUI) (alternately terminal user interfaces, to reflect a dependence upon the properties of computer terminals and not just text), is a retronym describing a type of user interface (UI) common as an ear ...
s using the
ncurses ncurses (new curses) is a programming library providing an application programming interface (API) that allows the programmer to write text-based user interfaces (TUI) in a terminal-independent manner. It is a toolkit for developing "GUI-like" ...
toolkit. 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 Simple DirectMedia Layer (SDL) is a cross-platform In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in sever ...
(originally version 1.x, with 2.x added as of 3.7.0), which can also be utilized for audio playback through a separate sound component (a component for the
OpenAL OpenAL (Open Audio Library) is a cross-platform audio application programming interface (API). It is designed for efficient rendering of multichannel three-dimensional positional audio. Its API style and conventions deliberately resemble those ...
specification has also been added).
GPU A graphics processing unit (GPU) is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device. GPUs are used in embedded systems, mobi ...
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 KDE is an international free software community that develops free and open-source software. As a central development hub, it provides tools and resources that allow collaborative work on this kind of software. Well-known products include the ...
(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 The GNU Autotools, also known as the GNU Build System, is a suite of programming tools designed to assist in making source code packages portable to many Unix-like systems. It can be difficult to make a software program portable: the C compiler ...
, slackpkg,
pacman originally called ''Puck Man'' in Japan, is a 1980 maze action video game developed and released by Namco for arcades. In North America, the game was released by Midway Manufacturing as part of its licensing agreement with Namco America. ...
,
RPM Revolutions per minute (abbreviated rpm, RPM, rev/min, r/min, or with the notation min−1) is a unit of rotational speed or rotational frequency for rotating machines. Standards ISO 80000-3:2019 defines a unit of rotation as the dimensionl ...
, and debs (the latter two then tailored for specific distributions such as Fedora/
RHEL Red Hat Enterprise Linux (RHEL) is a commercial open-source Linux distribution developed by Red Hat for the commercial market. Red Hat Enterprise Linux is released in server versions for x86-64, Power ISA, ARM64, and IBM Z and a desktop versio ...
/ CentOS,
Mageia Mageia is a Linux-based operating system, distributed as free and open source software. It was forked from the Mandriva Linux distribution. The Greek term () means enchantment, fascination, glamour, wizardry. The first release of the software ...
,
Mandriva Mandriva S.A. was a public software company specializing in Linux and open-source software. Its corporate headquarters was in Paris, and it had development centers in Metz, France and Curitiba, Brazil. Mandriva, S.A. was the developer and maint ...
,
OpenSUSE openSUSE () is a free and open source RPM-based Linux distribution developed by the openSUSE project. The initial release of the community project was a beta version of SUSE Linux 10.0. Additionally the project creates a variety of tools, s ...
and Debian,
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in three editions: '' Desktop'', ''Server'', and ''Core'' for Internet of things devices and robots. All ...
/
Mint MiNT is Now TOS (MiNT) is a free software alternative operating system kernel for the Atari ST system and its successors. It is a multi-tasking alternative to TOS and MagiC. Together with the free system components fVDI device drivers, XaA ...
). Gambas since version 3.2 IDE has integrated profiler and it started to use
Just-in-time compilation In computing, just-in-time (JIT) compilation (also dynamic translation or run-time compilations) is a way of executing computer code that involves compilation during execution of a program (at run time) rather than before execution. This may co ...
technology.


Differences from Visual Basic

Gambas is intended to provide a similar experience as developing in Microsoft
Visual Basic Visual Basic is a name for a family of programming languages from Microsoft. It may refer to: * Visual Basic .NET (now simply referred to as "Visual Basic"), the current version of Visual Basic launched in 2002 which runs on .NET * Visual Basic ( ...
, but it is not a
free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, no ...
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 In computing, object model has two related but distinct meanings: # The properties of objects in general in a specific computer programming language, technology, notation or methodology that uses them. Examples are the object models of ''Java'', ...
, each class being represented in a file, as well as the archiver to package the program is all inspired by the
Java programming language Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers ''write once, run anywh ...
. 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 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 Visual Basic, originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visua ...
however.


Adoption

Several programs and many forms of example code have been written using and for Gambas. ,
Freecode Freecode, formerly Freshmeat, is a website owned by BIZX, Inc., hosting mainly open-source software for programmers and developers. Among other things, the site also hosted user reviews and discussions. While a majority of the software covered is ...
(formerly Freshmeat) listed 23 applications that were developed using Gambas, while the Gambas wiki listed 82; several other specialized sites list Gambas applications and code. A Gambas written application, named Gambas3 ShowCase, acted as a software center to download or install Gambas 3 applications. It has since been discontinued following the launch of the first party Gambas Software Farm integrated into the IDE since 3.7.1, which contains nearly 500 applications and demos. Several community sites, including community forums and mailing lists, also exist for Gambas. A notable application written in Gambas is Xt7-player-mpv, a GUI frontend for mpv player contained in a number of Linux software repositories.


Availability

Gambas is included in the repositories of a number of Linux distributions, such as Debian, Fedora,
Mandriva Linux Mandriva Linux (a fusion of the French distribution Mandrake Linux and the Brazilian distribution Conectiva Linux) is a discontinued Linux distribution developed by Mandriva S.A. Each release lifetime was 18 months for base updates (Linux, system ...
and
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in three editions: '' Desktop'', ''Server'', and ''Core'' for Internet of things devices and robots. All ...
. 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 machine In computing, a virtual machine (VM) is the virtualization/ emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized h ...
s. An independent contributor, François Gallo, also worked on porting Gambas 3.x to
Mac OS X macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and la ...
and FreeBSD, based on using local versions of the
X11 The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems. X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wi ...
system. Gambas from version 3.2 can run on
Raspberry Pi Raspberry Pi () is a series of small single-board computers (SBCs) developed in the United Kingdom by the Raspberry Pi Foundation in association with Broadcom. The Raspberry Pi project originally leaned towards the promotion of teaching basic ...
, and offers
just-in-time compilation In computing, just-in-time (JIT) compilation (also dynamic translation or run-time compilations) is a way of executing computer code that involves compilation during execution of a program (at run time) rather than before execution. This may co ...
there from version 3.12. 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. It has also been successfully run using the
Windows Subsystem for Linux Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ser ...
.,Gambas on Windows
Gambas-One
this is usually done using an
X terminal In computing, an X terminal is a display/input terminal for X Window System client applications. X terminals enjoyed a period of popularity in the early 1990s when they offered a lower total cost of ownership alternative to a full Unix workstat ...
emulator such Mobaxterm on Windows as WSL does not support
X11 The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems. X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wi ...
graphics directly.


Example code

A "Hello, World!" program with graphical user interface. Public Sub Main() Message("Hello, World!") End Program that computes a 100-term polynomial 500000 times, and repeats it ten times (used for benchmarking). Private Sub Test(X As Float) As Float Dim Mu As Float = 10.0 Dim Pu, Su As Float Dim I, J, N As Integer Dim aPoly As New Float 00 N = 500000 For I = 0 To N - 1 For J = 0 To 99 Mu = (Mu + 2.0) / 2.0 aPoly = Mu Next Su = 0.0 For J = 0 To 99 Su = X * Su + aPoly Next Pu += Su Next Return Pu End Public Sub Main() Dim I as Integer For I = 1 To 10 Print Test(0.2) Next End


See also

* List of BASIC dialects * Comparison of integrated development environments#BASIC *
GNAVI GNAVI is an open-source visual software development environment that is composed of three major portions: GWindows GUI framework, GNATCOM ActiveX/COM framework, and GWenerator code generator. The inspiration for GNAVI is Delphi and Visual Bas ...
* Lazarus


References


Further reading

* Mark Alexander Bain (Apr 28, 2006)
An Introduction to Gambas
', Linux Journal, issue 146, June 2006 (in print) * Mark Alexander Bain (Dec 3, 2004)
Gambas speeds database development
', Linux.com * Mark Alexander Bain (Dec 12, 2007)
Creating simple charts with Gambas 2.0
', Linux.com * Fabián Flores Vadell (Nov, 2010)
How to Program with Gambas
'


External links


Gambas source code

Gambas Documentation

Gambas Mailinglist



Gambas India Forum
nbsp;— Forum, Bunch of Source Code Repo with Gambas
Gambas Magazine
nbsp;— Linux Software Development with Gambas {{Qt BASIC compilers BASIC interpreters BASIC programming language family Free integrated development environments Free software Free software programmed in BASIC Linux integrated development environments Linux programming tools Object-oriented programming languages Procedural programming languages Programming languages created in 1999 Self-hosting software Software that uses Qt Software that uses GTK Software using the GPL license User interface builders