Est. 2004 Beginner

FreeBASIC

A free, open-source, multi-platform BASIC compiler with a syntax largely compatible with Microsoft QuickBASIC and modern extensions for object-oriented and systems programming.

Created by André Victor ("v1ctor") and the FreeBASIC development team

Paradigm Procedural, Object-Oriented, Imperative, Structured
Typing Static, Strong (with optional implicit typing in QB-compatible dialect)
First Appeared 2004
Latest Version FreeBASIC 1.10.x (released around 2023)

FreeBASIC is a free, open-source, multi-platform BASIC compiler designed to combine the familiar syntax of Microsoft’s QuickBASIC with modern features such as pointers, user-defined types, object orientation, and direct access to C libraries. It produces native executables on Windows, Linux, DOS, and FreeBSD, making it one of the most capable open-source BASIC implementations available today.

History & Origins

FreeBASIC was started in 2004 by André Victor, known online as v1ctor, who wanted a free, modern compiler that could compile existing QuickBASIC code on contemporary operating systems while extending the language with features expected of a modern systems-capable BASIC. The project quickly attracted contributors from the broader QuickBASIC and QBasic communities, many of whom were looking for a way to keep their existing code running on 32-bit (and later 64-bit) Windows and Linux.

Early versions of FreeBASIC targeted 32-bit Windows and DOS, with Linux support following shortly afterward. The compiler progressed toward self-hosting in its early development cycle, eventually being able to compile itself, and grew a community of contributors who maintained ports, libraries, and bindings.

A major milestone came in late 2015 with the release of FreeBASIC 1.00.0, the first version designated as a stable 1.x release. Development has continued through the 1.0x and later 1.10.x series, with refinements to the runtime library, the GCC-based backend, and platform support.

Design Philosophy

FreeBASIC’s design balances two priorities that don’t always sit comfortably together:

  1. Backward compatibility with QuickBASIC — Programs written in Microsoft QuickBASIC 4.5 should, in most cases, compile and run with minimal changes when using the QB-compatible dialect.
  2. A modern systems-programming language — The default FreeBASIC dialect offers strict typing, pointers, user-defined types, namespaces, operator overloading, and object-oriented features comparable to C++ in spirit if not in syntax.

To reconcile these goals, FreeBASIC uses a dialect system controlled by the -lang compiler switch or a #lang directive in source:

DialectPurpose
fbThe default modern FreeBASIC dialect — strict typing, OO features, namespaces
fbliteA relaxed dialect closer to traditional BASIC, with implicit variables and less strict scoping
qbA QuickBASIC compatibility mode aimed at compiling legacy QB code
deprecatedA mode preserving older FreeBASIC behavior for transitional codebases

This allows the same compiler to serve both as a drop-in for legacy QuickBASIC code and as a modern BASIC-style systems language.

Key Features

Native Compilation

FreeBASIC compiles directly to native machine code rather than relying on a virtual machine or interpreter. It has historically supported two backends:

  • A traditional backend producing assembly fed to an assembler such as GAS or FASM.
  • A GCC backend that emits C-like intermediate output passed to GCC for optimization and code generation.

The GCC backend, in particular, enables FreeBASIC programs to benefit from GCC’s mature optimizer.

Modern Language Features

In its default fb dialect, FreeBASIC supports a substantial set of modern programming features, including:

  • Strong static typing with explicit declarations
  • Pointers and pointer arithmetic
  • User-defined types (records), unions, and enumerations
  • Classes with inheritance, virtual methods, and constructors/destructors
  • Operator overloading
  • Namespaces
  • Function overloading
  • Inline assembly (on supported architectures)
  • Direct calling of C-ABI functions, enabling straightforward use of existing C libraries

QuickBASIC Compatibility

Through its qb dialect, FreeBASIC aims to compile a large body of existing QuickBASIC 4.5 source with little or no modification. This has made it a popular choice for hobbyists revisiting old code from the DOS era, and for educators who still teach beginning programming using QuickBASIC-style syntax.

Some QuickBASIC features that depended on DOS-specific behavior (such as direct hardware port access or particular graphics modes) require care or platform-specific adaptation, but the core language constructs — GOSUB, line numbers, DEF FN, SHARED variables, and so on — are supported.

Cross-Platform Support

According to the official FreeBASIC documentation, the compiler targets several platforms, including:

  • Windows (32-bit and 64-bit)
  • Linux (32-bit and 64-bit on x86 family)
  • DOS (via DJGPP, producing 32-bit protected-mode executables)
  • FreeBSD

The exact set of supported targets has varied over the project’s history; the FreeBASIC website and its documentation are the authoritative source for the current list of platforms and architectures.

Graphics and Multimedia

FreeBASIC ships with a built-in graphics library that provides QB-style commands such as SCREEN, PSET, LINE, CIRCLE, and DRAW, allowing direct porting of QuickBASIC graphics programs. For more demanding graphics work, community-maintained bindings exist for SDL, Allegro, OpenGL, and other widely used libraries.

A Simple FreeBASIC Program

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
' Greeting program in modern FreeBASIC dialect
#lang "fb"

Type Person
    Declare Constructor(ByRef aName As String)
    Declare Sub Greet()
    name As String
End Type

Constructor Person(ByRef aName As String)
    this.name = aName
End Constructor

Sub Person.Greet()
    Print "Hello, "; this.name; "!"
End Sub

Dim As Person p = Person("World")
p.Greet()

Compile and run with:

1
2
fbc greeting.bas
./greeting

A simpler, QuickBASIC-style version of the same idea looks much more familiar to anyone coming from QB:

1
PRINT "Hello, World!"

Evolution

FreeBASIC has evolved gradually but steadily since its first public releases in 2004:

  • 0.1x–0.16 (2004–2006): Initial Windows, DOS, and Linux targets; growth of the standard runtime and QB compatibility.
  • 0.17–0.18 (~2007): Introduction of object-oriented features in the modern dialect.
  • 0.20–0.23 (around 2008–2011): Stabilization of OO features and addition of 64-bit support.
  • 0.90–0.91 (around 2013–2014): GCC backend matures, expanded platform coverage.
  • 1.00 (2015): First stable 1.x release, consolidating prior development.
  • 1.05–1.07 (around 2016–2019): Continued refinements to the runtime, backend, and toolchain.
  • 1.10.x (around 2023): Further compiler and toolchain improvements with updated GCC backend integration.

Throughout this evolution, the project has remained backward-compatible enough that long-time users can still build code written for early FreeBASIC versions with relatively small adjustments.

Current Relevance

FreeBASIC occupies a specific but durable niche in modern programming:

  • It is the most prominent open-source compiler with strong QuickBASIC compatibility, making it the natural choice for keeping legacy QB code alive on current systems.
  • It serves as an approachable first language for some learners, offering both the gentleness of BASIC and a smooth path to lower-level systems concepts.
  • It is popular among hobbyist game developers and members of the demoscene community, where its mix of simplicity, native compilation, and direct C-library access is attractive.
  • It supports DOS targets via DJGPP, giving it a foothold in retro and embedded-style projects where other modern toolchains do not fit.

While FreeBASIC is not a mainstream commercial language and does not drive large enterprise systems, its community remains active, and its forums, wiki, and library bindings continue to evolve.

Why FreeBASIC Matters

FreeBASIC is one of the clearest examples of a community keeping a beloved language alive past the end of its commercial life. By providing a free, native compiler that respects QuickBASIC heritage while adding modern type-safety and object-orientation, FreeBASIC bridges a generation of programmers raised on BASIC with the realities of contemporary 32- and 64-bit operating systems.

For anyone maintaining QuickBASIC code, writing small native tools in a BASIC-like syntax, or simply enjoying the directness of the BASIC tradition, FreeBASIC remains a remarkably capable and well-supported option.

Timeline

2004
André Victor ("v1ctor") begins the FreeBASIC project; the first public releases appear later that year, initially targeting 32-bit Windows and DOS
2005
Early development versions add Linux as a target and progress toward a self-hosting compiler
2006
Version 0.16 series brings broader QuickBASIC compatibility and improvements to the standard library
2007
Around this time, object-oriented programming features (classes, inheritance, polymorphism) are introduced via the -lang fb dialect
2011
Initial 64-bit (x86_64) support for Windows and Linux is added in the 0.2x series
2015
Version 1.00.0 released, marking the first stable 1.x release with consolidated 32- and 64-bit support across Windows, Linux, DOS, and FreeBSD
2019
Version 1.07.x released with continued improvements to the GCC backend, the runtime library, and platform support
2023
Version 1.10.x released with further compiler refinements and updated GCC backend integration

Notable Uses & Legacy

Hobbyist Game Development

FreeBASIC is widely used by hobbyist game developers, particularly those migrating from QuickBASIC or QBasic, leveraging built-in graphics primitives and bindings to libraries such as SDL, Allegro, and OpenGL.

Legacy QuickBASIC Code Maintenance

Developers and educators use FreeBASIC to compile and modernize existing QuickBASIC and QBasic programs on current 32- and 64-bit operating systems, where the original Microsoft tooling no longer runs natively.

Demoscene and Retro Programming

FreeBASIC has a following in the demoscene and retro-computing communities, where its low-level access, inline assembly support, and DOS target make it useful for producing small, performant programs in a BASIC-like syntax.

Education and Teaching

Because of its approachable BASIC syntax, free availability, and cross-platform support, FreeBASIC is used in informal teaching settings as a stepping stone from beginner BASIC to more structured programming.

Small Utilities and Tools

Independent developers use FreeBASIC to write native command-line utilities and small GUI applications, taking advantage of direct C library bindings and the ability to produce single, self-contained executables.

Language Influence

Influenced By

QuickBASIC QBasic Visual Basic C

Running Today

Run examples using the official Docker image:

docker pull
Last updated: