Computer Education in Schools Instruction Language (CESIL)

When I first learned programming in about 1978 the school I attended was lucky to have a Research Machines 380Z on which there was the BASIC language. Using this one of the pupils then wrote a CESIL interpreter for their (I guess) O Level project. Other pupils then used this to learn the fundamentals of programming.

Skip forward a few years and I now owned a Sinclair ZX Spectrum having also previously had a ZX81 too. I decided that I would also write a CESIL interpreter this time using Sinclair’s variant of BASIC. Remarkably I still own the sheets of paper I wrote the code on and you can see them in the images below.

phpCESIL

Now, some 40 odd years later I am revisiting the CESIL of my youth to create a PHP version of it. Actually I started this in 2019 and only got back to completing it recently. As you can see from the image below this is a (fairly) complete implementation of the interpreter along with some handy additions that allow you to:

  • save and load a script to the local file system
  • list all the saved files in the directory
  • toggle debugging on and off for more information during run time.

The script, cesil.php, runs in two modes:

  1. interactively from the command line, which is what is shown above
  2. if you pass the name of a valid file it will run that.

You can find the code on my Github page if you want to try it out and any feedback is welcome.

Interactive phpCESIL

I did also try and write a version that could be run in a web browser rather than from the command line and if you look at the index.html file you will find an (almost) complete working version. However, it fails whenever it requires user input during the running of a script and I wasn’t able to find an elegant way to make that work. If you think you can sort then please do, the code is on my Github page.

One comment on “Computer Education in Schools Instruction Language (CESIL)

Leave a Reply

Your email address will not be published. Required fields are marked *