I'm delighted to officially announce the release of MiniBASIC, a clean, powerful new implementation of the classic 1980s BASIC programming language.
MiniBASIC is available at itch.io to use online, or to download for Windows, Mac, or Linux. It's also completely open-source (hosted at GitHub).
A New Way to Program Mini Micro
MiniBASIC runs within Mini Micro, a powerful neo-retro virtual computer. So there are now two languages you can use to write Mini Micro programs, its native MiniScript language, or the new MiniBASIC.
This might be of interest if you already know BASIC, and want to quickly bang out a game or utility. MiniBASIC provides a good set of high-resolution drawing commands, suitable for making plots, graphs, and diagrams. It also has access to all the data on the built-in /sys disk, including stock images, sounds, and a complete English word list! And, being completely cross-platform, Mini Micro (and so MiniBASIC) runs identically on any desktop computer (and soon mobile devices, too). So if BASIC is already in your wheelhouse, MiniBASIC offers a great way to take advantage of these Mini Micro features.
An Extremely Compatible BASIC
MiniBASIC is the perfect way to recapture — or experience for the first time — the joy of programming in the world's first widely popular programming language. BASIC was the subject of a great many books for kids of all ages, like these beautiful Usborne BASIC programming books, or the influential books of BASIC Computer Games.
MiniBASIC was carefully designed to be widely compatible with resources such as these. Though BASIC was never fully standardized, MiniBASIC follows the most common conventions in loving detail. Code from these classic books will work in MiniBASIC with little or no alteration. For example, the 500-line program from Mystery of Silver Mountain required only two minor changes, in the lines that open a file. (This game is now one of the included demos).
The BASIC Platform We All Dreamt Of
While being very compatible with 1980s BASIC, MiniBASIC is far more pleasant to use than any actual 1980s computer (in emulation or reality). All the little bits of polish that didn't exist at the time are present: when typing you can hold Alt to move the cursor or delete by whole words; you can press control-A/E to move to the start/end of the line; you can use the up/down arrows to recall previous input from the history buffer.
MiniBASIC also includes a RENUMBER command, which takes most of the pain out of using line numbers by allowing you to easily move code around in your program; and an EDIT command, which lets you edit a line of code without having to retype it.
MiniBASIC's feature set is just a bit beyond the best of the 1980s home computer in other ways, too. In terms of graphics, it features a full-color, high-resolution screen with a full set of drawing primitives including polygons and ellipses, both filled or outlined with variable pen size. It can even draw JPEG or PNG images from disk. And it supports a sophisticated sound synthesizer, similar to the Commodore 64, but with unlimited sound channels. All this makes MiniBASIC a delightfully powerful BASIC environment and a joy to hack around in.
The MiniBASIC interpreter is written in MiniScript, a clean, modern, high-level language. The code is neatly organized, with one function for each BASIC command. For example, here is the code underlying the RECT command:
Machine.cmd.RECT = function(tokens, startIdx, endIdx) if startIdx+1 >= endIdx then return printErr("incomplete RECT statement") args = getDrawingArgs(tokens, startIdx+1) if args == null then return printErr("syntax error in RECT") if args.len != 4 then return printErr("invalid arguments to RECT") x = [args, args]; x.sort y = [args, args]; y.sort if machine.fill then gfx.fillRect x, y, x - x, y - y else gfx.drawRect x, y, x - x, y - y, gfx.color, machine.pen end if machine.plotPos = args[2:] end function
This means that if you are working on a BASIC program, and find a need to do something MiniBASIC can't already do, you can easily extend the MiniBASIC interpreter to add your own feature. You will find that MiniScript is a joy to program in, and the Mini Micro feature set is powerful and easy to use.
Try it now!
Why not give it a try? Head on over to MiniBASIC, run the project, and then at the
> prompt, type in this classic program you might have found running on the demo machines at K-Mart back in the day:
10 PRINT CHR$(47 + 45 *(RND(1) > 0.5)); : GOTO 10
run to make it go. (MiniBASIC is not case sensitive, so it doesn't matter how you capitalize these commands.)
This classic display is an infinite loop, so press Control-C when you want to stop it.
Note that the web version of MiniBASIC does not support copy/paste; nor can you save files to disk. So you will probably want to download MiniBASIC to run on your local machine. You'll find download links towards the bottom of the web page.
MiniBASIC is 100% free. I do this because I grew up with BASIC; I loved it, and I still do, though I now do most of my coding in modern languages like MiniScript or C#. There is still a ton of value in those great old BASIC books, and I want others to have a chance to experience the delight as I did.
So, enjoy MiniBASIC, and share it with your friends. I hope it brings you joy!
Top comments (7)
This is great! Thanks for sharing here (and congrats on being a Top 7 contributor this week!).
I’m going to check this out. I’ve been playing with BASIC on an Agon Light, recently.
Those classic Usborne books are available to download, too…
Classic programming books ⌨️ 📚 available for free
Andy Piper ・ Jan 10 '22 ・ 3 min read
Yeah! To be honest it was largely the release of those books that compelled me to make MiniBASIC. They are wonderful, and there is very little like them today (except, perhaps, amazon.com/dp/1736167618 — and my inspiration for that will not be hard to see!).
The link to MiniMicro is dead.
You are right. I hope Joe sees this and fixes it.
Until then, here's the correct link: miniscript.org/MiniMicro/
Thank you! Not sure how I managed that (looks like I had two different URLs glommed together). It's fixed now.
I've just added a follow-up post explaining the demos included in the
Time get this out of the „shelf“… (Basic was my first love..)