Programming projects I did for fun
Here is a list of such projects, most of which are not, and may never be,
completed. In cases where I have added a reference to actual code, it is made
available in the understanding that the documentation has not been brought
up to a level required to be useful to other people than myself, but you may
look at it for your amusement, and at your own risk.
- While I was a student I attempted to write an an emulator for my
HP-67 pocket calculator (of which I was immensely proud) in FORTRAN'66
(of which I was not). Later, when Apples II became available, I
redid this in 6502 assembly code. The project was partially successful:
features emulated included full programmability, and arithmetic functions
up to the complexity of square root extraction (with exact emulation of
floating point BCD arithmetic, to the point of reproducing precisely the
same round-off errors); transcendental functions like the logarithm
however were never implemented.
- On a stand-alone `intelligent terminal' from DEC, with an LSI-11
processor, a DEC-2 tape drive as only mass storage device, and running
the RT11 operating system (this was at the time that Apple II was
the only available microcomputer), I wrote a FORTH-like kernel in PDP11
assembly language (given these items and the next you may start to think
that assembly is my favourite language, but it is not; in this case it
was about the only language available except BASIC). I called the system
Interactive Threaded Code Assembler, and it allowed interactive assembly
and execution of both ordinary machine code and threaded code. I
actually used the system for such things as solving certain geometric
puzzles, which would have been hard to do by any other means on that
machine. The project was discontinued because I moved out of the house
of the owner of this curious machine, and I never saw another one since.
- I wrote an interpreter for a simple and mostly functional language,
based on the basic ideas of LISP, but more decent in syntax and
semantics; it allows (and heavily uses) higher order functions, but is
not statically typed. It is extremely non-portable, as it is entirely
written in 68000 assembly code (but with parsing tables generated by
yacc), and runs only on Atari ST computers. Some
interesting features are its speed, given the platform and its
interpreted nature (it computes 1000! in about 5.5 seconds, where
an internal routine takes another 3 seconds to convert the result
to decimal for output), its compactness (the executable is 16 Kb;
the earliest version took only 5 Kb, which already included a
garbage collector) and the fact that it has an implementation of
unbounded integer arithmetic that uses a 2's complement
representation. To my own surprise, this language has turned out to be
my language of choice for several experiments with combinatorial
algorithms, whose basic definition is easy to implement, but where I
need very flexible access in applying the algorithms.
- As a `first exercise' in compiler construction, I started writing a
full language Algol68 compiler, implemented in C.
The project is currently stalled with the analysis phase almost complete
(all errors as defined by the report will be caught, except those
involving transiency of names, which was deliberately postponed). Before
I start the synthesis phase, I shall need to study code generation; in
the mean time I shall complete conversion of the program into a literate
one (using CWEBx), which may also involve writing an extension to CWEBx
to conveniently handle yacc grammar specifications.
- My only serious program with a graphical interface is one to display
and manipulate `pictures', in the mathematical sense as defined by
Zelevinsky; it focusses on the operation of glissement, as
described in my pictures paper.
Actually, the graphical interface using Xlib was originally
written by a visiting student, James Faux. This program was not written
just for fun, but also because I really needed it for experiments with
the algorithms defined in abovementioned paper. Although the program
works, and is entirely written in CWEBx, the
sources still leave much to be desired,
and I plan to rewrite and possibly extend the program some time in the
future.