Tibbo BASIC
Encyclopedia
Tibbo BASIC is a dialect
of the BASIC
programming language, designed for programmable logic controllers
, Ethernet
modules and other programmable hardware devices, both external and internal (embeddable
). It is developed and distributed by Tibbo Technology Inc., a leading manufacturer of programmable Ethernet converters and controllers in Taipei
, Taiwan
.
, have access only to a small memory
space and are robust
under failure. These requirements determine both the power of the language and its limitations for adopting it for widely different purposes.
For optimized performance on embedded devices, the language was designed as an explicitly, strongly and statically typed, asynchronous
, event-driven
programming language with object extensions
and implicit error handling. Continuation
-style event-handling is supported by special doevents statements to handle high-priority events. To speed up run-time performance, the source code is transformed by a specially developed BASIC compilerThis is unlike classical BASIC, which is interpreted and not compiled. into intermediate-level code ("pseudo-code") and later interpreted and executed by a virtual machine
for added resilience under failure.
Allowed variable types include byte, word, dword, char, short, long, real, boolean and user-defined structures and enumeration types. Both integer arithmetic and floating point arithmetic are supported.
Input-output functions, specific to a particular hardware device, are separated out from the rest of the language (called the core), making the remaining language in some sense more pure.
The hardware devices are conceptualized in terms of platforms. Each platform is characterized by a particular set of predefined objects, properties, methods and events that describe its capabilities, e.g. storing data in memory or opening up a TCP connection and sending a message.See language reference manual for details. Objects are independent of each other and not defined in terms of classes or class hierarchies but their significance lies in treating complex low-level
hardware constructs and operations as simple high-level
primitives and thus greatly simplifying programming and reprogramming the device. As an example, the following code establishes a TCP connection with a target device (here assumed to have a default IP address) and sends the specified message:
Tibbo BASIC core language can contain user-defined structures but no objects or methods.
Debugging of programs is done in the development environment, without a need for external in-circuit emulators
, as is common with programs written in hardware description languages
for embedded devices.
and a specialized Operating System
.
The Integrated Development Environment, called TIDE, contains a source code editor, a compiler and a debugger.
The graphical source code editor is used to facilitate the writing of the programs; Tibbo BASIC source code is saved in files with .tbs file suffix.
The compiler
is used for translating the source-code from the high-lever
user-friendly format into a lower-level
pseudo-code
(.tpc suffix for Tibbo pseudo-code).
The debugger
is used for checking that the program performs without errors. To verify this, the target hardware device is connected to the personal computer on which the program was developed, and the program is executed with different variable assignments and by triggering different combinations of possible events. While the program is running on the embedded device, its control flow and parameter settings can be observed in TIDE.
The programs on the embedded device run in a special operating system, called TiOS (Tibbo Operating System). TiOS runs two processes, the Master Process and the VM (virtual machine).
The Master Process controls communications with VM, TIDE and the events generated on the device. The VM interprets the compiled form of the program from the pseudo-code further into native binary code that the hardware processor can understand, and executes the program.
Because the VM is under the control of the Master Process, the Master Process can restart the VM (and so also the Tibbo BASIC program) if there are errors in the program that make the VM crash
, and send information to TIDE about the execution state
of the program during the crash for debugging and correcting.
lights, after a user presses the button, outputs "Hello World!" in Morse code
by the blinking of the lights. The line symbol of the Morse code is represented by a long pulse of the green light ('GGG') and the dot symbol by a short pulse of the red light ('R'). Line ('-') means that both lights are off.
Programming language dialect
A dialect of a programming language is a variation or extension of the language that does not change its intrinsic nature. With languages such as Scheme and Forth, standards may be considered insufficient, inadequate or even illegitimate by implementors, so often they will deviate from the...
of the BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....
programming language, designed for programmable logic controllers
Programmable logic controller
A programmable logic controller or programmable controller is a digital computer used for automation of electromechanical processes, such as control of machinery on factory assembly lines, amusement rides, or light fixtures. PLCs are used in many industries and machines...
, Ethernet
Ethernet
Ethernet is a family of computer networking technologies for local area networks commercially introduced in 1980. Standardized in IEEE 802.3, Ethernet has largely replaced competing wired LAN technologies....
modules and other programmable hardware devices, both external and internal (embeddable
Embedded system
An embedded system is a computer system designed for specific control functions within a larger system. often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. By contrast, a general-purpose computer, such as a personal...
). It is developed and distributed by Tibbo Technology Inc., a leading manufacturer of programmable Ethernet converters and controllers in Taipei
Taipei
Taipei City is the capital of the Republic of China and the central city of the largest metropolitan area of Taiwan. Situated at the northern tip of the island, Taipei is located on the Tamsui River, and is about 25 km southwest of Keelung, its port on the Pacific Ocean...
, Taiwan
Taiwan
Taiwan , also known, especially in the past, as Formosa , is the largest island of the same-named island group of East Asia in the western Pacific Ocean and located off the southeastern coast of mainland China. The island forms over 99% of the current territory of the Republic of China following...
.
Language features
The programming language features of Tibbo BASIC are motivated by its use in building software applications for small external devices that need to perform fastTime complexity
In computer science, the time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the size of the input to the problem. The time complexity of an algorithm is commonly expressed using big O notation, which suppresses multiplicative constants and...
, have access only to a small memory
Computer memory
In computing, memory refers to the physical devices used to store programs or data on a temporary or permanent basis for use in a computer or other digital electronic device. The term primary memory is used for the information in physical systems which are fast In computing, memory refers to the...
space and are robust
Robustness (computer science)
In computer science, robustness is the ability of a computer system to cope with errors during execution or the ability of an algorithm to continue to operate despite abnormalities in input, calculations, etc. Formal techniques, such as fuzz testing, are essential to showing robustness since this...
under failure. These requirements determine both the power of the language and its limitations for adopting it for widely different purposes.
For optimized performance on embedded devices, the language was designed as an explicitly, strongly and statically typed, asynchronous
Asynchronous I/O
Asynchronous I/O, or non-blocking I/O, is a form of input/output processing that permits other processing to continue before the transmission has finished....
, event-driven
Event-driven
Event driven may refer to:The term event-driven refers to a methodology that focuses on events and event dependencies.Examples include:* Event-driven finite-state machine, finite-state machine where the transition from one state to another is triggered by an event or a message* Event-driven...
programming language with object extensions
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...
and implicit error handling. Continuation
Continuation
In computer science and programming, a continuation is an abstract representation of the control state of a computer program. A continuation reifies the program control state, i.e...
-style event-handling is supported by special doevents statements to handle high-priority events. To speed up run-time performance, the source code is transformed by a specially developed BASIC compilerThis is unlike classical BASIC, which is interpreted and not compiled. into intermediate-level code ("pseudo-code") and later interpreted and executed by a virtual machine
Virtual machine
A virtual machine is a "completely isolated guest operating system installation within a normal host operating system". Modern virtual machines are implemented with either software emulation or hardware virtualization or both together.-VM Definitions:A virtual machine is a software...
for added resilience under failure.
Allowed variable types include byte, word, dword, char, short, long, real, boolean and user-defined structures and enumeration types. Both integer arithmetic and floating point arithmetic are supported.
Input-output functions, specific to a particular hardware device, are separated out from the rest of the language (called the core), making the remaining language in some sense more pure.
The hardware devices are conceptualized in terms of platforms. Each platform is characterized by a particular set of predefined objects, properties, methods and events that describe its capabilities, e.g. storing data in memory or opening up a TCP connection and sending a message.See language reference manual for details. Objects are independent of each other and not defined in terms of classes or class hierarchies but their significance lies in treating complex low-level
Low-level programming language
In computer science, a low-level programming language is a programming language that provides little or no abstraction from a computer's instruction set architecture. Generally this refers to either machine code or assembly language...
hardware constructs and operations as simple high-level
High-level programming language
A high-level programming language is a programming language with strong abstraction from the details of the computer. In comparison to low-level programming languages, it may use natural language elements, be easier to use, or be from the specification of the program, making the process of...
primitives and thus greatly simplifying programming and reprogramming the device. As an example, the following code establishes a TCP connection with a target device (here assumed to have a default IP address) and sends the specified message:
Tibbo BASIC core language can contain user-defined structures but no objects or methods.
Debugging of programs is done in the development environment, without a need for external in-circuit emulators
In-circuit emulator
An in-circuit emulator is a hardware device used to debug the software of an embedded system. It was historically in the form of bond-out processor which has many internal signals brought out for the purpose of debugging...
, as is common with programs written in hardware description languages
Hardware description language
In electronics, a hardware description language or HDL is any language from a class of computer languages, specification languages, or modeling languages for formal description and design of electronic circuits, and most-commonly, digital logic...
for embedded devices.
System components
Tibbo BASIC is part of a rapid programming framework, called TAIKO, that includes also an Integrated Development EnvironmentIntegrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...
and a specialized Operating System
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...
.
The Integrated Development Environment, called TIDE, contains a source code editor, a compiler and a debugger.
The graphical source code editor is used to facilitate the writing of the programs; Tibbo BASIC source code is saved in files with .tbs file suffix.
The compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...
is used for translating the source-code from the high-lever
High-level programming language
A high-level programming language is a programming language with strong abstraction from the details of the computer. In comparison to low-level programming languages, it may use natural language elements, be easier to use, or be from the specification of the program, making the process of...
user-friendly format into a lower-level
Low-level programming language
In computer science, a low-level programming language is a programming language that provides little or no abstraction from a computer's instruction set architecture. Generally this refers to either machine code or assembly language...
pseudo-code
(.tpc suffix for Tibbo pseudo-code).
The debugger
Debugger
A debugger or debugging tool is a computer program that is used to test and debug other programs . The code to be examined might alternatively be running on an instruction set simulator , a technique that allows great power in its ability to halt when specific conditions are encountered but which...
is used for checking that the program performs without errors. To verify this, the target hardware device is connected to the personal computer on which the program was developed, and the program is executed with different variable assignments and by triggering different combinations of possible events. While the program is running on the embedded device, its control flow and parameter settings can be observed in TIDE.
The programs on the embedded device run in a special operating system, called TiOS (Tibbo Operating System). TiOS runs two processes, the Master Process and the VM (virtual machine).
The Master Process controls communications with VM, TIDE and the events generated on the device. The VM interprets the compiled form of the program from the pseudo-code further into native binary code that the hardware processor can understand, and executes the program.
Because the VM is under the control of the Master Process, the Master Process can restart the VM (and so also the Tibbo BASIC program) if there are errors in the program that make the VM crash
Crash (computing)
A crash in computing is a condition where a computer or a program, either an application or part of the operating system, ceases to function properly, often exiting after encountering errors. Often the offending program may appear to freeze or hang until a crash reporting service documents...
, and send information to TIDE about the execution state
Program state
One of the key concepts in computer programming is the idea of state, essentially a snapshot of the measure of various conditions in the system. Most programming languages require a considerable amount of state information in order to operate properly - information which is generally hidden from...
of the program during the crash for debugging and correcting.
Example code
The following example shows Tibbo BASIC code that on an embedded device that is equipped with a button and green and red LEDLEd
LEd is a TeX/LaTeX editing software working under Microsoft Windows. It is a freeware product....
lights, after a user presses the button, outputs "Hello World!" in Morse code
Morse code
Morse code is a method of transmitting textual information as a series of on-off tones, lights, or clicks that can be directly understood by a skilled listener or observer without special equipment...
by the blinking of the lights. The line symbol of the Morse code is represented by a long pulse of the green light ('GGG') and the dot symbol by a short pulse of the red light ('R'). Line ('-') means that both lights are off.
See Also
- List of BASIC dialects
- List of BASIC dialects by platform
- Comparison of programming languagesComparison of programming languagesProgramming languages are used for controlling the behavior of a machine . Like natural languages, programming languages conform to rules for syntax and semantics.There are thousands of programming languages and new ones are created every year...
- Hardware description languageHardware description languageIn electronics, a hardware description language or HDL is any language from a class of computer languages, specification languages, or modeling languages for formal description and design of electronic circuits, and most-commonly, digital logic...