Safekipedia

Gambas

Adapted from Wikipedia · Adventurer experience

Mascot of Gambas, a free programming language for Linux, in 1.x versions and earlier. (See w:Gambas.)

Gambas is a special kind of computer language. It is an object-oriented version of the BASIC programming language. It also has a helpful tool called an integrated development environment to make writing and testing programs easier.

This language works mainly on Linux and other similar operating systems called Unix-like. Its name, Gambas, comes from a funny trick called a recursive acronym. It stands for Gambas Almost Means BASIC.

The word "gambas" is also the Spanish, French, and Portuguese word for prawns. The pictures for the Gambas project are inspired by this meaning.

History

Gambas was created by a programmer from France named Benoît Minisini in 1999. Benoît loved the BASIC language and wanted to make a free tool to easily build programs with windows and buttons.

The first versions of Gambas, called 1.x, came out in 2005. They looked like older versions of GIMP and worked mainly with Qt for building programs. The next versions, called 2.x, started in 2008 with a new design where everything was in one window and could also work with GTK+ and SDL.

The newest versions, called 3.x, began in 2011. By 2021, Gambas could work with a modern system called Wayland and had become faster than some other popular languages in tests.

Features

Gambas helps people create programs that can show windows and buttons, like the ones on a computer. It works with different tools to make these programs look nice and run well. You can also use it to make programs that run in the command line, a special way to give instructions to a computer.

Gambas has many extra parts that you can add to give your programs more abilities. For example, you can make programs that use your computer's graphics card to show fast and exciting pictures. It can also help you save and find information in databases, and even make programs that work on the internet. The tools that come with Gambas make it easier to put everything together when you finish your program.

Adoption

Many programs and examples have been created using Gambas. Websites like Freecode showed applications made with Gambas, and the Gambas wiki had many. There are special websites, forums, and mailing lists for Gambas users.

One program called Gambas3 ShowCase helped people download Gambas applications, but it is no longer used. Now, a new part called the Gambas Software Farm, included since version 3.7.1, offers many applications and demos. Some well-known programs made with Gambas are Xt7-player-mv, a way to use the mpv player, and I-Nex, a tool to show hardware information. The comisat Games Collection are some of the first video games created with Gambas.

Availability

Gambas works on many Linux distributions, like Debian, Fedora, Slackware, Arch Linux, Mageia, PCLinuxOS, Linux Mint, and Ubuntu. You can also use it on Microsoft Windows with a special tool called Cygwin, but this version isn’t fully tested. People have tried to make Gambas work on Mac OS X and FreeBSD. Since version 3.2, Gambas can run on Raspberry Pi and runs faster from version 3.12. You can even use Gambas through the cloud with a service called rollApp.

Example code

Here is a simple "Hello, World!" program with a graphical user interface:

Public Sub Main()
    Message("Hello, World!")
End

This next program does a special math task many times to see how fast the computer can work:

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\[100\]

    N \= 500000

    For I \= 0 To N \- 1
        For J \= 0 To 99
           Mu \=  (Mu + 2.0) / 2.0
           aPoly\[J\] \= Mu
        Next
        Su \= 0.0
        For J \= 0 To 99
            Su \= X \* Su + aPoly\[J\]
        Next
        Pu += Su
    Next

    Return Pu

End

The last part of the program runs the test ten times:

Public Sub Main()

    Dim I as Integer

    For I \= 1 To 10
        Print Test(0.2)
    Next

End

Related articles

This article is a child-friendly adaptation of the Wikipedia article on Gambas, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.