23.10.2013 Views

FAST Forth Native-Language Embedded Computers

FAST Forth Native-Language Embedded Computers

FAST Forth Native-Language Embedded Computers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A Forum for Exploring <strong>Forth</strong> Issues and Promoting <strong>Forth</strong><br />

<strong>Forth</strong>: Always New, Despite its Age<br />

Whenever we send out a <strong>Forth</strong> marketing message, we<br />

need to speak of <strong>Forth</strong> using the latest terminology on the<br />

high-tech horizon. Two terms to consider with regard to<br />

<strong>Forth</strong> are "application framework" and "introspection."<br />

Did you know that, among other things, <strong>Forth</strong> is a<br />

deuelopment system framework and a programming lan-<br />

guage framework?As the term framework implies, it frames<br />

your program with a structure to carry the code you supply.<br />

A framework offers another form of code reuse. The<br />

most familiar format for reusable code is a library, which<br />

consists of bundled service-providing routines that you<br />

choose to call or not. Besides offering already-made<br />

services, the framework "prewires" certain services to-<br />

gether to roughly model the application you are about to<br />

build. The framework offers a basic design for accomplish-<br />

ing a task, instead of offering piecemeal code that you may<br />

use along with your own design.<br />

Frameworks such as Hypercard and MacApp are help-<br />

ing application programmers create GUI applications for<br />

The actual processor is<br />

less of a concern than<br />

the virtual processor...<br />

the Macintosh with greatly reduced effort. For PCs running<br />

Windows, the premier framework is Visual BASIC.<br />

The code from the framework satisfies general goals,<br />

such as queuing the input events associated with a mouse<br />

and keyboard. ~~~lication-specific goals are met by your<br />

own routines, which the framework has a way to call at the<br />

appropriate times.<br />

<strong>Forth</strong> can be seen not merely as an application framework<br />

(particularly if your final application preserves the<br />

<strong>Forth</strong> interpreter), but also as a development system<br />

framework and a programming language framework.<br />

The <strong>Forth</strong> programming language is subject to modification<br />

by the programmer. Typically, control structures<br />

are written to replace the ones that came with a system.<br />

Because it does not involve redesigning <strong>Forth</strong> from the<br />

ground up, this type of language refinement is equivalent<br />

to the use of a framework. In this way, <strong>Forth</strong> functions as<br />

a programming language framework. (The end product is<br />

a <strong>Forth</strong> dialect or a new language-typically one that<br />

preserves the basic <strong>Forth</strong> compiler.)<br />

Habitually, <strong>Forth</strong> programmers create decompilers,<br />

tracers, code profilers, and other tools. In <strong>Forth</strong>, they are<br />

easy to create. In this case, <strong>Forth</strong> is functioning as a<br />

development system framework-allowing you to create<br />

specific development tools within an overall tool frame-<br />

work. (The end product is a customized application<br />

development system that preserves most of <strong>Forth</strong>'s native<br />

development tools.)<br />

The term framework helps convey an important mes-<br />

sage to the larger programming community. It is one way<br />

that <strong>Forth</strong> can be considered a very progressive, and a very<br />

high-level, environment.<br />

Programs Become Introspective<br />

Another new term we can use to describe <strong>Forth</strong> involves<br />

the concept of introspection. This term came to my attention<br />

recently with regard to Dylan. The Dylan programming<br />

language is a product of long-term research at Apple<br />

Computer. Dylan is object oriented, so the concept of<br />

introspection is the concept of self-identifying objects:<br />

The [Dylan] language should contain features for<br />

introspection. This means that the language run-time<br />

should have sufficient power to answer questions about<br />

itself and the objects it manages. For example, it should<br />

be possible at execution time to analyze the structure of<br />

an object, find the subclasses of a class, etc.<br />

To facilitate type-safety and introspection, objects are self-<br />

identifjring in memory. Unless all uses of an object can be<br />

analyzed at compile-time, the run-time memory for the<br />

object should contain enough information to identify its<br />

class and value. --&Ian <strong>Language</strong> Reference<br />

The ease with which <strong>Forth</strong> decompilers can be written<br />

suggests that <strong>Forth</strong> compilers already produce memory<br />

images that are subject to meaningful inspection.<br />

Several <strong>Forth</strong> programmers at the Asilomar FORML<br />

conference last year were interested in developing <strong>Forth</strong><br />

March 1994 April 42 <strong>Forth</strong> Dimensions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!