"The phenomenal quantity of bugs and inconsistencies that makes Visual Basic so delightful persuaded me to start this project". That's how Benoit Minisini, a 30-year-old French man living in the suburbs of Paris starts describing his project, named Gambas.
The aim of the Gambas project is to be a VB replacement for Linux. Not a clone, since Benoit never liked Microsoft's implementation: "It seems that Microsoft is aware of the poor quality of its language, as VB .Net is not backward compatible with older versions of Visual Basic. I think they have thrown away the Visual Basic interpreter source code, and that VB .Net is just a .Net runtime compiler whose syntax looks like the Visual Basic one."
Thus, Gambas is intended to be a better Visual Basic.
Benoit took from VB that which he found really useful: the BASIC language and the easy IDE. He also took some ideas from Java, resulting an easy and powerful language. How powerful? The entire IDE was created in Gambas itself, an indicator of its level of sophistication even before reaching 1.0.
In this article we'll try to describe Gambas' current status, and how it compares with VB. We'll compare screenshots and source code, so you can get the entire picture.
Gambas is not the first attempt to create a VB replacement for Linux by a longshot, but is the closest to maturity.
In fact, there were many other unfinished attempts to create a VB clone for Linux: RapidQ bought out by RealBASIC, which is just now shipping a Linux runtime with no IDE, Phoenix BASIC is frozen for 3 years, KBasic stalled, GNOME Basic shifted its focus to provide VBA support for GNOME apps, XBasic is mature but more primitive than a VB, HBasic is a worthy contender but unstable.
On the other hand, there are many BASIC languages without integrated IDEs, and many IDEs without the BASIC language.
Gambas has an unique mix of features that will allow many VB developers to migrate from Windows to Linux.
Finally, Gambas' component design means someone should be able to write a GUI component based on GTK+ with the same interface than the QT one, so that every gambas program can switch between QT GUI and GTK+ GUI.
One of the first programs you'll certainly find, in any programming language, is the venerable "Hello World".
Sub Command1_Click() Label1.Caption = "Hello World!" End Sub
SUB Button1_Click() Label1.Text = "Hello World!" END
See also: How do I... say Hello World in Gambas
If you don't want to create a form-based program, you can start a project without forms, and write the code:
SUB main() PRINT "Hello World!" END
This is pretty much the simplest thing you can do with Gambas - and yet, something Visual Basic can't do! (In VB there is a "Print" method, but it only applies to the debugger and to GDI objects like printer, form or picturebox.)
"This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface." -- Doug McIlroy
One of the greatest advantages of Gambas over VB is that Gambas is built upon the Unix philosophy. That means you can leverage the power of Linux, and its thousands of tools, instead of writing code.
Let's see some examples.
lynx -source url
)
If you ever programmed in BASIC, you'll have that warm feeling of familiarity when you start programming in Gambas.
VB programmers will feel comfortable right from the beginning.
For sure, Gambas is not VB, and VB programmers must be prepared for a few differences. But most changes are there for a specific reason: to make a better language. (It's important to remember that Gambas borrowed some good ideas from Java and other programming languages.)
With Gambas anyone can start programming graphical applications in minutes, and it will bring much more programmers and applications to GNU/Linux.
If you are a VB programmer and are unhappy with the recent platform changes (and the associated cost), you may consider converting your applications to Gambas.
Gambas developers have already released a small script, currently in version 0.1, which will convert VB forms to Gambas.
Vb2Gb was programmed in Perl due the strong text processing capabilities of that language, which soon will be implemented in Gambas.
In VB, form description and source code are mixed in a single File. Gambas splits these in two files: the form description and a class module.
There are also some control and property names that we can convert automatically. For instance, in VB we have "CommandButtons", while in Gambas (or QT?) they are called simply "Buttons"; the "Caption" property is called "Text" in Gambas.
Gambas is the closest thing to VB in the Linux world. It wasn't primarly intended to replace the millions of lines of VB code, but provide a rapid development tool based on the BASIC language. Nonetheless, Gambas developers are working on a tool to ease the migration from legacy VB applications.
Gambas is in steady progress. It's current version is considered alpha software, because some features are still being defined, but Gambas is already being used in complex applications such as the IDE itself. There's no hurry to release 1.0, and the goal is to make things right from the first time.
Gambas has a roadmap. Some of the new features that are expected for the next releases:
TO-DO: close the article with unbridled optimism