Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

FutureBASIC

From Wikipedia, the free encyclopedia
Macintosh computer software

FutureBasic
ParadigmProcedural
DeveloperBrilor Software
First appearedmid 1980s
Stable release
FutureBasic 7.0.36
October 6, 2025; 4 months ago (2025-10-06)
OSMac OS
LicenseFreeware
Websitewww.brilorsoftware.com/fb/

FutureBasic is afreeBASICcompiler forApple Inc.'sMacintosh.

It consists of anintegrated development environment (IDE), editor, project manager, etc. for bothIntel andApple Siliconmicroprocessors. Since 1 January 2008, the package has contained a translator, FBtoC, that converts the FutureBasic syntax toC and automatically calls Apple'sclang compiler. No knowledge of C is required. FutureBasic supports access toMac OS library calls.

History

[edit]

FutureBasic (FB) began life in the mid-1980s[1] asZBasic, which was created by Andrew Gariepy and envisioned as across-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 inTucson,Arizona presented FutureBASIC (later called FBI).[a] 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,[b] and with his own development, the Program Generator[c] (PG PRO), a CASE tool.

The transition from 68k to PowerPCcentral 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[d], was released in September 1999[e], featuring among many other things a separate compiler application, various open, hence modifiable runtimes,[f] inline PPC assembly, a simplified access to the Macintosh ToolboxApplication Programming Interface (API), as well as an expanded library of built-in functions. Major update releases introduced a full-featured Appearance Compliant[g] runtime written by Robert Purves and theCarbon compliance of generated applications. Once completely carbonized to run natively on theMac OS X, the FutureBASIC Integrated Development Environment (FB IDE) was called FB4 and first released in July 2004.

Based inDiamondhead,Mississippi, Staz Software was severely hit byHurricane 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 asUniversal Binaries through the use of theopen 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

[edit]

System requirements for original Macintosh release: Motorola 68000System 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

[edit]

FutureBasic syntax supportsprocedural, modular styles of programming usingfunction calls andlocal variables.

Program flow & structural blocks

[edit]

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

  • They can also be totally insulated from the main program (LOCAL MODE statement);
  • they allowrecursion;
  • they can be called dynamically at runtime (DEF FN USING statement);
  • called automatically by FutureBasic built-in event vectors (ON EVENT FN statement);
  • used as cooperative threaded functions (THREADBEGIN statement).

Specific structures (ENTERPROC/EXITPROC) are used for callback procedures when calling theMacintosh 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:

  • LONG IF .... XELSE ... END IF
  • DO .... UNTIL
  • WHILE ... WEND
  • SELECT ... CASE... CASE ELSE ... END SELECT
  • FOR ... NEXT

Legacy BASIC language commands such as:GOTO andGOSUB/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 programdim i,num,a$                    //These are our variableswindow 1                        //open standard windowinput "Number of loops "; a$    //BASIC input from usernum=val(a$)                     //convert text to numberlong 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 enteredend ifdo                              //Wait until Apple-Q  HandleEventsuntil ( gFBQuit )               //so that we can see results

Data types

[edit]

FutureBasic supports complex data types include single and double precisionfloating points, double length integers, arrays, strings and records (similar to struct in C). Of note is the DYNAMIC array structures (size ofmemory 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

[edit]

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 stringa$).

While the FutureBasic language still supports old style variable typing with suffix identifiers, it provides a modern alternative with the as clause:dimbasbyte;dimsasshort,dimlaslong; etc.

Bridges to other languages

[edit]
  • AppleScript scripts can be assembled with FutureBasic statements then executed on the fly by a running application. Example:
route_toAppleScriptprint"return the path to me as string"route_toScreenlongifusrApplescriptRun(message$)=_noErrprintmessage$endif
  • FutureBasic allows the triggering of UNIX commands. Example:
// print a calendar for 2009  open "UNIX", 1, "cal 2009" dim a$  do   line input #1, a$   print a$ until eof(1)  close 1
  • FB allows inline C code. Example:
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

[edit]
  • No cross-platform development. This is a Macintosh-only compiler.

FutureBasic supports Macintosh Intel and Apple Silicon architectures but does not compile on or for any version of Microsoft Windows.

Notes

[edit]
  1. ^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.
  2. ^FBII was 32bit-clean and could run from Mac 128 to G5-based Macintosh in emulated mode.
  3. ^Program Generator is aRapid 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'sInterface Builder.
  4. ^Pronounced FB cubed.
  5. ^ A week later the European edition was released which included English, Italian, German (now discontinued) and French (Archived 2011-07-15 at theWayback Machine). There is also a Japanese (Archived March 21, 2008, at theWayback Machine) language edition.
  6. ^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 andMac Toolbox.
  7. ^TheAppearance Compliant runtime allows access to most of the features of Apple'sAppearance Manager.

References

[edit]
Wikibooks has a book on the topic of:FutureBasic
  1. ^An history of Basic wars on the Mac platform by Jonathan Hoyle forMacCompanion, Part I (Archived September 5, 2008, at theWayback Machine)MacCompanion, Part II (Archived August 4, 2009, at theWayback Machine)
Dialects of theBASIC programming language (list)
Classic
Microsoft
Texas Instruments
Hewlett-Packard
Locomotive Software
Microcomputers
Minicomputers
Time-sharing computers
Other
Extenders
Procedure-
oriented
Proprietary
Free and
open source
Withobject
extensions
Proprietary
Free and
open source
RAD
designers
Proprietary
Free and
open source
Defunct
Retrieved from "https://en.wikipedia.org/w/index.php?title=FutureBASIC&oldid=1328057989"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp