Comal has been set free (2002)

An article here about the open-sourcing of Comal, nearly 20 years ago. But also a bit of a love letter to a structured language which is simple and small and familiar to Basic users:
Comal has been set free by Jos Visser

Here’s the home page of the OpenComal project.

There’s a bit of an update in this thread on stardot.

Acorn offered a version of COMAL on ROM for the BBC Micro - the 450 page manual has been remastered here.

The included SSD disc image contains some of the longer listings and examples from the book, along with a copy of the COMAL ROM. Boot the disc with Shift+Break to get an index of the programs and which page of the book they relate to.


Interesting… I did look at Comal recently for some other stuff I was “researching” (ie. vanishing down yet another rabbit hole!)

And while I do remember Comal back in the days of the Beeb, I never used it. At least I don’t think I did (I’d left school when the Beeb was launched)

However… just over 10 years back I wrote what I considered my “ideal” BASIC and it looks similar - the prime number example on that document in my dialect of BASIC looks like:

input "Number please: ", n
print n;
if fn isPrime (n) then
  print " is a prime number!"
  print " is not a prime number..."


def fn isPrime (n)
  for f = 2 to n div 2 cycle
    if n mod f = 0 then = false
= true

Note that my BASIC only supports real numbers but DIV and MOD do what you might expect.

I think I may need to re-visit both Comal and my own BASIC real soon now…




My only contact with Comal is one magazine article from Commodore Magazine (the computer magazines here in the USA tended to be pretty “stuffy” and “serious” compared to European computer magazines). I remember being interested in it because it had some sort of graphics commands and such (which the built in Commodore 64 BASIC infamously lacks).

However, I never saw it out in the wild. Looking it up, I see why. The Comal 80 cartridge was a whopping 64KB of ROM! 16KB banks with 4 banks! Normally, a C64 cartridge would be up to 16K but there wasn’t any bank switching. Almost all C64 cartridges were trivially cracked simply by saving them to disc (or tape I presume). But that’s not going to work for a weird bank switching cartridge, much less one which doesn’t even fit in the available RAM.

So, in contrast, the popular Simon’s BASIC, which added graphics and sound commands, was stupid easy to pirate and it got around everywhere. Comal? Well, they sure had a great anti-piracy scheme there, but who would have ever used it?

1 Like

One thing I meant to mention: it seems the interpreter reads and validates the whole program before starting. That seems to me quite a nice feature of a structured language, lowering the chances of some kinds of errors. Of course, you’d want it to be fairly quick to do that. And if you run a second time without changing anything, you’d want it to skip the check.


Altair Programming Languages has Comal for CP/M-80.


I think that was by design, so it would create a nice programming environment. I know that Glasgow University was using Comal on C64s up until around 1990 to teach programming to engineers.

TPUG, the Commodore user group I’m part of, seems to have had some kind of official role in distributing Comal. They published the COMAL Reference Guide, and distributed a large library of COMAL software. The Comal 0.14 interpreter disk for the C64 could always be freely copied.


Yikes, how does that take 64k though?

I saw VERY nice editors in 16k. Action! on the Atari is one example, the editor was so good that people used it as the basis for a word processor. Yet the editor and language ran in a single 16k cart, four 4k roms banked. Really, it’s hard to imagine how you can use up that much code on a 6502!


No idea. And I know all about 16K word processors: the magnificent Protext for the Amstrad CPC machines was a single 16 KB EPROM, and was a full-featured word processor. It grew out of MAXAM, an assembler EPROM that people were buying just to use the excellent text editor.

Wordwise for the BBC Micro was another EPROM-based word processor.

1 Like