I'm working on modernizing Rosetta Code's infrastructure. Starting with communications. Please accept this time-limited open invite to RC's Slack.. --Michael Mol (talk) 20:59, 30 May 2020 (UTC)

Category:VTL-2

From Rosetta Code
Language
VTL-2
This programming language may be used to instruct a computer to perform a task.
Execution method: Interpreted
See Also:


Listed below are all of the tasks on Rosetta Code which have been solved using VTL-2.
Your Help Needed
If you know VTL-2, please write code for some of the tasks not implemented in VTL-2.

VTL-2, the Very Tiny Language, version 2, is a programming language developed in 1976 by Gary Shannon and Frank McCoy for the Altair 8800 and Altair 680.

The language was designed to use as little memory as possible. The interpreter is less than 1KB, small enough to fit wholly into the space afforded by the empty ROM sockets already on the 8080 CPU board; and 1K of RAM is enough to fit a small program. This way, the language could run on base-model Altair systems that did not have enough memory for BASIC.

In order to achieve this small size, a creative approach to language design was taken. The language only has one type of statement, namely assignment. The interpreter state and I/O devices are exposed through system variables, which may be assigned to in order to change the state. For example, the system variable # refers to the current line being executed. The line 100 A=# will, indeed, set the variable A to 100. Assigning to # is a GOTO, and flow control is done using computed GOTOs. Other system variables include ? (numeric I/O), $ (raw byte I/O), and %, which is set to the modulus of a division whenever a division is performed.

More traditional approaches to minimalism are also taken. There is no operator precedence, the evaluation order is strictly left-to-right except for parentheses. Variable names may only be one character long, and are limited to uppercase letters and some punctuation characters. The free memory that is left over after the program is entered, is exposed as one array referred to as :X), where X denotes the subscript; this is the only array that is available. The only supported datatype is the unsigned 16-bit integer. There are no error messages.

Later on, compilers were offered for other systems, even up to a 32-bit version for the 386.

Resources[edit]