VSI BASIC for OpenVMS
| Company type | Software |
|---|---|
| Industry | Programming languages, Software development |
| Predecessor | BASIC-PLUS, Basic Plus 2 (BP2), VAX BASIC, DEC BASIC, Compaq BASIC for OpenVMS, HP BASIC for OpenVMS |
| Founded | 1970s |
| Founder | Digital Equipment Corporation (DEC) |
| Products | BASIC programming language variant for OpenVMS |
| Owner | VMS Software Incorporated (VSI) |
| Website | vmssoftware |
VSI BASIC for OpenVMS represents a variant of the BASIC programming language initially created by Digital Equipment Corporation (DEC) and currently maintained by VMS Software Incorporated (VSI). Its roots trace back to the 1970s with the development of BASIC-PLUS for the RSTS-11 operating system on the PDP-11 minicomputer. Subsequently, it was adapted for OpenVMS, beginning on the VAX architecture, followed by ports to Alpha, Integrity, and more recently to x86-64 systems.
The software has been marketed under several names over time, including BASIC-PLUS, Basic Plus 2 (also known as BP2 or BASIC-Plus-2), VAX BASIC, DEC BASIC, Compaq BASIC for OpenVMS, and HP BASIC for OpenVMS, often reflecting the underlying hardware platform.
Notable features
VSI BASIC offers numerous extensions inspired by FORTRAN and incorporates matrix operators from the original Dartmouth BASIC. While line numbers are generally optional, they become necessary when using the "ERL" function, which activates scoped error handling through "WHEN ERROR" exception blocks, providing a more advanced alternative to the classic "ON ERROR" statement.
One significant commercial benefit is its native integration with OpenVMS's Record Management Services (RMS), a capability that was once exclusive to DEC's COBOL compiler until VAX BASIC introduced it.
History
Over a period exceeding three decades, VSI BASIC for OpenVMS has experienced numerous rebrandings and ownership transfers, mirroring its journey through DEC, Compaq, HP, and finally VSI. With each transition, the language was ported onto new hardware platforms developed by these companies, often reflected in the product's naming conventions.
BASIC-PLUS
The origin of VSI BASIC lies in BASIC-PLUS, which DEC developed for the RSTS-11 operating system running on PDP-11 minicomputer hardware. Programmers entered code directly into the system's command interpreter or used a text editor, saving their programs as source files. Syntax errors were reported immediately after each line was entered.
Programs could be "compiled" into binary files that were not editable using the "COMPILE" command; however, this compilation generated tokenized byte code rather than true machine instructions. These tokens were executed by an interpreter at runtime, functioning similarly to modern-day Java virtual machines.
Source code lines were prefixed with numeric labels ranging from 1 to 32767 and supported multi-line statements either through line feeds or by using the & character. Multiple commands could be placed on a single line separated by .
On PDP-11 systems equipped with virtual memory (RSTS/E), user applications were constrained to approximately 32 KB due to interpreter and runtime overhead within a 64 KB address space. Systems without virtual memory (RSTS-11) imposed even stricter limitations; for example, a PDP-11/35 with 32K physical memory allocated only about 7 KB for user programs. To handle larger applications, programmers employed the "CHAIN" instruction to link separate program segments, while shared memory regions called Core common area facilitated data sharing. Disk files served as slower alternatives for data exchange.
The interpreter incorporated garbage collection mechanisms for managing strings and byte-code objects. Execution could be paused at any time to inspect or modify variables before continuing. Control flow constructs such as WHILE and UNTIL were supported, along with conditional modifiers on single lines—for example, printing "I" only if it was not less than 10 could be expressed as "".
BASIC Plus 2
Basic Plus 2 (also known as BP2 or BASIC-Plus-2) was created by DEC to improve both functionality and efficiency. It transformed source code into genuine threaded code, generating machine language object files that were compatible with other system object files. These files could then be combined into libraries and executable programs using the TKB taskbuilder, which additionally provided support for overlays to enable dynamic swapping of routines.
Programs written in BP2 operated under RSX-11 or the RSX Run Time System within RSTS/E, which initially consumed only 8KB of user address space and was later optimized to 2KB. This left roughly 56KB available for application use, significantly increasing the memory capacity compared to BASIC-PLUS. As a result, BP2 applications could be much larger and often did not require CHAINing. Unlike BASIC-PLUS, which was limited to RSTS-11, BP2 extended compatibility to the RSX-11 operating system as well.
VAX BASIC and DEC BASIC
When the VAX minicomputer was introduced, DEC adapted BASIC-PLUS-2 for the VMS platform, branding it VAX BASIC. This version complied with standard VMS calling conventions, enabling VAX BASIC object code to integrate smoothly with modules written in other VMS-supported languages. In most cases, source code from BASIC Plus 2 could be executed on VAX BASIC with minimal modification.
With the development of the Alpha microprocessor, VMS was ported and renamed OpenVMS. Concurrently, VAX BASIC was ported and rebranded as DEC BASIC. At this point, the BASIC interpreter was eliminated, requiring all DEC BASIC programs to be compiled and linked into OpenVMS executable files.
Compaq, HP and VSI
Following DEC’s acquisition by Compaq in 1997/98, the software products were renamed Compaq BASIC for OpenVMS VAX and Compaq BASIC for OpenVMS Alpha.
After the merger of Compaq with HP in 2001/02, these products were rebranded as HP BASIC for OpenVMS on VAX and HP BASIC for OpenVMS on AlphaServer. Subsequently, HP released HP BASIC for OpenVMS on Integrity, designed specifically for Integrity server systems powered by Intel's Itanium processors.
In 2014, HP transferred ownership of the OpenVMS ecosystem to VSI, who then renamed the product VSI BASIC for OpenVMS.
Sample code
VSI BASIC is a structured dialect where line numbers are optional and supports both SUB procedures and FUNCTION routines.
Hello, world
print "Hello, world!"
Celsius to Fahrenheit conversion
function real to_fahrenheit(real celsius) to_fahrenheit = (celsius * 1.8) + 32 end function external real function to_fahrenheit(real) declare real temp_celsius when error in print "Enter a temperature in celsius"; input x temp_celsius = real(x) use print "Error: enter a valid numeric value, please." end when print "Temperature in degrees fahrenheit is "; to_fahrenheit(temp_celsius) end