Tech

FOSS dev builds a BASIC compiler using LLVM

Published

on

personal tech

Not just any old BASIC, either: OS-9’s BASIC09

Neither LLVM nor GCC directly support the BASIC programming language – but a former Microware boffin proposes fixing that.

An interesting new proposal on the Discourse forum of the LLVM compiler suite has turned into a new standalone BASIC compiler. The original RFC was Adding BASIC09 frontend tool to LLVM. Author Boisy Petre proposed adding a front-end to enable LLVM to compile BASIC source code, and this has now turned into a standalone compiler called basic09c, which uses LLVM as a library. We are irresistibly reminded of the recent addition of ALGOL-68 to GCC

Advertisement

As we said in 2023, BASIC is anything but dead, and, for BASIC’s 60th birthday, the following year we covered new versions of three modern FOSS dialects. The late Dr Thomas Kurtz would have been proud.

It’s not just any old home-computer BASIC, either. Dr Petre is working on a compiler for Microware BASIC09. This was one of the compilers that Microware offered for its multitasking, multiuser Unix-like OS, called OS-9. Way back in 1999, many users of Apple’s then-new MacOS 9 – often just called “OS 9” – confused it with the already 20-year-old Microware OS-9, and they pestered OS-9 newsgroups and communities with Mac questions and chatter. As The Register reported back then, Microware even sued Apple over the trademark.

BASIC09 is a structured BASIC: it has named procedures with local variables, supports constructs such as IF…THEN…ELSE, user-defined variable types – and no, it did not need line numbers. The best reference we can find to BASIC09 today is its Wikipedia article, but you can also read the manual [PDF].

A Tandy Color Computer 2 sits on a table at a retro computing event in Orlando, Florida, alongside cables and other equipment.

Microware is still around and still supports OS-9, which is marketed as an RTOS these days. Home microcomputer users, though, might have known OS-9: it was an optional OS for the British Dragon 32 micro and was on the list for the first British laptop too. For Stateside readers, the Dragon 32 was a relative of the American Tandy Color Computer, which had the same Motorola 6809 CPU and could also run OS-9.

Advertisement

Aside from its technical merits, there are other good reasons he chose this particular BASIC: Although Boisy Gene Petre became Dr Petre last year, he has been in the industry for quite a while. He worked at Microware early in his career, and even quarter of a century ago he was writing articles about the Tandy CoCo.

Advertisement

This is not the first time that the Reg FOSS desk has been bamboozled by boffin Boisy’s brilliance. That was way back in 2012, when he created one of our favorite ever retrocomputing projects: the astonishing Liber809. This performed a total brain transplant on the original Atari 8-bit machines, installing a 6809 CPU and supporting firmware.

As he explained in a post called The Beginning, the goal was to marry the most advanced eight-bit CPU with the most capable eight-bit computer of its time. Retrocomputing blog The Byte Cellar described it well. This would of course render the machine incompatible with all existing Atari software, but the plan was to make it able to run NitrOS-9 – a community distribution of the original 6809 version of the Microware OS. ®

Source link

Advertisement

You must be logged in to post a comment Login

Leave a Reply

Cancel reply

Trending

Exit mobile version