Jump to content

Gambas: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
mNo edit summary
Availability
Line 22: Line 22:
}}
}}
'''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 system]]s,<ref name="FOSSwire">{{cite web |url=http://fosswire.com/post/2008/09/gambas-almost-visual-basic-for-linux/ |first=Peter |last=Upfold|title=Gambas&nbsp;— Almost Visual Basic for Linux |date=2008-09-08 |publisher=FOSSwire |accessdate=2011-05-07}}</ref> its name is a [[recursive acronym]] for ''Gambas Almost Means Basic''. Gambas is also the word for [[prawn]]s in the [[Spanish language|Spanish]] language, from which the project's logos are derived.
'''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 system]]s,<ref name="FOSSwire">{{cite web |url=http://fosswire.com/post/2008/09/gambas-almost-visual-basic-for-linux/ |first=Peter |last=Upfold|title=Gambas&nbsp;— Almost Visual Basic for Linux |date=2008-09-08 |publisher=FOSSwire |accessdate=2011-05-07}}</ref> its name is a [[recursive acronym]] for ''Gambas Almost Means Basic''. Gambas is also the word for [[prawn]]s in the [[Spanish language|Spanish]] language, from which the project's logos are derived.

Gambas is included in the repositories of a number of [[Linux distribution]]s, such as [[Debian]], [[Fedora (operating system)|Fedora]], [[Mandriva Linux]] and [[Ubuntu (operating system)|Ubuntu]]. A [[Microsoft Windows]] version of Gambas can run under the [[Cygwin]] environment, although this version is significantly less tested than its Linux counterparts and is command-line only; [[Cooperative Linux]] and derivatives have also been used.

Gambas from version 3.2 can run on [[Raspberry Pi]], but offers no JIT there.{{Clarify|date=November 2013}}<!-- The acronym "JIT" doesn't make sense here. Does it stand for "Just In Time". What is meant by "there"? -->


== History ==
== History ==
Line 36: Line 32:
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 [[Simple DirectMedia Layer|SDL]] for drawing or utilize [[OpenGL]] acceleration. Gambas 2.x versions can load up and run Gambas 1.x projects, with occasional incompatibilities.
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 [[Simple DirectMedia Layer|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.<ref name="TheH">{{cite web | url=http://www.h-online.com/open/news/item/Gambas-3-0-for-BASIC-with-bug-and-security-fixes-1403082.html | title=Gambas 3.0 for BASIC with bug and security fixes | publisher=The H | accessdate=2012-01-05}}</ref> Early benchmarks of the Gambas 3 development versions showed its Gambas scripting being significantly faster than [[Perl]] and [[Python (programming language)|Python]] equivalents.<ref name="benchmark">{{cite web | url=http://gambasdoc.org/help/doc/benchmark | title=Benchmarking | publisher=Gambas Website| accessdate=2011-05-07}}</ref> An independent contributor, François Gallo, has also ported Gambas 3.x to [[Mac OS X]] and says he will release packages for it.<ref name="macport">{{cite web | url=http://old.nabble.com/A-step-forward-in-Gambas!-td31859718.html | title=A step forward in Gambas! | publisher=François Gallo | accessdate=2011-07-18}}</ref>
The next major iteration of Gambas, the 3.x versions, was released on December 31, 2011.<ref name="TheH">{{cite web | url=http://www.h-online.com/open/news/item/Gambas-3-0-for-BASIC-with-bug-and-security-fixes-1403082.html | title=Gambas 3.0 for BASIC with bug and security fixes | publisher=The H | accessdate=2012-01-05}}</ref> Early benchmarks of the Gambas 3 development versions showed its Gambas scripting being significantly faster than [[Perl]] and [[Python (programming language)|Python]] equivalents.<ref name="benchmark">{{cite web | url=http://gambasdoc.org/help/doc/benchmark | title=Benchmarking | publisher=Gambas Website| accessdate=2011-05-07}}</ref>


== Features ==
== Features ==
Line 58: Line 54:
[[Image:DONKEY-GB.png|thumb|right|[[DONKEY.BAS#DONKEY.GB|DONKEY.GB]]]]
[[Image:DONKEY-GB.png|thumb|right|[[DONKEY.BAS#DONKEY.GB|DONKEY.GB]]]]
Several programs and many forms of example code have been written using and for Gambas. {{As of|2012|10|28}}, [[Freshmeat]] listed 23 applications that were developed using Gambas,<ref name="freshmeat">{{cite web | url=http://freshmeat.net/tags/gambas | title=23 projects tagged "Gambas" | publisher=[[Freshmeat]]| accessdate=2012-10-28}}</ref> while the Gambas wiki listed 70;<ref>{{cite web | url=http://gambasdoc.org/help/app?en&view | title=Application Repository | publisher=Gambas | accessdate=2011-07-16}}</ref> several other specialized sites list Gambas applications and code.<ref name="gambasbasic">{{cite web | url=http://gambaslinux.eg2.fr/index.php?lng=en | title=GAMBAS BASIC Web site | publisher=GAMBAS BASIC| accessdate=2011-05-07}}</ref><ref name="rossetacode">{{cite web | url=http://rosettacode.org/wiki/Category:Gambas | title=Gambas Category | publisher=Rosseta Code| accessdate=2011-11-18}}</ref><ref name="pigaexamples">{{cite web | url=http://piga.orain.org/wiki/Gambas_Examples | title=Gambas Examples | publisher=Piga Software| accessdate=2011-05-07}}</ref><ref name="pigaprograms">{{cite web | url=http://piga.orain.org/wiki/Category:Gambas_Programs | title=Gambas Programs | publisher=Piga Software| accessdate=2011-05-07}}2010</ref> There is even a Gambas written application, named Gambas3 ShowCase, that acts as a software center to download or install Gambas 3 applications.<ref name="Gambas3 Programs">{{cite web | url=http://gambasshowcase.org/ | title=Gambas3 ShowCase | publisher=gbWilly| accessdate=2013-09-22}}</ref> Several community sites, including community forums and mailing lists, also exist for Gambas.<ref name="community">{{cite web | url=http://gambasdoc.org/help/doc/forum?en&view | title=Mailing Lists & Forums | publisher=Gambas Web site| accessdate=2011-05-07}}</ref> White Island Software offers project hosting, program listing, forums and more for Gambas users.<ref>[http://whiteislandsoftware.com/index.php?page=about About — White Island Software]</ref>
Several programs and many forms of example code have been written using and for Gambas. {{As of|2012|10|28}}, [[Freshmeat]] listed 23 applications that were developed using Gambas,<ref name="freshmeat">{{cite web | url=http://freshmeat.net/tags/gambas | title=23 projects tagged "Gambas" | publisher=[[Freshmeat]]| accessdate=2012-10-28}}</ref> while the Gambas wiki listed 70;<ref>{{cite web | url=http://gambasdoc.org/help/app?en&view | title=Application Repository | publisher=Gambas | accessdate=2011-07-16}}</ref> several other specialized sites list Gambas applications and code.<ref name="gambasbasic">{{cite web | url=http://gambaslinux.eg2.fr/index.php?lng=en | title=GAMBAS BASIC Web site | publisher=GAMBAS BASIC| accessdate=2011-05-07}}</ref><ref name="rossetacode">{{cite web | url=http://rosettacode.org/wiki/Category:Gambas | title=Gambas Category | publisher=Rosseta Code| accessdate=2011-11-18}}</ref><ref name="pigaexamples">{{cite web | url=http://piga.orain.org/wiki/Gambas_Examples | title=Gambas Examples | publisher=Piga Software| accessdate=2011-05-07}}</ref><ref name="pigaprograms">{{cite web | url=http://piga.orain.org/wiki/Category:Gambas_Programs | title=Gambas Programs | publisher=Piga Software| accessdate=2011-05-07}}2010</ref> There is even a Gambas written application, named Gambas3 ShowCase, that acts as a software center to download or install Gambas 3 applications.<ref name="Gambas3 Programs">{{cite web | url=http://gambasshowcase.org/ | title=Gambas3 ShowCase | publisher=gbWilly| accessdate=2013-09-22}}</ref> Several community sites, including community forums and mailing lists, also exist for Gambas.<ref name="community">{{cite web | url=http://gambasdoc.org/help/doc/forum?en&view | title=Mailing Lists & Forums | publisher=Gambas Web site| accessdate=2011-05-07}}</ref> White Island Software offers project hosting, program listing, forums and more for Gambas users.<ref>[http://whiteislandsoftware.com/index.php?page=about About — White Island Software]</ref>

== Availability ==
Gambas is included in the repositories of a number of [[Linux distribution]]s, such as [[Debian]], [[Fedora (operating system)|Fedora]], [[Mandriva Linux]] and [[Ubuntu (operating system)|Ubuntu]]. A [[Microsoft Windows]] version of Gambas can run under the [[Cygwin]] environment, although this version is significantly less tested than its Linux counterparts and is command-line only; [[Cooperative Linux]] and derivatives have also been used, as well as specialized Linux [[virtual machine]]s. 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.<ref name="macport">{{cite web | url=http://old.nabble.com/A-step-forward-in-Gambas!-td31859718.html | title=A step forward in Gambas! | publisher=François Gallo | accessdate=2011-07-18}}</ref> 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, future versions might be less X11 tied, making projects like [[Cygwin]] or utterly native versions on other platforms more possible. [[Benoît Minisini]] has stated that he intends to "encapsulate" X11 specific code to aid in any attempt to replace it.<ref>[http://gambas.8142.n7.nabble.com/Gambas-Future-or-what-kind-of-Gambas-we-want-tt44034.html#none Gambas Future or what kind of Gambas we want], Gambas Mailing List</ref>


== Example code ==
== Example code ==

Revision as of 18:59, 26 February 2014

Gambas
Gambas Logo
Gambas Logo
Gambas 3 Logo
Gambas 3 Logo
Gambas 2 Logo
Gambas 2 Logo
Gambas 3.3.4 running on Fedora 16 with Xfce
Gambas 3.3.4 running on Fedora 16 with Xfce
Designed byBenoît Minisini
First appeared1999
Stable release
3.5.1 / November 8, 2013; 10 years ago (2013-11-08)[1]
OSLinux, FreeBSD; version for
Mac OS X in progress
LicenseGNU GPLv2+
Websitegambas.sourceforge.net
Influenced by
Visual Basic, Java[2]

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,[3] its name is a recursive acronym for Gambas Almost Means Basic. Gambas is also the word for prawns in the Spanish language, from which the project's logos are derived.

History

Gambas 1.0.15 running from KDE

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.[2]

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.[4] The last release of the 1.x versions was Gambas 1.0.19.

Gambas 2.7 with Russian interface

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.[5] Early benchmarks of the Gambas 3 development versions showed its Gambas scripting being significantly faster than Perl and Python equivalents.[6]

Features

Gambas 2.7.0 running on Fedora Linux with Blackbox

Gambas is designed to build graphical applications programs using the Qt or the GTK+ toolkit; the Gambas IDE is written in Gambas itself.[7] Gambas includes a GUI designer to aid in creating user interfaces, but can also make command line applications.[8] 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.[9] Drawing can be provided either through Qt and GTK+ toolkits, with an additional component which is designed to switch between them.[10] Drawing can also be provided through the Simple DirectMedia Layer, 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.[10] There are also components for handling other specialized tasks.[9]

One of the examples running inside Gambas 3 IDE
Game: Stars War made in Gambas3

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.[11][12][13]

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.[14]

Adoption

DONKEY.GB

Several programs and many forms of example code have been written using and for Gambas. As of 28 October 2012, Freshmeat listed 23 applications that were developed using Gambas,[15] while the Gambas wiki listed 70;[16] several other specialized sites list Gambas applications and code.[17][18][19][20] There is even a Gambas written application, named Gambas3 ShowCase, that acts as a software center to download or install Gambas 3 applications.[21] Several community sites, including community forums and mailing lists, also exist for Gambas.[22] White Island Software offers project hosting, program listing, forums and more for Gambas users.[23]

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 can run under the Cygwin environment, although this version is significantly less tested than its Linux counterparts and is 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.[24] 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, future versions might be less X11 tied, making projects like Cygwin or utterly native versions on other platforms more possible. Benoît Minisini has stated that he intends to "encapsulate" X11 specific code to aid in any attempt to replace it.[25]

Example code

Hello world program with GUI.

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[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

Public Sub Main()

  Dim I as Integer

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

End

See also

References

  1. ^ "GAMBAS 3 Documentation". Retrieved 2012-01-01.
  2. ^ a b "Gambas Documentation Introduction". Gambas Website. Retrieved 2011-05-07.
  3. ^ Upfold, Peter (2008-09-08). "Gambas — Almost Visual Basic for Linux". FOSSwire. Retrieved 2011-05-07.
  4. ^ "Gambas: A Fast Visual Basic for Linux". CodeFez. Retrieved 2007-04-04.
  5. ^ "Gambas 3.0 for BASIC with bug and security fixes". The H. Retrieved 2012-01-05.
  6. ^ "Benchmarking". Gambas Website. Retrieved 2011-05-07.
  7. ^ "Gambas". Penguin Sightings. 2008-10-24. Retrieved 2012-02-18. {{cite web}}: |first= missing |last= (help)
  8. ^ An Alphabet of Computer Languages: BASIC, PCLinuxOS Magazine
  9. ^ a b Fernandez, Daniel (2004-11-11). "Regarding Gambas". OSNews. Retrieved 2011-05-07.
  10. ^ a b "Gambas RAD". Linux.co.uk. Retrieved 2011-05-07.
  11. ^ Mark Alexander Bain (2008-08-28). "Gambas -- Almost Visual Basic on Linux". Suite101. {{cite web}}: |access-date= requires |url= (help); Missing or empty |url= (help)
  12. ^ Frank Wieduwilt (October 2008). "Programming with the Gambas Basic IDE". Linux Pro Magazine. Retrieved 2011-12-10.
  13. ^ AWC Electronics. "Physical Computing with Linux: A Rapid Approach using Gambas". Retrieved 2012-02-18.
  14. ^ "Differences from Visual Basic". Gambas Website. Retrieved 2011-05-07.
  15. ^ "23 projects tagged "Gambas"". Freshmeat. Retrieved 2012-10-28.
  16. ^ "Application Repository". Gambas. Retrieved 2011-07-16.
  17. ^ "GAMBAS BASIC Web site". GAMBAS BASIC. Retrieved 2011-05-07.
  18. ^ "Gambas Category". Rosseta Code. Retrieved 2011-11-18.
  19. ^ "Gambas Examples". Piga Software. Retrieved 2011-05-07.
  20. ^ "Gambas Programs". Piga Software. Retrieved 2011-05-07.2010
  21. ^ "Gambas3 ShowCase". gbWilly. Retrieved 2013-09-22.
  22. ^ "Mailing Lists & Forums". Gambas Web site. Retrieved 2011-05-07.
  23. ^ About — White Island Software
  24. ^ "A step forward in Gambas!". François Gallo. Retrieved 2011-07-18.
  25. ^ Gambas Future or what kind of Gambas we want, Gambas Mailing List

Further reading