Sunday 11 May 2008

Interpreters

An interpreter is a high level language translator that is closer to
natural language. The interpreter itself is a program that sits
resident in the microcontroller. It executes a program by reading
each language statement one at a time and then doing what the
statement says to do. The two most popular interpreters for
microcontrollers are BASIC and FORTH.


BASIC's popularity is due to its simplicity, readability, and of
course just about everyone has at least played with BASIC at one time
or another. One common compaint about [interpreted] BASIC is that it
is slow. Often this can be solved by using a different technique for
performing the desired task. Other times it is just the price paid
for using an interpreter.

FORTH has a very loyal following due to its speed (approaching that
of assembler language) and its incremental approach to building a
system from reusable parts. Many FORTH systems come with a host
system which turns your desktop computer into a development system.
FORTH can be quite difficult to write in (if you have no experience
with it) and is probably even harder to read. However, it is a very
useful and productive language for control systems and robotics, and
can be mastered in time.

The nicest thing about developing a system with an interpreter is
that you can build your program interactively. You first write a
small piece of code and then you can try it out immediately to see
how it works. When the results are satisfactory, you can then add
additional components until the final product is achieved.

No comments: