Adding BASIC09 front end tool to LLVM

lproven1 pts0 comments

[RFC] Adding BASIC09 frontend tool to LLVM - LLVM Project - LLVM Discussion Forums

= 40rem)" rel="stylesheet" data-target="desktop" />

= 40rem)" rel="stylesheet" data-target="chat_desktop" /><br>= 40rem)" rel="stylesheet" data-target="discourse-ai_desktop" /><br>= 40rem)" rel="stylesheet" data-target="discourse-calendar_desktop" /><br>= 40rem)" rel="stylesheet" data-target="discourse-reactions_desktop" /><br>= 40rem)" rel="stylesheet" data-target="poll_desktop" />

= 40rem)" rel="stylesheet" data-target="desktop_theme" data-theme-id="2" data-theme-name="light"/>

[RFC] Adding BASIC09 frontend tool to LLVM

LLVM Project

DrPitre

June 23, 2026, 5:32pm

I would like feedback on whether a BASIC09 frontend/tool would be appropriate for LLVM, and if so, what shape the upstreaming path should take.

I have a working prototype branch here:

https://github.com/DrPitre/llvm-project/tree/basic09-compiler

Summary

The prototype adds a new LLVM tool, basic09c, under llvm/tools/basic09c.

basic09c currently implements:

BASIC09 lexing and parsing

AST construction and AST dumps

initial semantic checks

symbol handling

LLVM IR emission for a useful subset of the language

lit tests for lexer/parser/AST/semantic behavior

lit tests for emitted LLVM IR

The frontend is intentionally target-independent. It emits LLVM IR and does not depend on any MC6809 backend or OS-9 support.

Motivation

BASIC09 was a structured BASIC dialect used on OS-9/6809 and OS-9/68K systems, especially the Tandy Color Computer ecosystem. It has procedures, typed variables, arrays, control flow, and a compilation model that makes it a reasonable candidate for preservation through a modern compiler infrastructure.

My goal is to preserve and compile existing BASIC09 programs by lowering them to LLVM IR. Longer term, this could allow BASIC09 programs to target multiple backends, not just historical 6809 systems.

This work started in the context of MC6809/OS-9 experimentation, but I have separated the compiler frontend from that backend-specific work. The frontend should stand on its own.

efriedma-quic

June 23, 2026, 6:16pm

It’s nice to hear you’re finding LLVM useful for building your compiler.

That said, a niche programming language from the 80’s is never going to meet our criteria for adding new languages to LLVM. See LLVM Developer Policy — LLVM 23.0.0git documentation for the formal policy.

1 Like

DrPitre

June 23, 2026, 6:35pm

Thanks for responding. For niche projects such as this, what are most people doing? Just hosting them on a fork and then occasionally rebasing to keep up with mainline changes? Is there a place for this kind of work to live outside of our own forks?

nikic

June 23, 2026, 6:55pm

Language frontends are typically implemented as independent projects that merely use LLVM as a library. It is not necessary to create an LLVM fork for this purpose. You only link against it.

If you’re using the C++ API, which is unstable, you likely want to support only a narrow range of LLVM versions (or even require a specific one). If you’re using the C API, which is semi-stable, supporting a wider range of LLVM versions becomes easier.

1 Like

DrPitre

June 24, 2026, 7:11pm

Thanks for the suggestions! I have moved the repo over to GitHub - DrPitre/basic09c · GitHub and it’s self-contained there.

1 Like

Related topics

Topic

Replies<br>Views<br>Activity

Google SOC - Idea

LLVM Dev List Archives

15

294

March 20, 2007

Need for new FORTRAN front-end for LLVM ?

Clang Frontend

227

August 25, 2012

Google Summer of Code Idea

LLVM Dev List Archives

99

March 31, 2010

Add a new language to LLVM 3.6 Framework

LLVM Dev List Archives

136

April 8, 2015

[GSoC 2014] Project RFC

Clang Frontend

131

March 12, 2014

Powered by Discourse, best viewed with JavaScript enabled

llvm basic09 data target frontend 40rem

Related Articles