ScriptBasic
ScriptBasic is Peter Verhas's free, LGPL-licensed BASIC interpreter written in C, designed to be embedded, extended with C modules, and run as a multi-threaded BASIC application server
Created by Peter Verhas (Hungary); later community development led by John Spikowski
ScriptBasic is a free BASIC interpreter written in C by the Hungarian engineer Peter Verhas, distributed under the GNU Lesser General Public License. It set out to answer a question that sounds almost naive - what if the scripting language that people actually use for small automation jobs were BASIC instead of Perl? - and then took that question seriously enough to build a genuinely well-engineered implementation around it: a clean C embedding API, dynamically loadable extension modules, an intermediate-code compiler with a cache, compilation to standalone executables, thread-safe internals, and a multi-threaded BASIC application server. It is one of the more capable open-source BASIC implementations of its era, and one of the least famous.
History and Origins
ScriptBasic came out of Hungary in the late 1990s, written by Peter Verhas - later much better known as a Java author and speaker, but at the time working in C. The oldest dated traces inside the source tree are from 1999: a release-engineering checklist signed “p.v.c September 25, 1999”, describing how to build a release with Visual C++ 6.0 on Windows and then port it via FTP to a Tru64 UNIX development station, and documentation files carrying a “Copyright 1999” notice. The project’s website first appears in the Internet Archive in August 2000, and a SourceForge project was registered on 22 March 2001. Accounts placing the start of development a year or two before 1999 are plausible - the version numbering was already deep into the “build” teens by 2001 - but the 1999 artifacts are the earliest ones that can be checked directly.
The stated motivation is unusually candid, and it appears verbatim on the project’s own feature page: “There are a lot of people who can program BASIC and only BASIC… they write their five-liners in BASIC to solve their simple problems. They never write Perl, Tcl, Java or C. Therefore it is BASIC.” The user’s guide puts the same idea more bluntly: ScriptBasic is “the ideal tool to write small scripts that gurus write in Perl. However you need not be a guru to powerfully program in ScriptBasic.”
Development proceeded through numbered builds of version 1.0 - build 24 was current by mid-2001, build 29 by August 2002, and build 30 by April 2003 - before the numbering was restarted with version 2.0.0, announced in 2004. Verhas eventually moved on, and a community formed around scriptbasic.org and its forum, run by John Spikowski, which is where the project’s later life played out. In 2013 Verhas published the original C sources to GitHub with a plain note: the project is not maintained any more by the original author.
Design Philosophy
Three commitments shape the language.
It is BASIC, deliberately. Variables are typeless: any variable holds a string, an integer, or a real number, and conversions happen automatically. Programs are line-oriented and readable by anyone who learned BASIC on a home computer.
It is a scripting language, not a nostalgia project. ScriptBasic borrows freely where BASIC tradition was inconvenient. Arrays are indexed with square brackets - the documentation notes this is “the usual notation for most programming languages, like C, Perl, PASCAL, Python”, and that parentheses “confuse array access and function call”. Associative arrays are in the language because, as the manual says, “languages, like Perl or AWK have associative arrays and so does ScriptBasic”. Strings honor C-style escapes such as \n, and there is a triple-quoted multi-line string form.
It is meant to be extended and embedded. The project called this being a “4E language” - easy to extend, easy to embed - and named Tcl as the model for embeddability. That goal drove the internal architecture more than any language feature did: clean interfaces around the interpreter and inside it, documented well enough that a third party could write a new module, a new preprocessor, or a host application.
Key Features
- Modules with namespaces. External functionality lives in dynamically loaded modules addressed with a
::namespace operator, pulled in withincludeorimport. Shipped and community modules cover CGI, MySQL, ODBC, PostgreSQL, Berkeley DB, SQLite, regular expressions, curses and Windows console I/O, hashes, XML, cURL, zlib, and dynamic C function calls. - Intermediate code with automatic caching. Source is compiled to a compact internal form held in a single contiguous memory block; that form is written to a cache file and reused until the source changes, which matters a great deal for CGI scripts that would otherwise recompile on every hit.
- Multiple deployment forms from the same code. The compiled binary form can be shipped instead of source; it can also be emitted as C source and linked against the runtime library to produce a native executable, and from build 30 onward it could be compiled straight to a Windows or Linux executable without a C compiler present.
- A documented C embedding API. Introduced in build 20, it lets a host program load and run a script, re-run it, read and write global BASIC variables, and call BASIC functions with arguments and return values. The command-line interpreter was rewritten on top of this API as its own reference example.
- Thread-safe internals and a BASIC application server. The interpreter core was written to be thread-safe so that multiple interpreters can run in one process. The Eszter SB Application Engine exploits this: a standalone HTTP daemon, installable as a Windows service, running BASIC programs in worker threads with in-memory session and application variables.
- A source-level debugger and pluggable preprocessors, with an interface for third-party preprocessors that run after the source is read and before lexical analysis.
A short program shows the flavor - typeless variables, bracket-indexed arrays, namespaced module calls, and C-style escapes:
| |
Evolution
The 1.0 build series is where most of the engineering happened: an ISAPI variant for IIS, external commands as well as external functions, import alongside include, the embedding API, the mt module and the Eszter application engine, console I/O and Windows message-box modules, a Windows installer, executable compilation without a C compiler, and portability work prompted by Solaris alignment reports and by students at TU Budapest working on database interfaces. Version 2.0.0 in 2004 was smaller in scope, and never progressed past beta packages: local-by-default semantics for undeclared variables inside functions as an opt-in compiler directive, an XML module, and an experimental FTP daemon in the application engine.
After that the center of activity moved from the author to the community. The original site froze on 28 January 2010. The forum at scriptbasic.org - later mirrored as a static archive - accumulated boards for a long list of extension modules, and community developers produced 32- and 64-bit Windows and Linux builds numbered 3.0, a simple IDE, and additional modules. In parallel, Verhas built jScriptBasic, an independent Java implementation of the same language, released on Maven Central from 2012 through version 3.0.0 in March 2024.
Current Relevance
ScriptBasic is dormant. The original website has not changed since January 2010; the author’s C repository has taken only two commits since it was published in 2013 - a README update in 2019 and a 2020 fix for macro breakage on newer compilers; the community forum has stopped taking registrations and its most recent substantive discussions appear to date from 2018. The most recent signs of life are the community GitLab repositories, where a Windows 3.0 installer and ODBC fixes for 64-bit builds landed in spring 2024 and a last commit was made in February 2025, and the March 2024 jScriptBasic release.
What is still worth looking at is the code. The interpreter is a compact, heavily documented C codebase that separates reader, lexer, syntax analyzer, builder, and executor cleanly enough to be read as a teaching example - which is exactly what it was used for at TU Budapest. Building it today is a matter of a ./setup script and a handful of development libraries, and the platform list given in the user’s guide - “Windows NT, Windows95, Linux, Tru64 UNIX and probably on many other platforms” - has reportedly been extended by the community to modern Linux, Raspberry Pi, and 64- as well as 32-bit Windows.
Why It Matters
ScriptBasic is a reminder that the interesting question about BASIC was never whether the syntax was fashionable. Around the turn of the millennium, when Perl, Python, PHP, and Tcl were dividing up the scripting world, someone sat down and asked what BASIC would need in order to compete on the merits: a real module system, an embedding API good enough to make it a host application’s macro language, thread safety, intermediate-code caching so CGI scripts would not pay a compile cost per request, and a path from script to shippable binary. ScriptBasic supplied all of that, in portable C, under a license that permitted commercial embedding.
That it never achieved wide adoption says more about how scripting-language ecosystems actually grow - through libraries, communities, and mindshare - than about the implementation, which was more thoughtfully engineered than most of the free BASIC interpreters of its time. As an artifact, it is a well-documented, self-contained example of how to build an embeddable interpreter, and a small monument to the idea that a language dismissed as a beginner’s toy could be given a professional implementation if someone cared enough to do it.
Timeline
Notable Uses & Legacy
Eszter SB Application Engine
The project's own flagship application: a standalone, multi-threaded HTTP daemon with ScriptBasic built in, installable as a Windows NT service, which runs BASIC web programs in-process instead of forking a CGI interpreter per request. Paired with the mt module it keeps session and application variables in memory rather than on disk
Embedded macro and scripting engine in C/C++ applications
ScriptBasic was explicitly designed to be embedded, and from build 20 onward exposed a documented C API for loading and running programs, re-running them, reading and setting global variables, and calling BASIC functions from C with arguments and return values - the intended way to give an application a BASIC macro language
Teaching material at the Budapest University of Technology
Peter Verhas wrote on the project site that he delivered lectures on the architecture of ScriptBasic at TU Budapest, with students taking on coursework such as PostgreSQL and Oracle interfaces, ODBC testing, and C++ and Java APIs for the interpreter
jScriptBasic for Java applications
A separate Java implementation by the same author, distributed through Maven Central from 2012 to 2024, aimed at embedding a BASIC scripting layer inside JVM programs
Raspberry Pi and Linux hobbyist scripting
The community build README documents the development libraries needed on Raspbian as well as Linux - cURL, iODBC, MySQL/MariaDB, ncurses, SQLite, OpenSSL and zlib - and the community extension collection includes WiringPi and GPIO modules for Raspberry Pi pin access
Desktop GUI scripting through extension modules
Rather than building a GUI toolkit into the language, ScriptBasic relied on bindings to external toolkits: the community extension collection carries IUP and JAPI modules alongside drawing and graphics modules, and the official download page linked to a third-party GTK module contributed by Peter van Eerten