5
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
Principle Two: Easy Doesn't Mean Sloppy
Some modern programming languages use certain techniques to make life 'easier'
for programmers. They might not require the programmer to explicitly declare the
variables he's going to use ('implicit declaration'), or might do away with the need
to specify the type for the variable (i.e, use 'variant variables' which can contain
anything).
This has several disadvantages. For one, it is just sloppy. After several days of
writing code like that, a programmer might not have a very clear-cut idea of what
his program is doing, or where things come from. While this is something which
may be subject to debate, the next disadvantage is quite real:
This is simply wasteful programming. These techniques can consume quite a lot of
resources, specifically memory. On the PC, a variant used to store just 2 bytes of
data might take up to 100 bytes. This isn't a problem, because PCs have so much
memory these days that it is barely felt.
However, embedded systems are often low-cost and bare-bones, so physical
memory is a truly valuable resource. Waste too much of it -- and you would find
that your code can do very little. But manage it prudently, and your code will be
capable of quite impressive feats even on your 'low-power' embedded system.
So our systems requires you to be more organized. The effort is worth it.
Principle Three: The Purity of Language
Programming systems on the PC usually make no clear distinction between the
'pure' language constructs which perform calculations and control program flow,
and hardware-dependant input/output. For example, many languages contain a
print statement which prints something to the screen.
Since all PCs in the world are similar, this works. However, this makes little sense
for embedded platform, which have vastly different input/output resources.
Depending on the device, it may or may not have a screen, a serial port,
networking etc etc.
In our system, we separated the language itself (what we call the core language)
from the input/output of a particular device. Thus, the language itself remains the
same, no matter what device you are programming for. The input/output part is
hardware dependant, and changes from platform to platform.
When writing for a specific platform, you are provided with a set of platform-
specific objects. These provide rich functionality and allow you to do 'real' work,
such as printing messages to the serial port, communicating on the Internet or
controlling motors and sensors.
Ideally, Tibbo Basic could run on a fridge just as well as it could run on a time and
attendance terminal.
Principle Four: Thin and Agile
A lot of embedded systems are built by scaling down larger desktop systems, and
it shows. What's the point of using a super-fast processor if you load it with dozens
of layers of nested calls?
All the code TiOS includes has been designed from scratch for running on a very
simple processor, and optimized for control applications. It has been crafted to
have the minimum possible ROM and RAM footprint and to run as fast as possible.
We built TiOS with Pareto's principle in mind. In other words, if a certain
functionality is required by only 5% of applications and yet its existence adds 90%
overhead, we did not include it. For example, our BASIC only supports integer