ArticleslgStudy

science

FutureBASIC

FutureBASIC is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand FutureBASIC rather than just read about it. In short: FutureBasic is a free BASIC compiler for Apple Inc.'s Macintosh. It consists of an integrated development environment (IDE), editor, project manager, etc. for both Intel and Apple Silicon microprocessors.

FutureBASIC — main illustration
FutureBASIC — illustration

Key takeaways

  • FutureBASIC belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect FutureBASIC to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of FutureBASIC from memory before moving on to harder problems.

Reference excerpt

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

History FutureBasic (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.

They can also be totally insulated from the main program (LOCAL MODE statement); they allow recursion; 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 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:

LONG IF .... XELSE ... END IF DO .... UNTIL WHILE ... WEND SELECT ... CASE... CASE ELSE ... END SELECT FOR ... NEXT 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 AppleScript scripts can be assembled with FutureBasic statements then executed on the fly by a running application. Example:

FutureBasic allows the triggering of UNIX commands. Example:

FB allows inline C code. Example:

… excerpt ends here. Continue reading the full article.

Illustrations

FutureBASIC illustration

Worked examples

Example 1 — a first encounter with FutureBASIC

Start with the simplest possible case. Write down what FutureBASIC claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to FutureBASIC before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about FutureBASIC ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of FutureBASIC

In research
FutureBASIC appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses FutureBASIC in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
FutureBASIC is common in secondary-school and first-year university syllabi. It links to neighbouring topics BASIC compilers, BASIC programming language family, so understanding it makes those chapters shorter.
In everyday life
Look for FutureBASIC outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “FutureBASIC” →

How to study FutureBASIC in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what FutureBASIC means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain FutureBASIC out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is FutureBASIC in simple terms?

FutureBasic is a free BASIC compiler for Apple Inc.'s Macintosh. It consists of an integrated development environment (IDE), editor, project manager, etc. for both Intel and Apple Silicon microprocessors.

Why does FutureBASIC matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study FutureBASIC?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on FutureBASIC.

Tags

  • BASIC compilers
  • BASIC programming language family

Keep exploring