Liberty BASIC

Last updated
Liberty BASIC
Paradigm Event-driven, Procedural
Designed by Carl Gundel
Developer Shoptalk Systems
First appeared1992;32 years ago (1992)
Stable release
4.5.1 / May 31, 2017;6 years ago (2017-05-31)
Typing discipline Dynamic, weak
OS Microsoft Windows; Linux in unreleased Liberty Basic 5
License proprietary
Filename extensions .bas, .fr3
Website libertybasic.com
Major implementations
Run BASIC, GLBCC
Influenced by
QuickBASIC
Influenced
Just BASIC, Leopard
The Liberty Basic v4.03 IDE system LibertyBASICv4.03.png
The Liberty Basic v4.03 IDE system

Liberty BASIC (LB) is a commercial computer programming language and integrated development environment (IDE). It has an interpreter, developed in Smalltalk, which recognizes its own dialect of the BASIC programming language. It runs on 16- and 32-bit Windows and OS/2.

Contents

Background

Liberty BASIC was written by Carl "Gunner" Gundel and published in its first release by his company, Shoptalk Systems, in 1991. It has progressed steadily since then. The last published update to the software, version 4.5.1, was in June 2018. [1]

Though Liberty BASIC has its share of limitations in its design for advanced programming, it provides an introductory integrated development environment, IDE, for moderate to advanced users of Windows and OS/2. Dynamic-link libraries (DLLs) are available. In its current version, it runs only on Microsoft Windows, and under Wine on Linux. Alpha testing of Liberty BASIC v5.0 is underway with versions that run on Microsoft Windows, Mac OS X, Linux and on the Raspberry Pi as well.

Liberty BASIC does not compile to native code. Instead it compiles the code written in the IDE to an encrypted file with the extension TKN. This file is then executed by an EXE file that carries the same file name, although this may change with the release of version 5.

Features

Liberty Basic v4.03 running on Linux with Wine LB403 UBUNTU8041.png
Liberty Basic v4.03 running on Linux with Wine

Distinguishing features

Liberty BASIC allows for procedural programming in a style similar to DOS BASICs that run in console mode, using a default "main window" that displays formatted text and accepts user input. It also supports event-driven programming based on a graphical user interface (GUI), using several types of windows that may contain the standard controls such as buttons, menus, textboxes, etc.

A central idea in creating Liberty BASIC was to model the handling of windows after the syntax for file handling. For example, (from the Liberty BASIC Help File):

"The OPEN command opens communication with a device, which can be a disk file, a window, a dynamic-link library or a serial communications port."

OPENdeviceFORpurposeAS#handle{LEN=n}

Once a “device” is open, data and also commands to control that device can be “printed” to it. For each type of device there is a set of commands which can be sent to it in this way. In the more recent versions of LB the word "print" may be dropped from the "print" statement, making the syntax even simpler.

Simplicity has been at the heart of Liberty BASIC from the beginning. This makes it easier to learn but at some cost, perhaps, in limiting functionality. Only two data types are supported in LB v4.03 — numeric and string. No type declarations are required; any variable with a $ sign at the end of its name is a string variable, otherwise it is numeric. (The plan for LB v5 is to support other types and user defined types as well as these.) For the purpose of making calls to an API or third-party DLLs there is a STRUCT and the additional types necessary for the DLL. The only other data structure supported is the ARRAY. Arrays of one or two dimensions are supported. LB v5 may support arrays of user-defined types.

Notable programs written in Liberty BASIC

Example code

Here are some examples of the language:

"Hello, World!" program:

print"Hello, World!"end

Program to display a pop-up message box with the words "Hello, World!" on it:

nomainwinnotice"Hello, World!"end
nomainwinnotice"Example program"+CHR$(13)+"Hello, World!"end

Program to display an input box:

nomainwinprompt"Enter your name:";response$notice"Response:"+CHR$(13)+response$end

Running another application:

nomainwinrun"notepad.exe"end

Printing multiplication table of 5 on form:

[multi]fori=1to15res=5*iprintresnextiend

Alternative implementations

The GNU/Liberty Basic Compiler Collection (GLBCC), by Anthony Liguori, is a set of tools to compile Liberty Basic programs, runs on Windows and Linux systems, but the project has not been updated since 2001.

In 2012 an alternative Windows implementation of Liberty BASIC, LB Booster (LBB), became available. Although substantially compatible with the Liberty BASIC 4 language syntax, LBB was developed entirely independently by Richard Russell and is written in BBC BASIC.

LBB offers (typically) increased execution speed, smaller self-contained executables and some additional capabilities. However LBB is not 100% compatible with LB4 and while many programs will run without modification, some may need to be adapted, or may even be unsuitable for running under LBB.

Liberty Basic does not provide for data declarations. Instead any new data name is treated as a new declaration. Some regard this as a benefit, others see it as a debugging issue for imperfect typers. In 2019 Peter J. D. Matthews devised a method for adding declarations and checking for undeclared data - without changing the code seen by the LB interpreter. In 2023 this system was ported to GitHub in public repository "LBPrePass" for anyone to use. This repository also contains program documentation. The program is written in Liberty Basic 4.5.1 and is intended to analyse 4.5.1 code.

See also

Related Research Articles

<span class="mw-page-title-main">Blitz BASIC</span>

Blitz BASIC is the programming language dialect of the first Blitz compilers, devised by New Zealand-based developer Mark Sibly. Being derived from BASIC, Blitz syntax was designed to be easy to pick up for beginners first learning to program. The languages are game-programming oriented but are often found general purpose enough to be used for most types of application. The Blitz language evolved as new products were released, with recent incarnations offering support for more advanced programming techniques such as object-orientation and multithreading. This led to the languages losing their BASIC moniker in later years.

<span class="mw-page-title-main">PureBasic</span>

PureBasic is a commercially distributed procedural computer programming language and integrated development environment based on BASIC and developed by Fantaisie Software for Windows, Linux, and macOS. An Amiga version is available, although it has been discontinued and some parts of it are released as open-source. The first public release of PureBasic for Windows was on 17 December 2000. It has been continually updated ever since.

<span class="mw-page-title-main">PowerBASIC</span> Software compiler

PowerBASIC, formerly Turbo Basic, is the brand of several commercial compilers by PowerBASIC Inc. that compile a dialect of the BASIC programming language. There are both MS-DOS and Windows versions, and two kinds of the latter: Console and Windows. The MS-DOS version has a syntax similar to that of QBasic and QuickBASIC. The Windows versions use a BASIC syntax expanded to include many Windows functions, and the statements can be combined with calls to the Windows API.

XBasic is a variant of the BASIC programming language that was developed in the late 1980s for the Motorola 88000 CPU and Unix by Max Reason. In the early 1990s it was ported to Windows and Linux, and since 1999 it has been available as open source software with its runtime library under the LGPL license.

<span class="mw-page-title-main">Windows API</span> Microsofts core set of application programming interfaces on Windows

The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running.

<span class="mw-page-title-main">GFA BASIC</span> Computer programming language

GFA BASIC is a dialect of the BASIC programming language, by Frank Ostrowski. The name is derived from the company, which distributed the software. In the mid-1980s to the 1990s it enjoyed popularity as an advanced BASIC dialect, but has been mostly superseded by several other programming languages. Official support ended in the early 2000s.

<span class="mw-page-title-main">FreeBASIC</span> BASIC dialect

FreeBASIC is a free and open source multiplatform compiler and programming language based on BASIC licensed under the GNU GPL for Microsoft Windows, protected-mode MS-DOS, Linux, FreeBSD and Xbox. The Xbox version is no longer maintained.

thinBasic is a BASIC-like computer programming language interpreter with a central core engine architecture surrounded by many specialized modules. Although originally designed mainly for computer automation, thanks to its modular structure it can be used for wide range of tasks.

A dynamic-link library (DLL) is a shared library in the Microsoft Windows or OS/2 operating system.

<span class="mw-page-title-main">Visual Basic (classic)</span> Microsofts programming language based on BASIC and COM

Visual Basic (VB) before .NET, sometimes referred to as Classic Visual Basic, is a third-generation programming language, based on BASIC, and an integrated development environment (IDE), from Microsoft for Windows known for supporting rapid application development (RAD) of graphical user interface (GUI) applications, event-driven programming and both consumption and development of components via the Component Object Model (COM) technology.

<span class="mw-page-title-main">Vala (programming language)</span> Programming language

Vala is an object-oriented programming language with a self-hosting compiler that generates C code and uses the GObject system.

<span class="mw-page-title-main">QB64</span> IDE for the BASIC programming language

QB64 is a self-hosting BASIC compiler for Microsoft Windows, Linux and Mac OS X, designed to be compatible with Microsoft QBasic and QuickBASIC. QB64 is a transpiler to C++, which is integrated with a C++ compiler to provide compilation via C++ code and GCC optimization.

XBLite is a free Open Source BASIC programming language compiler and development system. It was started in 2001 by David Szafranski in order to provide a Windows exclusive version of the XBasic dialect. XBLite is released under the GNU GPL licensing scheme, Standard libraries are released under the GNU LGPL licensing scheme.

<span class="mw-page-title-main">GLBasic</span> Commercial BASIC programming language

GLBasic is a commercial BASIC programming language that can compile to various platforms including Windows, Linux, Mac OS X, and some handheld devices. The language is designed to be simple and intuitive.

Basic4ppc is a programming language originally for Pocket PC handheld computers running Windows Mobile operating system, by Anywhere Software. Since 2014, B4x was renamed, and currently, 2023, supports multiple devices and their OS, including desktop and mobile solutions with development adaptions for these environments. The language is based on a BASIC-like syntax, taking advantage of Microsoft's .NET technology, to allow additional libraries, graphical user interface design of windows forms, rapid application development (RAD), and .NET framework compatible compilation. The language implements a unique way of adding objects to a program without being object-oriented. Its advantages are simplicity, development pace and the integration with .NET framework. A special version of the integrated development environment (IDE) allows developing straight onto the Windows Mobile device or. With the demise of Windows Mobile operating system and the devices running it Basic4PPC came to the end of its life in about 2012. For owners of Basic4PPC it remains a useful Windows-desktop BASIC compiler as it runs code directly in the Windows environment and it can compile a project to a Windows 'exe' file for use as a Windows program.

<span class="mw-page-title-main">Hollywood (programming language)</span> Programming language

Hollywood is a commercially distributed programming language developed by Andreas Falkenhahn which mainly focuses on the creation of multimedia-oriented applications. Hollywood is available for AmigaOS, MorphOS, WarpOS, AROS, Windows, macOS, Linux, Android, and iOS. Hollywood has an inbuilt cross compiler that can automatically save executables for all platforms supported by the software. The generated executables are completely stand-alone and do not have any external dependencies, so they can also be started from a USB flash drive. An optional add-on also allows users to compile projects into APK files.

Proteus is a fully functional, procedural programming language created in 1998 by Simone Zanella. Proteus incorporates many functions derived from several other languages: C, BASIC, Assembly, Clipper/dBase; it is especially versatile in dealing with strings, having hundreds of dedicated functions; this makes it one of the richest languages for text manipulation.

<span class="mw-page-title-main">Red (programming language)</span> Computer programming language released in 2011

Red is a programming language designed to overcome the limitations of the programming language Rebol. Red was introduced in 2011 by Nenad Rakočević, and is both an imperative and functional programming language. Its syntax and general usage overlaps that of the interpreted Rebol language.

Absoft Fortran Compilers are set of Fortran compilers for Microsoft Windows, Apple Macintosh, and Linux produced by Absoft Corporation. The compilers are source code compatible across platforms.

References

  1. "Liberty BASIC News". www.libertybasic.com. Retrieved January 25, 2019.