logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·31.10.26
← Back to news

Clamiga: Common Lisp for the Amiga

Original article
nnamgreb.de|35 points|2 comments|by emptybits|Aug 13, 2026

Clamiga: Bringing Common Lisp to the Amiga

By Manfred Bergmann | Software Development | [Blog] | [Projects] | [About] | [Imprint] Published: 31 July 2026

Following my recent series on ACE BASIC, I want to share a project I've been developing over the last six months: CL-Amiga, more affectionately known as Clamiga.

🚀 What is Clamiga?

Clamiga is a native implementation of Common Lisp designed specifically for the Amiga ecosystem. While it is built for the classic AmigaOS 3 (68k) and MorphOS (native PPC)—with potential future support for AROS and AmigaOS 4—it is also fully functional on Linux and macOS. In fact, I use the macOS version as my primary development environment.

The Etymology

The name is a simple portmanteau: Common Lisp for the Amiga →\rightarrow→ CL-Amiga →\rightarrow→ Clamiga.

Since amiga translates to "female friend" in Spanish and Portuguese, the name serves a dual purpose: it is the Lisp that runs on your Amiga, and it is your amiga (friend) in the coding process. ;)


📚 A Primer on Common Lisp

Common Lisp is a veteran language that remains remarkably relevant. Despite the ANSI standard being frozen since 1994, the language feels contemporary. Most ANSI-compliant code written decades ago still compiles on modern systems.

Key Language Strengths

  • CLOS: A sophisticated object system featuring multiple dispatch.
  • Condition System: A robust error-handling mechanism that far exceeds standard "try-catch" exceptions.
  • Macros: The ability to modify the language syntax itself.
  • Interactive Workflow: An image-based development style allowing for the redefinition of functions within a live, running system.

Many "modern" language features were actually pioneered by Common Lisp long ago. For those seeking more depth, I recommend my previous articles: Common Lisp - Oldie but goldie and my piece on Functional Programming in Common Lisp.

The Landscape of Implementations

There are several high-tier implementations available today:

ImplementationTypeArchitectureNotes
SBCL / CCLNative Compilerx86-64, ARM, PPCHigh performance; high RAM usage; no 68k support.
ECL / ClaspVariousMulti-platformRobust and modern.
CLISPBytecode VMPortable CUnmaintained for decades\text{Unmaintained for decades}Unmaintained for decades; no recent Amiga builds.
LispWorks / AllegroCommercialMulti-platformProfessional grade.

Clamiga takes inspiration from the spirit of CLISP—a compact bytecode interpreter written in C—but provides a modern, maintained build for the Amiga. It avoids external runtime dependencies like libffi or LLVM, meaning no C compiler is required at runtime.


🛠️ Clamiga's Capabilities

It is important to note that because this is a full Lisp runtime, it will not break speed records outperform hand-optimized C or Assembly.

Clamiga≠High-speed game engine for scrolling\text{Clamiga} \neq \text{High-speed game engine for scrolling}Clamiga=High-speed game engine for scrolling

However, it provides an incredible amount of power:

  • m68k-JIT: An attempt to boost performance on 68k hardware.
  • The Numeric Tower: Full support for bitvectors→ratios→complex numbers→bignums\text{bitvectors} \rightarrow \text{ratios} \rightarrow \text{complex numbers} \rightarrow \text{bignums}bitvectors→ratios→complex numbers→bignums.
  • Dev Tools: Integrated REPL, debugger, and object inspector.
  • Resilience: Full implementation of restarts and the condition system.
  • Native Integration: Sockets, threading, and file system access mapped directly to AmigaOS APIs for maximum compatibility.
  • Paradigm Flexibility: Full CLOS support and functional programming capabilities.

Essential Glossary

  • ASDF (Another System Definition Facility): The standard build tool for Lisp. Clamiga includes ASDF to handle "systems" (libraries).
  • FASL files: Compiled Lisp source.
    • Benefit: Faster loading than raw source.
    • Portability: FASL files generated on m68k are interchangeable with those on PPC.
  • Quicklisp: A massive library manager (1,500+ libraries). Clamiga uses compatibility shims to support these, though some are too resource-heavy for a 68020 CPU.

⚙️ Technical Architecture

Clamiga utilizes a single-pass compiler that transforms S-expressions into bytecode, which is then executed by a stack-based Virtual Machine (VM).

Design Constraints & Solutions

To fit the Amiga's limitations, several specific choices were made:

  1. Value Tagging: Uses tagged 32-bit values.
  2. Memory Addressing: Heap pointers are stored as arena-relative offsets. This ensures the object model remains compact and 32-bit clean.
  3. Garbage Collection: A mark-and-sweep collector with slide-compaction prevents fragmentation from killing long sessions on systems with only 4MB or 8MB of RAM.
  4. Cross-Platform Core: Because the core is written in portable C, the same system runs on macOS/Linux. This allows for rapid testing on fast hardware before deploying to the Amiga.

💾 Memory Management

Living with 4MB of RAM (or less) requires strict discipline. The core of Clamiga—including the numeric tower, loop, format, and CLOS—boots in approximately 0.5 MB of heap.

Memory Scaling Guide

Use CaseHeap AllocationStack Size
Simple Programs (No ASDF/Quicklisp)--heap 1M64K (Default)
Small/Medium Programs--heap 4M (Default)64K (Default)
Loading ASDF--heap 11M64K (Default)
Quicklisp + Libraries--heap 24M128000

To keep memory footprints low, Clamiga employs Packed Byte Vectors. For example: (make-array n :element-type '(unsigned-byte 8)) This ensures that each element occupies exactly 1 byte, rather than a full Lisp object pointer.