Page 32 - Designing Autonomous Mobile Robots : Inside the Mindo f an Intellegent Machine
P. 32
A Brief History of Software Concepts
serving other tasks. Each time it was called, it would simply save its work on the
stack and start the new problem. Unless the programmer makes specific efforts to
the contrary, the work of a function is last-in first-out (LIFO). The function’s use of
the stack to store data meant that for all intents and purposes the function could
appear to clone itself. It was as if each client that called the function owned its own
copy. This concept would later evolve into objects that could be instanced.
Compilers vs. interpreters
Early conventional languages were either compiled or interpreted. A compiler reads
the text of the program and generates the final machine language it represents. The
result is a stand-alone piece of code that the computer can execute. The compiler is
not needed by the user of the code.
An interpreter, on the other hand, resides in the end user’s computer and reads and
executes the text when the application is running. Thus the computer is executing
the interpreter, and the interpreter is executing the program. A hybrid of these
concepts is a pseudo compiler that generates a compressed pseudocode that an inter-
preter then reads and executes at run time. In efficiency, pseudocode systems are
somewhere between strict interpreters and true compilers.
Compiled programs run far faster than interpreted programs, and for some time it
appeared that interpreted programs would go the way of the Dodo bird. This was not
to be. Instead, specialized interpreters began to appear that allowed the user to write
a simple script to customize the operation of an application.
As the Internet became more popular and important, scripting languages such as
HTML and JAVA script evolved to provide a simple way of generating interactive
web pages.
Scripted languages are most appropriate when a single instruction generates a great deal of
machine work. When this is true, the inherent inefficiency of interpreting is negated.
The robots we developed at Cybermotion use a scripted language called the SGV or
Self-Guided Vehicle language. This language has slightly over 100 instructions, and it
is used to generate a simple pseudocode that is interpreted by the robot at run time.
Thus, to make a robot run from one part of a building to another, one has only to
transmit a few hundred bytes of this pseudocode to the robot. The vast bulk of the
required code, including the interpreter, is permanently burned into the memory of
the onboard processors.
15

