Felix Winkelmann's SUPERFLY Is an FP Compiler for "Tiny Computers" Like the Commodore 64

Other backends include DOS-based x86 PCs, the Atari 2600 games console, and the Uxn virtual machine.

ghalfacree
3 months ago Retro Tech

Software developer and vintage computing enthusiast Felix Winkelmann has released a low-level programming language and matching compiler for "tiny computers," with backends supporting the Uxn virtual machine, the Atari 2600/VCS console, the Commodore 64 and compatibles, and IBM-compatible PCs running DOS: SUPERFLY.

"'SUPERFLY' is a compiler for a non-pure functional low-level programming language targeting tiny computers," Winkelmann explains of the project. "The language derives from John Backus' 'FP' and is heavily influenced by the 'K' array language. The compiler is written in C, has been tested on various UNIX like systems and should be portable to a wide range of operating systems. The only external dependencies are a C compiler. If you don't have Uxn installed, a minimal version of the VM included in the distribution files is used for testing."

SUPERFLY is a compiler that turns FP-inspired program code (above) into executables for "tiny computers." (📷: Felix Winkelmann)

The language behind SUPERFLY is a minimal implementation of FP, for "Functional Programming," a language released by John Backus in the 1977 paper Can Programming Be Liberated from the von Neumann Style. While modern functional programming languages are typically based on lambda calculus, Backus' function-level approach still has its fans — including Winkelmann.

Programs written in Winkelmann's version of FP are compiled for their targets using SUPERFLY. "The compiler performs some minor optimizations but relies mostly on the user to ensure the generated code is compact and efficient," Winkelmann explains. "Even though the programming model uses dynamically allocated sequences, a simple translation model and the ability to keep short arrays in registers allows to produce relatively good code assuming the programmer keeps the code simple and has a sufficient understanding on how the compiler operates."

Programs compiled by SUPERFLY can run on the Uxn virtual machine, Atari's classic 2600/VCS games console, the Commodore 64 and compatibles including the Commodore 128 and SX-64, and x86 systems running MS-DOS or a compatible operating system. Not all backends are complete, however: Winkelmann says the Uxn backend is the most functional, followed by the DOS backend that "lacks some optimizations," then the Commodore 64 backend that "needs more testing," and finally the Atari 2600 backend, which is described as "complete, with certain restrictions."

More information, including example program code, is available on the project's Codeberg repository, where the full source code is made available under an unspecified license.

ghalfacree

Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.

Latest Articles