ArticleslgStudy

computer science

Gambas

Gambas is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Gambas rather than just read about it. In short: Gambas is an object-oriented dialect of the BASIC programming language, and an 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 — main illustration
Gambas — illustration

Key takeaways

  • Gambas belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Gambas to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Gambas from memory before moving on to harder problems.

Reference excerpt

Gambas is an object-oriented dialect of the BASIC programming language, and an 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, French, and Portuguese 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 were first released on January 4, 2005, and 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. 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 5.20.2 and the then-latest 2.7.10 version of Python 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 programs using the Qt (currently Qt 4.x or 5.x since 3.8.0) 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 in an event-driven style, but can also make command line applications, as well as text-based user interfaces using the ncurses 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 (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 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). Support for AppImage building was mainlined with version 3.19.0. 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, each class being represented in a file, as well as the archiver to package the program is all 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 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. Gambas also outlived two other attempts at implementing a Visual Basic style interface for Qt and GTK on Linux, those being HBasic and GNOME Basic, as well as the platform independent KBasic/Basic for Qt. Similar style IDEs have since been developed as well for FreeBASIC, namely VisualFBEditor, and QB64, namely InForm.

Adoption

Several programs and many forms of example code have been written using and for Gambas. Freecode (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. Notable applications written in Gambas include Xt7-player-mpv, a GUI frontend for mpv player contained in a number of Linux software repositories, and I-Nex, a program for displaying hardware data. The comisat Games Collection are early examples of video games written in Gambas.

… excerpt ends here. Continue reading the full article.

Illustrations

Gambas illustration
Gambas illustration
Gambas illustration
Gambas illustration
Gambas illustration

Worked examples

Example 1 — a first encounter with Gambas

Start with the simplest possible case. Write down what Gambas claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Gambas before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Gambas ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Gambas

In research
Gambas appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Gambas in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Gambas is common in secondary-school and first-year university syllabi. It links to neighbouring topics BASIC compilers, BASIC interpreters, BASIC programming language family, so understanding it makes those chapters shorter.
In everyday life
Look for Gambas outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Gambas” →

How to study Gambas in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Gambas means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Gambas out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Gambas in simple terms?

Gambas is an object-oriented dialect of the BASIC programming language, and an 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.

Why does Gambas matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Gambas?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Gambas.

Tags

  • BASIC compilers
  • BASIC interpreters
  • BASIC programming language family
  • Free integrated development environments
  • 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 GTK

Keep exploring