Is Comal lost to time?

Let's talk about anything related to the 6502 microprocessor.
User avatar
hjalfi
Posts: 107
Joined: 12 Oct 2017

Is Comal lost to time?

Post by hjalfi »

Doing some poking around with Basic, I was reminded that Comal was a thing.

I can find three implementations of Comal for the 6502: Acornsoft's for the BBC Micro, and Commodore's for the C64. Wikipedia says that there was a public domain version of the latter, but that seems to be airquotes public domain: after tracking it down it's very much copyrighted and the source is long lost. The same with Acornsoft's.

The third implementation is for DOS65 (note no slash), an OS for a Dutch computer system. There's a port of Comal for that with unknown provenance, but the documentation says it's a port of Junior Comal. Neither I nor Google have ever heard of this (but I did learn that Comal, Texas has a Junior Livestock Show). See http://retro.hansotten.nl/6502-sbc/dos6 ... s65-comal/

But the weird thing is that that's all I can track down --- except there are hints that Comal was available for loads of other systems. A news article from 1984 claims it was the major educational language on Denmark, Sweden and Ireland. A long forgotten catalogue shows it was available for the Oric. There's a tape image for Comal on the Spectrum which apparently nobody's ever heard of. Shouldn't there be more information, somewhere?
No True Scotsman
Posts: 127
Joined: 22 Mar 2023

Re: Is Comal lost to time?

Post by No True Scotsman »

hjalfi wrote:
I did learn that Comal, Texas has a Junior Livestock Show
At least that matched the search terms. I often get search results where the last third of the first page of results go way off into left field.
User avatar
hjalfi
Posts: 107
Joined: 12 Oct 2017

Re: Is Comal lost to time?

Post by hjalfi »

(I have, BTW, found out that a lot of the Comal interpreters are on archive.org. Here's the Spectrum version running in an emulator: https://archive.org/details/zx_Comal_v2 ... _Computing Still surprised not to see anyone ever mention them...)
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Is Comal lost to time?

Post by BigEd »

I see COMAL is often described as "a structured Basic". And there were several z80 implementations.

For example, Christensen writes in Datamation, December 1977
" by now we have gained considerable experience with our Structured BASIC, which we call COMAL (COMmon Algorithmic Language"
The language debuted on a Nova 1200, using 12k words of core (half the core) in 1975.

I see also in Commodore Club News from December 1981
“ ...the Department of Education and Science should tell computer suppliers that from, say, the beginning of 1982, schools and colleges will be discouraged from buying computers without COMAL or other satisfactory structured BASIC. Nothing less than this kind of action will do if we are to put educational computing in Britain on to a firm footing.”

As it turned out, BBC Basic was a structured Basic.
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Is Comal lost to time?

Post by drogon »

FWIW: I can run Acornsoft COMAL in my Ruby system without any issues. I've never really gotten into it though to do stuff like benchmarks, etc. as there seemed little point, really.

Personally, I'm treating the copyright issue of the (Acornsoft) ROM images as more or less moribund - it's not open source but I really do not know who will come after me or you if we shipped a system with the ROM images - or even without the ROM images with the ability to run them as the ROM images which are freely available to download from many places. This may not make it right but that's the way it seems.

Are you planning a commercial system with a BASIC or COMAL for sale? Please let us know as if it's for a personal thing, really just use it as no-one will know.
Screenshot_2023-08-12_16-10-56.png
Screenshot_2023-08-12_16-10-56.png (11.7 KiB) Viewed 18558 times
See also:

https://www.josvisser.nl/opencomal/article.html (comal has been set free)
https://www.josvisser.nl/opencomal/ (Open Comal)

Open Comal is written in C.

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
User avatar
hjalfi
Posts: 107
Joined: 12 Oct 2017

Re: Is Comal lost to time?

Post by hjalfi »

This is for an operating system distribution, so all the copyright paperwork needs to be correct or other people won't distribute it (if they ask: do you have the rights to redistribute everything here? then I can't lie).

So far I've seen several references to the first Comal versions being public domain, but have been unable to follow this up. Still no idea what that Junior Comal thing is, and the DOS65 Comal source seems to be missing. The binaries exist, though...
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Is Comal lost to time?

Post by drogon »

hjalfi wrote:
This is for an operating system distribution, so all the copyright paperwork needs to be correct or other people won't distribute it (if they ask: do you have the rights to redistribute everything here? then I can't lie).

So far I've seen several references to the first Comal versions being public domain, but have been unable to follow this up. Still no idea what that Junior Comal thing is, and the DOS65 Comal source seems to be missing. The binaries exist, though...
"Junior" refers to the (Elektor) Junior Computer. A 6502 based system which was a KIM-1 like system. See:

https://en.wikipedia.org/wiki/Elektor_Junior_Computer

I guess this is the page you're thinking of: http://retro.hansotten.nl/uploads/eljun ... %20dis.txt

For now it looks like the only way you're going to get a version of Comal (& BASIC) that's suitable for you might be to write it yourself... And who has time/inclination/enthusiasm/energy for that these days...

(Although it is something I'd like to do, but it's not neat the top of any sort of to-do list right now)

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
User avatar
hjalfi
Posts: 107
Joined: 12 Oct 2017

Re: Is Comal lost to time?

Post by hjalfi »

Curses!

I was hoping to find some predecessor port which actually was in the public domain. It would have made sense given the language's history --- it was apparently written (in part) by university students.

Given that modern BASICs for 8-bit machines tend to be incorporating more and more structured programming systems, a useable Comal interpreter from back in the day would be an excellent alternative to writing a new one. Comal's a fine language, deliberately designed to be a better BASIC, with standards documents and everything. But I don't even know who owns it any more...
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Is Comal lost to time?

Post by drogon »

hjalfi wrote:
But I don't even know who owns it any more...
No one owns Comal in the same way that no one owns Basic, or FORTRAN, Pascal, etc.

There are standards, but not ownership, so if you want to write your own, no one will stop you - or come after you.

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
teamtempest
Posts: 443
Joined: 08 Nov 2009
Location: Minnesota
Contact:

Re: Is Comal lost to time?

Post by teamtempest »

A version of Comal that is apparently in the public domain is Commodore Comal 0.14, based on the Comal-80 specification.

I've done a partial disassembly of the binary.

The final part, at the highest position in memory, is mostly initialization. The final step is to set the top of memory to just before the initialization code, freeing that memory for program space. Even so, there's not a whole lot of memory for program space, only about 12K.

Floating point is handled by the BASIC ROM, used by Comal as necessary.

Error messages are not included in the binary. They are on the Comal disk, which is read whenever an error occurs. Oddly enough, at least two of the error messages are duplicates of each other. This suggests to me some carelessness on the part of whoever did the port, which further suggests there may be additional opportunities for optimization (though frankly the whole idea of error messages not in the binary itself is kind of weird to me in the first place).

The main loop is not handled the way BASIC does it, as a recurring loop of calling subroutines from a central loop. Instead, this Comal uses a series of direct jumps from place to place, making it hard to follow what's going on.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Is Comal lost to time?

Post by BigEd »

Some notes on 0.14 by Jim Butterfield back in the day:

Update On COMAL: A SuperBASIC (Classic Computer Magazine Archive COMPUTE! ISSUE 54 / NOVEMBER 1984 / PAGE 102)
Quote:
COMAL has traditionally been available in the public domain (that means free).
Quote:
It looks like things are changing. New versions of COMAL are being released that will make it an attractive language. A disk version for the Commodore 64 is now in the public domain; a cartridge version is soon to be made available for sale;.
Quote:
Disk-based COMAL for the Commodore 64 is named COMAL 0.14. It's free in North America, but it's not public domain. The package prints a copyright statement, but permits unrestricted distribution and copying. COMAL 0.14 is available from clubs, user groups, and the COMAL user group in Madison, Wisconsin. It's a good language implementation, complete with graphics and a complete set of error messages drawn from disk as needed.
User avatar
barrym95838
Posts: 2056
Joined: 30 Jun 2013
Location: Sacramento, CA, USA

Re: Is Comal lost to time?

Post by barrym95838 »

teamtempest wrote:
Error messages are not included in the binary. They are on the Comal disk, which is read whenever an error occurs. Oddly enough, at least two of the error messages are duplicates of each other.
Maybe one of the duplicates is obscuring the "DISK READ ERROR" message 8)
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)
User avatar
hjalfi
Posts: 107
Joined: 12 Oct 2017

Re: Is Comal lost to time?

Post by hjalfi »

I can't help feeling that if you need to store your error messages on disk, your compiler is too damn big...

I have figured out that the original Comal interpreters probably passed to UniComal A/S, which was bought by Prolog Development Centre A/S, who still exist. I might drop them an email to see if they still have anyone who knows about it. I doubt it, but it can't do any harm.

But this has all got me wondering how hard writing a Comal interpreter could possibly be...
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Is Comal lost to time?

Post by drogon »

hjalfi wrote:
I can't help feeling that if you need to store your error messages on disk, your compiler is too damn big...

I have figured out that the original Comal interpreters probably passed to UniComal A/S, which was bought by Prolog Development Centre A/S, who still exist. I might drop them an email to see if they still have anyone who knows about it. I doubt it, but it can't do any harm.

But this has all got me wondering how hard writing a Comal interpreter could possibly be...
Easy for the openComal project... https://www.josvisser.nl/opencomal/

However while I can compile that on my Linux desktop, I can't run it, and I don't have the energy or time to work out why.

A couple of things though: The internals of Comal and BASIC will be pretty much the same, so you'll have a LOT of common code - all the line editing, load/save, arithmetic (integer/floating point) handling and so on will be common - a lot of the variable handling and parsing will be the same too - this might make the task of writing them easier - ie. write one and the other will not be hard to follow on.

However... Like my fondness of BCPL for my '816 board, I suspect that if you did get a Comal going, you might be the only programmer in the world who might use it ...

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Is Comal lost to time?

Post by BigEd »

Thanks for the link to OpenCOMAL. This might be the most current effort, last change only 4 years ago:
https://github.com/poldy/OpenCOMAL
Post Reply