Ever since I started writing BASIC programs on my Commodore 64, I've always had a desire to develop a BASIC interpreter. In 2014, during a programming course in C++11 that I taught, I decided to take on the challenge of implementing an interpreter as a non-trivial coding example. I specifically chose BASIC, inspired by the fact that it had been fifty years since John G. Kemeny and Thomas E. Kurtz designed the original BASIC language. Despite Dijkstra's famous judgment that "It is practically impossible to teach good programming to students who have had prior exposure to BASIC," I believed that BASIC's simplicity made it one of the few languages that an 8-year-old kid could understand. It was this simplicity that made it an ideal choice for beginners to learn programming.
What does the prefix “nu” mean?
The prefix "nu" may not actually signify "new," but it originates from a namespace that I frequently utilize in my source code. Although it carries a different meaning within that context, it seemed suitable enough to be employed here and had an appealing sound to it.
What is the evolution strategy for the language?
Although nuBASIC is lacking several features that I would like to incorporate, my intention is to enhance the existing ones while maintaining the language's simplicity and the interpreter's portability. It is important to me to keep nuBASIC small and intuitive, ensuring that users can easily grasp its functionality.
I cannot predict when I'll find the time to work on improving nuBASIC since it's more of a hobby for me, and I don't receive any monetary compensation for it. However, I remain committed to the project and will continue to dedicate my efforts to enhancing it, just as I have been doing so far.
Why is nuBASIC designed to run as a console application?
The choice to run nuBASIC as a console application offers several advantages. It provides a convenient environment for experimenting with language features and makes the learning process simpler by eliminating the complexities of a graphical user interface. Users can interact with nuBASIC through a traditional command-line interface, allowing them to enter programs directly and execute them. However, it's important to note that a graphical IDE (available for Linux and Windows) is also provided for those who prefer a graphical programming environment.
What are the reasons behind using the console window (or the X-terminal in Linux) for drawing graphics?
I must acknowledge that this is an unconventional choice. However, this approach enables the creation of simple applications that require graphics, despite having certain drawbacks like suboptimal control of window repainting. If time permits, I would love to expand nuBASIC to support a full GUI paradigm, including event-driven programming. Nevertheless, those who were accustomed to BASIC interpreters from the 80s might still appreciate this approach, particularly considering the nature of nuBASIC and its primary educational purpose.
Is nuBASIC compatible with other dialects of BASIC?
nuBASIC offers partial compatibility with GW-BASIC, QBASIC, and potentially other dialects of BASIC. It supports both classic BASIC programs that utilize line numbers and control structures like GoTo and GoSub, as well as procedure-oriented programs based on structured and procedural programming paradigms. The interpreter successfully runs the following two implementations of the Rosetta Code example, which showcases the Mandelbrot set, a fundamental concept in fractal geometry:
Is nuBASIC free?
Yes, nuBASIC is free, open source, and distributed under the MIT license since version 1.48. You can download the source code and binaries from either SourceForge or GitHub.
How can I access documentation on nuBASIC?
The standard documentation for the current stable version of nuBASIC is available in the nuBASIC Reference section of the website. User Guides in both PDF and ODT formats, available in English and Italian, can be found at https://sourceforge.net/projects/nubasic/files/documentation/.
Why C++11, and what is C++11?
C++11 refers to a version of the C++ programming language that was approved by ISO on August 12, 2011. It introduces several additions to the core language and extends the C++ Standard Library. If you're interested in more information about C++11, you can refer to http://www.stroustrup.com/C++11FAQ.html.
How do I build nuBASIC?
nuBASIC can be compiled on various operating systems, including Windows, Linux, and MacOS. To build nuBASIC, you can create a Visual Studio console application (Windows only) or use Clang or gcc/g++ (with C++11 support).
How do I use nuBASIC?
nuBASIC can be used by any user without additional programs. It includes the necessary components for creating and running programs, such as the command line interpreter (CLI) for inline editing and testing, the language interpreter for running nuBASIC programs, and an Integrated Development Environment (IDE) for Windows and Linux/GTK+2 platforms.
The nuBASIC programming language consists of two components: the language itself, defining elementary linguistic constructs like variable declarations and loops, and the built-in function library, providing standard functions for manipulating numbers, strings, and files.
How can I obtain support or submit bug reports?
For support or bug reports, you can send an email to email@example.com, and I will respond as soon as possible.
I would like to express my gratitude to all the individuals who have contributed to the improvement of nuBASIC by providing feedback, ideas, and suggestions. A special thanks goes to Brian Decker for his assistance in bug discovery and his valuable suggestions on ensuring language compatibility with ECMA-55.
Thank you all!