First, as you can see in the headline, there are two new versions of
INTERCAL implementations: see
<http://www.intercal.ukfsn.org/download/CLC-INTERCAL-1.-94.-2> or
<http://intercal.freeshell.org/download/CLC-INTERCAL-1.-94.-2/>
for CLC-INTERCAL 1.-94.-2
<http://www.intercal.ukfsn.org/download/ick-0-28.tgz>, <http://
intercal.freeshell.org/download/ick-0-28.tgz>, or <http://
elliotthird.org/mirror/c-intercal/ick-0-28.tgz> for CLC-INTERCAL 0.28
(documentation at <http://elliotthird.org/mirror/c-intercal/doc-0.28/
NEWS.txt>)
There's an interesting story behind that last URL. That website's
owner challenged me to write a continuation library in INTERCAL, which
I did in 24 hours.
Using the CREATE statement.
The focus with the new version of C-INTERCAL is extensibility. So one
way I could have done it is taken a continuation library written in C,
put a couple of line labels (or maybe NEXT FROMs) in it, and that
would be that. But that would be cheating, and using it to CREATE some
continuation statements by putting calls to ick_create in the C code
would likewise be almost as cheating.
The actual coding wasn't too difficult. Create lots of threads to act
as continuations, implement the INTERCAL equivalent of a named FIFO to
communicate between them, implement a truly global variable (that is,
cross-thread, and complete with STASH and RETRIEVE), then write some
INTERCAL spinlocks, mutexes and semaphores for the translation. (It's
easy: a spinlock, mutex and semaphore with the features I needed are
1, 2 and 5 lines of INTERCAL respectively, less if you remove
newlines.) The CREATE is just to provide a decent syntax.
Of course, just supporting CREATE needed a lot of work in the
compiler. So first I fixed the parser so that errors are truly run-
time in C-INTERCAL (E017 has been relegated to a previously minor
function, that of erroring on meshes over 65535), then implemented a
just-in-case compiler. It's a simple concept: because in C-INTERCAL
all compilation has to be done at compile time, syntax errors are
compiled just in case they gain a meaning later. That way, when the
meaning turns up, the statement is already compiled and can execute.
Many thanks for this go to Claudio Calvelli and Elliott Hird for
hosting, Jeffrey Lee for writing a highly nontrivial INTERCAL program,
and Joris Huizer for writing so many patches that I had to add a new
changelog entry, and still didn't manage to add them all for this
release. (Joris: I'll get round to adding some version of your ABSTAIN/
REINSTATE optimisations sometime, I promise, maybe in a minor
release.)
--
ais523