7Basic is an ambitious project aimed at creating a cross-platform BASIC compiler that generates native Win32 and i386 ELF executables.
The compiler takes 7Basic source files as input and generates an x86 assembly file that must then be assembled and linked. The resultant binary file depends on libc for I/O.
The syntax of the language is very loosely based on VisualBasic.
- variables are declared with their type
- values can be read from STDIN and printed to STDOUT
- basic conditional expressions and loops are supported
This simple example will print the classic "Hello, World!" greeting five times:
DIM i AS INTEGER i = 5 WHILE i < 5 PRINT "Hello, World!" i = i + 1 END WHILE