FutureBASIC

Last updated

FutureBasic
FutureBASIC logo.png
Paradigm Procedural
Designed by Andrew Gariepy
Developer Brilor Software
First appearedmid 1980s
Stable release
FutureBasic 7.0.22
July 12, 2023;3 months ago (2023-07-12)
OS Mac OS
License Freeware
Website www.brilorsoftware.com/FB/

FutureBasic is a free BASIC compiler for Apple Inc.'s Macintosh.

Contents

It consists of an integrated development environment (IDE), editor, project manager, etc. for both PowerPC and Intel microprocessors. Since 1 January 2008, the package has contained a translator, FBtoC, that converts the FutureBasic syntax to C and automatically calls Apple's GNU Compiler Collection (gcc). No knowledge of C is required. FutureBasic supports access to Mac OS library calls.

History

FB began life in the mid-1980s as ZBasic, which was created by Andrew Gariepy and envisioned as a cross-platform development system. Before long, the cross-platform aspects were dropped in favor of focusing on Macintosh development. ZBasic acquired a devoted following of developers who praised its ease of use and the tight, fast code produced by the compiler (a legendary labor involving extensive use of hand-built 68K assembly language code). In 1992 and as the next major step after ZBasic version 5 , Zedcor Inc., the company of the Gariepy brothers Andy, Mike, Peter and friends based in Tucson, Arizona presented FutureBASIC (later called FBI). In 1995 Staz Software, led by Chris Stasny, acquired the rights to market FutureBASIC. Chris Stasny started this business with an upgraded version, namely FBII, and with his own development, the Program Generator (PG PRO), a CASE tool.

The transition from 68k to PowerPC central processing unit (CPU) was a lengthy process that involved a complete rewrite of the editor by Chris Stasny and an adaptation of the compiler by Andy Gariepy. The result of their efforts, a dramatically enhanced IDE called FB^3 , was released in September 1999 , featuring among many other things a separate compiler application, various open, hence modifiable runtimes, inline PPC assembly, a simplified access to the Macintosh Toolbox Application Programming Interface (API), as well as an expanded library of built-in functions. Major update releases introduced a full-featured Appearance Compliant runtime written by Robert Purves and the Carbon compliance of generated applications. Once completely carbonized to run natively on the Mac OS X, the FutureBASIC Integrated Development Environment (FB IDE) was called FB4 and first released in July 2004.

Based in Diamondhead, Mississippi, Staz Software was severely hit by Hurricane Katrina in August 2005 and development pace was slowed at a time when major effort was required to keep the IDE up to date with Apple's evolution towards the Intel-based Macintosh.

In 2007, an independent team of volunteer FB programmers, known as the FBtoC team, developed a translator (FBtoC) that allows FB to generate applications as Universal Binaries through the use of the open source GCC compiler which is included with each copy of Apple's Mac OS X system software.

On January 1, 2008, Staz Software announced that FB would henceforth be freeware and FB4 with FBtoC 1.0 was made available.

Processor and operating system support

System requirements for original Macintosh release: Motorola 68000 System requirements to create universal binaries with FBtoC: Mac OS X v10.4 or higher, GCC 4.0 or higher, and the Cross-development SDKs must be installed.

Syntax

FutureBasic syntax supports procedural, modular styles of programming using function calls and local variables.

Program flow & structural blocks

User-defined functions (a.k.a. LOCAL FNs in FutureBasic) are much like C or Pascal functions.

Specific structures (ENTERPROC/EXITPROC) are used for callback procedures when calling the Macintosh Toolbox.

The language provides the programmer with a complete set of vectors for event-driven applications, such as ON MENU, ON MOUSE, ON DIALOG, ON APPLEEVENT, ON EDIT, ON TIMER, etc.

Other structured keywords include conditional blocks such as:

Legacy BASIC language commands such as: GOTO and GOSUB/RETURN with line numbers and labels - while discouraged - are supported for educational purposes.

An example of a simple program to input a number and display "Hello World" is given below

//Example FutureBasic program  dim i,num,a$                    //These are our variables  window 1                        //open standard window input "Number of loops "; a$    //BASIC input from user num=val(a$)                     //convert text to number long if num>0                   //Structured IF   for i = 1 to num              //BASIC loop     print "hello world"         //output text   next i                        //end of loop  xelse                          //Otherwise   print "Not today"             //no number entered end if  do                              //Wait until Apple-Q   HandleEvents until ( gFBQuit )               //so that we can see results 

Data types

FutureBasic supports complex data types include single and double precision floating points, double length integers, arrays, strings and records (similar to struct in C). Of note is the DYNAMIC array structures (size of memory footprint grows only when used) including DYNAMIC string arrays called INDEX$ and "container" variables which can perform string-like operations on data streams up to 2Gb in size.

C and Pascal borrowed coding styles

Commenting in the code is substantial allowing REMark statements, and C style /* remark */ statements. Sections of code can be bookmarked for easy reference.

Other alternate syntax borrowed from C allows the use of operators such as ++ -- == != += -= || &&

Characters in Pascal strings are accessible much like items of an array: a$[0] (length byte); a$[1] (first character in string a$).

While the FutureBasic language still supports old style variable typing with suffix identifiers, it provides a modern alternative with the as clause: dim b as byte; dim s as short, dim l as long; etc.

Bridges to other languages

route_toAppleScriptprint"return the path to me as string"route_toScreenlongifusrApplescriptRun(message$)=_noErrprintmessage$endif
// print a calendar for 2009   open "UNIX", 1, "cal 2009"  dim a$    do    line input #1, a$    print a$  until eof(1)   close 1 
BeginCFunction// Simple C function to add two integerslongsimple_add(longa,longb){longsum;sum=a+b;return(sum);}endC// Define C function so FB can see ittoolboxfnsimple_add(longa,longb)=long// Create little program to add 2 + 2 with the C functionwindow1printfnsimple_add(2,2)doHandleEventsuntil(gFBQuit)

Limitations

FutureBasic supports Macintosh Intel architectures but does not compile on or for any version of Microsoft Windows. [1] and see bottom of page at: [2]

Related Research Articles

An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, and a debugger. Some IDEs, such as NetBeans, JDoodle and Eclipse, contain the necessary compiler, interpreter, or both; others, such as SharpDevelop and Lazarus, do not.

Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named after French mathematician, philosopher and physicist Blaise Pascal.

ScriptBasic is a scripting language variant of BASIC. The source of the interpreter is available as a C program under the LGPL license.

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

Microsoft QuickBASIC is an Integrated Development Environment and compiler for the BASIC programming language that was developed by Microsoft. QuickBASIC runs mainly on DOS, though there was also a short-lived version for the classic Mac OS. It is loosely based on GW-BASIC but adds user-defined types, improved programming structures, better graphics and disk support and a compiler in addition to the interpreter. Microsoft marketed QuickBASIC as the introductory level for their BASIC Professional Development System. Microsoft marketed two other similar IDEs for C and Pascal, viz QuickC and QuickPascal.

AppleScript is a scripting language created by Apple Inc. that facilitates automated control over scriptable Mac applications. First introduced in System 7, it is currently included in all versions of macOS as part of a package of system automation tools. The term "AppleScript" may refer to the language itself, to an individual script written in the language, or, informally, to the macOS Open Scripting Architecture that underlies the language.

CodeWarrior is an integrated development environment (IDE) published by NXP Semiconductors for editing, compiling, and debugging software for several microcontrollers and microprocessors and digital signal controllers used in embedded systems.

Object Pascal is an extension to the programming language Pascal that provides object-oriented programming (OOP) features such as classes and methods.

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

SuperCard is a high-level development environment that runs on Macintosh computers, under OS 8 and 9, and OS X. It is inspired by HyperCard, but includes a richer language, a full GUI toolkit, and native color.

The Macintosh Toolbox implements many of the high-level features of the Classic Mac OS, including a set of application programming interfaces for software development on the platform. The Toolbox consists of a number of "managers," software components such as QuickDraw, responsible for drawing onscreen graphics, and the Menu Manager, which maintain data structures describing the menu bar. As the original Macintosh was designed without virtual memory or memory protection, it was important to classify code according to when it should be loaded into memory or kept on disk, and how it should be accessed. The Toolbox consists of subroutines essential enough to be permanently kept in memory and accessible by a two-byte machine instruction; however it excludes core "kernel" functionality such as memory management and the file system. Note that the Toolbox does not draw the menu onscreen: menus were designed to have a customizable appearance, so the drawing code was stored in a resource, which could be on a disk.

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

MacApp is the object oriented application framework for Apple Computer's discontinued classic Mac OS. Released in 1985, it transitioned from Object Pascal to C++ in 1991's version 3.0 release, which offered support for much of System 7's new functionality. MacApp was used for a variety of major applications, including Adobe Photoshop and SoftPress Freeway. Microsoft's MFC and Borland's OWL were both based directly on MacApp concepts.

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

SK8 was a multimedia authoring environment developed in Apple's Advanced Technology Group from 1988 until 1997. It was described as "HyperCard on steroids", combining a version of HyperCard's HyperTalk programming language with a modern object-oriented application platform. The project's goal was to allow creative designers to create complex, stand-alone applications. The main components of SK8 included the object system, the programming language, the graphics and components libraries, and the Project Builder, an integrated development environment.

Optimized Systems Software (OSS) was a company that produced disk operating systems, programming languages with integrated development environments, and applications primarily for the Atari 8-bit family of home computers. OSS was best known for their enhanced versions of Atari DOS, Atari BASIC, and the Atari Assembler Editor, all of which were substantially improved over Atari's products, as well as the Action! programming language. OSS also sold some software for the Apple II.

The Visual Component Framework (VCF) is an abandoned open source project for development under Microsoft Windows and Apple Macintosh that is distributed under the BSD license. It is an advanced C++ application framework that makes it easier to produce GUI-based C++ applications. The framework is C++ design and has built in support for rapid application development. The framework is designed to be portable over multiple platforms and compilers.

Think C is an extension of the C programming language for the classic Mac OS developed by Think Technologies, released first in mid-1986. THINK was founded by Andrew Singer, Frank Sinton & Mel Conway. The firm was later acquired by Symantec Corporation and the product continued to be developed by the original author, Michael Kahl. Versions 3 and later were essentially a subset of C++ and supported basic object-oriented programming (OOP) concepts such as single inheritance, and extensions to the C standard that conformed more closely to the needs of Mac OS programming. After version 6, the OOP facilities were expanded to a full C++ implementation, and the product was rebranded Symantec C++ starting version 7, then under development by different authors. Version 8 brought support for compiling to PowerPC.

Apple Dylan is the original implementation of the programming language Dylan. It was developed by Apple Computer from 1992 to 1995.

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

ZBasic is a compiler which was first released by Simutek in 1980. The combined efforts of Andrew Gariepy, Scott Terry, David Overton, Greg Branche, and Halbert Laing led to versions for MS-DOS, Apple II, Macintosh, CP/M, and TRS-80 computers. ZBasic is a fast and efficient BASIC compiler with an integrated development environment. It aims to be used as a cross-platform development system, where the same source code can be compiled to different platforms without any modifications.

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.

Swift is a high-level general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. and the open-source community. Swift compiles to machine code, as it is an LLVM-based compiler. Swift was first released in June 2014, and the Swift toolchain has shipped in Xcode since version 6, released in 2014.

References

  1. Index brilorsoftware.com
  2. "Futurebasic Group Launch Point".
  1. ^ An history of Basic wars on the Mac platform by Jonathan Hoyle for MacCompanion, Part I MacCompanion, Part II
  2. ^ ZBasic 5 reviewed by Dave Kelly for MacTech magazine
  3. ^ FBI introduced major enhancements to the BASIC language, encouraging the developers to use named constants and local functions instead of subroutines for better structured programs and re-usable code.
  4. ^ Home of Staz Software,inc.
  5. ^ FBII was 32bit-clean and could run from Mac 128 to G5-based Macintosh in emulated mode.
  6. ^ Program Generator is a Rapid application development tool that is flexible enough to build sophisticated applications quickly for the Macintosh pre-Mac OS X environments. For Mac OS X, Appearance compliant programs onwards, FutureBASIC uses Apple's Interface Builder.
  7. ^ pronounced FB cubed.
  8. ^ A week later the European edition was released which included English, Italian, German (now discontinued) and French Archived 2011-07-15 at the Wayback Machine language versions. There is also a Japanese language edition.
  9. ^ Starting with FB^3, a runtime consists of include files written in FutureBASIC that are compiled along with the source code written by the programmer. It contains various declarations for structures, constants, global variables, resources, functions and procedures that constitute the FutureBASIC language. The main runtimes are: Standard BASIC, Appearance Compliant and Mac Toolbox.
  10. ^ The Appearance Compliant runtime allows access to most of the features of Apple's Appearance Manager .
  11. ^ "Welcome to the FBtoC Project and FutureBasic Freeware". www.4toc.com. n.d. Archived from the original on September 13, 2019.