Est. 1999 Intermediate

Harbour

A free, open-source, cross-platform compiler for the xBase / Clipper programming language, designed as a modern, fully compatible successor to CA-Clipper.

Created by Antonio Linares (project founder) and the Harbour community

Paradigm Multi-paradigm: Procedural, Object-Oriented, Imperative; xBase data-centric
Typing Dynamic, weak (with optional type-prefix conventions inherited from Clipper)
First Appeared 1999
Latest Version Harbour 3.0.x stable line (released in the early 2010s); a 3.2 development branch has been worked on in the project repository since then

Harbour is a free, open-source, cross-platform compiler for the xBase family of languages — most specifically, a near-complete reimplementation of CA-Clipper (originally Nantucket Clipper). It lets developers take Clipper source code written for MS-DOS in the late 1980s and 1990s, recompile it largely unchanged, and run the resulting program as a native 32-bit or 64-bit binary on modern Windows, Linux, macOS, and other Unix-like systems. Around that core compatibility goal, Harbour adds an object-oriented programming model, a modular Replaceable Database Driver (RDD) architecture, and a large library of “contrib” modules covering everything from GUI toolkits to SQL clients to ZIP/PDF/image processing.

For a generation of business-software developers, Clipper was the tool that turned MS-DOS PCs into serious database workstations. Harbour is what kept that ecosystem alive after CA-Clipper itself stopped being actively developed: a community-built compiler that respects the original syntax and semantics while bringing the language onto operating systems and CPU architectures that did not exist when Clipper was current.

History and Origins

The Harbour project was founded in 1999 by Antonio Linares, with the explicit aim of producing a free, open-source compiler compatible with CA-Clipper 5.x. Clipper itself had a long lineage — Nantucket Corporation released the first Clipper compiler for dBase III code in the mid-1980s, Nantucket was acquired by Computer Associates in 1992, and CA-Clipper 5.3 became the last widely distributed version. By the late 1990s, mainstream development of CA-Clipper had effectively wound down, leaving thousands of organizations with substantial Clipper codebases and no clear forward path.

Harbour’s founding premise was straightforward: take the documented Clipper language, build an open-source compiler that emits portable C, link against a runtime that implements the Clipper standard library, and let the existing GNU and Microsoft toolchains do the rest. Hosted initially on SourceForge, the project attracted contributors from the xBase community worldwide and grew into a substantial codebase of compiler, virtual machine, RDDs, and contrib libraries.

In 2001, a parallel effort called xHarbour forked from Harbour, pursuing a policy of more aggressive language extensions and a faster cadence of new features at the cost of strict Clipper compatibility. The two projects coexist today, share much of their conceptual heritage, and target overlapping but distinct user bases: Harbour leans toward “Clipper, faithfully, on every platform you can name,” while xHarbour and its commercial derivatives lean toward “Clipper, plus everything we wish Clipper had had.”

Harbour reached its 2.0 release around 2010 and its 3.0.0 stable release in approximately 2011, the latter of which became the long-lived reference version for most distributions and downstream packagings. Development continued in a 3.2 branch in the public source repository, with the project being mirrored to GitHub as harbour/core in the mid-2010s.

Design Philosophy

Harbour’s design is shaped by a few firm commitments:

  • Clipper compatibility first. The language Harbour implements is, with very few intentional exceptions, the language defined by the CA-Clipper 5.x documentation. Existing PRG (Clipper source) files are expected to compile and behave the same way.
  • Cross-platform from the start. Harbour generates portable C, which is then compiled with the platform’s native C compiler (GCC, Clang, MSVC, MinGW, and others). That choice means Harbour can target any platform with a reasonable C toolchain, rather than being tied to a single OS as CA-Clipper was.
  • Modular database backends via RDDs. The Replaceable Database Driver architecture (DBFNTX, DBFCDX, DBFFPT, and others, plus SQL-backed RDDs) lets the same Harbour code work against multiple on-disk and remote data formats with little to no source change.
  • Object-oriented programming layered on procedural xBase. Harbour supports classes, inheritance, instance and class variables, and methods, building on the OO extensions that appeared in late CA-Clipper and in third-party Clipper class libraries.
  • Library by accumulation. Much of Harbour’s practical power lives in its contrib tree — bindings and wrappers contributed by community members for Qt, GTK, ZIP, PDF, JSON, regular expressions, HTTP, FreeImage, and many others — rather than in a single monolithic standard library.

Key Features

  • Full xBase syntax, including DO WHILE, FOR, IF/ELSEIF/ENDIF, code blocks ({|x| x * 2}), macro substitution (&macro), and the classic xBase database commands (USE, SELECT, APPEND, REPLACE, INDEX ON, SET FILTER TO, SCAN/ENDSCAN).
  • Native classes with inheritance, scoping (HIDDEN, PROTECTED, EXPORTED), and message-passing semantics consistent with the late-Clipper OO conventions.
  • A C-level API for writing extensions in C that interoperate with the Harbour virtual machine, used extensively by the contrib libraries.
  • Multiple RDDs out of the box for DBF with NTX, CDX, and FPT (memo) index/memo formats, plus contributed RDDs for SQL databases.
  • GUI options: the cross-platform Qt bindings (HBQT) used by hbIDE, plus community frameworks such as HMG (Harbour MiniGUI) for native Windows GUIs and several other widget toolkits.
  • Network and web support through contrib libraries: HTTP/HTTPS clients, simple web server frameworks, MIME and email handling, JSON serialization, and so on.
  • A self-hosting toolchain, including the harbour compiler, the hbmk2 build tool, and hbIDE — all written in or driven by Harbour itself.

A Small Example

A representative Harbour program looks unmistakably like Clipper:

PROCEDURE Main()
   LOCAL aCustomers := { ;
      { "Alice",   1200.50 }, ;
      { "Bob",      850.00 }, ;
      { "Carlos", 2310.75 } }
   LOCAL aRow

   ? "Customer balances:"
   FOR EACH aRow IN aCustomers
      ? PadR( aRow[ 1 ], 10 ), Str( aRow[ 2 ], 10, 2 )
   NEXT

   RETURN

Working with a DBF file is equally idiomatic:

USE customers NEW VIA "DBFCDX"
INDEX ON Upper( cust_name ) TO custname
SET ORDER TO TAG custname

DO WHILE ! Eof()
   ? customers->cust_name, customers->balance
   SKIP
ENDDO

USE

Evolution

Harbour’s evolution has been more about breadth than about radical language change. Over its first decade the project:

  • Added or refined object-oriented constructs in line with extensions introduced by late CA-Clipper and the various Clipper class libraries.
  • Grew the RDD ecosystem so that the same source could target DBF/CDX, DBF/NTX, DBF/FPT, in-memory tables, and SQL back-ends.
  • Expanded platform coverage from its initial focus on Windows and Linux to include macOS, several BSDs, and other Unix variants supported by GCC.
  • Accumulated a substantial contrib tree that turned Harbour into a practical environment for writing modern Windows desktop apps, console tools, and even small web services — not just for recompiling legacy DOS code.

The companion fork, xHarbour, evolved in parallel with its own additional language features and a commercial product line. The two projects share a heritage and a worldview but make different trade-offs between fidelity to Clipper and willingness to extend the language.

Current Relevance

Harbour today occupies a specific and durable niche. It is not a language a typical greenfield project would adopt in the 2020s; for that, modern entrants like Python, C#, Go, or TypeScript are the obvious choices. But Harbour is the canonical answer to a very common question in industries that adopted Clipper early: “We have a 100,000-line Clipper application that still runs our business — how do we keep it alive on modern hardware and operating systems?”

For that question, Harbour is often the lowest-risk option. The recompile-and-go workflow preserves decades of accumulated business logic, the RDD layer lets organizations gradually migrate data from DBF to SQL without rewriting their UI, and the GUI toolkits (HMG in particular) let DOS-style character apps be modernized into native Windows applications incrementally rather than as a big-bang rewrite. The project’s public repositories continue to see activity, package maintainers continue to ship it on current Linux distributions, and a worldwide community — especially strong in Spanish- and Portuguese-speaking countries — continues to write new Harbour code as well as maintain old Clipper code.

Why It Matters

Harbour is a small but important case study in how an open-source community can extend the useful life of a once-commercial language by decades. CA-Clipper was a product; Harbour is an open compiler that implements the same language plus a careful set of extensions, on operating systems and processors CA never targeted. It demonstrates that “legacy” is often a function of tooling rather than of the language itself: when the compiler can be rebuilt and ported, the code written for it can continue to be productive long after the original vendor has moved on.

For students of code archaeology, Harbour offers a rare opportunity to read, compile, and run working programs in the xBase tradition — a tradition that, through dBase, FoxPro, and Clipper, defined how a generation of business developers thought about data, screens, and applications.

Timeline

1999
Antonio Linares launches the Harbour project with the goal of producing a free, open-source, fully Clipper-compatible compiler; the project is initially hosted on SourceForge
2001
A fork called xHarbour splits from the Harbour codebase, pursuing a more aggressive feature-extension policy while Harbour stays closer to strict Clipper compatibility
2010
Harbour 2.0 is released around this time, consolidating years of community work on the compiler, runtime, and contrib libraries
2011
Harbour 3.0.0 is released as the project's flagship stable line, with broad cross-platform support across Windows, Linux, macOS, *BSD and others, and a large standard library of contrib modules
2015
The Harbour source repository is mirrored to GitHub (`harbour/core`), making contribution and issue tracking more accessible to a wider developer audience
2017
Work on the 3.2 development branch continues in the public repository, focused on incremental improvements to the compiler, RDD (Replaceable Database Driver) subsystem, and contrib libraries
2020
Community-maintained builds and forks (including continued xHarbour activity and downstream packagings) keep Harbour available on modern Linux distributions, current Windows toolchains, and Apple silicon-era macOS

Notable Uses & Legacy

Legacy Clipper application modernization

Many businesses with large CA-Clipper codebases written in the late 1980s and 1990s use Harbour to recompile and continue maintaining those applications on modern operating systems without rewriting them in another language.

HMG (Harbour MiniGUI) desktop applications

HMG, a Windows-only GUI framework built on top of Harbour, is widely used by small-business developers to build line-of-business desktop applications with native Win32 widgets and DBF-based data storage.

hbIDE and Harbour-based developer tooling

The Harbour distribution itself ships hbIDE, an editor/IDE written in Harbour using Qt bindings, demonstrating that the language is capable of building its own substantial cross-platform tooling.

xHarbour-based commercial products

The xHarbour fork — and commercial offerings derived from it — power a range of vertical-market business applications, especially in Latin America and Europe where the Clipper/xBase tradition remained strong well into the 2010s.

DBF-centric small and medium business systems

Harbour remains a practical choice for inventory, accounting, point-of-sale, and ERP-style systems that rely on DBF / CDX / NTX files as their primary data store and need a free, modern toolchain to keep them running.

Language Influence

Influenced By

Clipper dBase FoxPro xBase C

Influenced

xHarbour

Running Today

Run examples using the official Docker image:

docker pull
Last updated: