BaCon - BASIC to C converter
Not logged in

About

The name 'BaCon' is an acronym for 'Basic Converter'. It is a free BASIC to C translator for Unix-based systems, which runs on most Unix/Linux/BSD platforms, including MacOSX. It intends to be a programming aid in creating tools which can be compiled on different platforms (both 32bit and 64bit), while trying to revive the days of the good old BASIC.

BaCon is implemented in shell script and in itself. The shell version can convert the BaCon version of BaCon. The resulting binary has an extremely high conversion rate. On newer systems, the average conversion rate usually lies above 10.000 lines per second. BaCon can also translate itself and is therefore a self-translating translator.

The shell script version uses a common script syntax which is compatible with either BASH version 4.x and higher, or versions of KornShell released after 2012. Alternatively, the KornShell emulation in ZShell can be used to execute the shell version of BaCon as well.

The output of the converter consists of plain C code which can be compiled by various compilers, for example Clang, GCC, TCC, and the Compaq C compiler. Binaries have been produced successfully for different 32-bit and 64-bit architectures, like x86, x86_64, Arm, DEC Alpha, PowerPC and SPARC. The emitted C code also can be compiled by a C++ compiler like G++ or Clang++ which allows development with object oriented toolkits.

BaCon covers a common set of BASIC instructions known as structured BASIC. The syntax was inspired by QuickBASIC and ScriptBasic and has been expanded with modern extensions to allow network programming, regular expressions, delimited string operations, associative arrays and hash tables. It also is able to implement GUI programming for Xaw, Xaw3D, Motif, TK, and GTK version 2, 3 and 4. Next to this, BaCon can interface with existing 3rd party libraries and can easily merge with 3rd party C or C++ code.

BaCon was brought to you by a community of old-school BASIC users and took more than 15 years of development.

News

Downloads

BaCon sources version 4.8

BaCon Precompiled Binaries and Packages

Other

Documentation

Demonstration programs

FAQ

Links to similar projects

Site Info

BaCon proudly uses Fossil for its website, software versioning and revision control.

You can help to keep BaCon free by either sending a donation to the hosting site Chiselapp or to me using Paypal.

Last update: March 25, 2024 - © Peter van Eerten.