News: 0001642765

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

BASIC09 Programming Language Front-End Developed For LLVM

([Programming] 3 Hours Ago BASIC09 + LLVM)


The 46-year-old BASIC09 programming language has new compiler support with a front-end having been developed for the LLVM compiler stack. BASIC09 was developed in 1980 for the Motorola 6809 CPU running with the OS-9 operating system. With this LLVM compiler front-end, you can write BASIC09 code for modern software and hardware.

Open-source developer Boisy Gene Pitre announced his BASIC09 front-end today to LLVM developers and inquiring over upstreaming it into the LLVM codebase. This "basic09c" compiler can lex and parse BASIC09 code, proper AST construction, semantic checks, and emits LLVM IR for use by the various different LLVM back-ends. This depends upon no Motorola 6809 specific support nor OS-9.

Boisy Gene Pitre wrote in the [1]RFC announcement of this BASIC09 front-end:

"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."

While interesting on technical grounds and another front-end for exercising LLVM, don't look for it to go mainline in the Linux kernel. LLVM developer Eli Friedman [2]responded to today's announcement, " 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. "

Similarly, prominent LLVM developer Nikita Popov [3]commented that the project can live independently and simply link to LLVM as a library.



[1] https://discourse.llvm.org/t/rfc-adding-basic09-frontend-tool-to-llvm/91141

[2] https://discourse.llvm.org/t/rfc-adding-basic09-frontend-tool-to-llvm/91141/2

[3] https://discourse.llvm.org/t/rfc-adding-basic09-frontend-tool-to-llvm/91141/4



Everyone is entitled to my opinion.