Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

CESIL Interpreter

Author: Glenn Hutchings
Email:zondo42@googlemail.com

About CESIL

CESIL (Computer Education in Schools Instruction Language) was the first computer language I learned, back in CSE Computer Studies at school in 1977. It is a toy language, and not at all suited for the Real World (unlike, say, Python, which this interpreter is written in) but hey, we were kids and didn't know about all that stuff then.

I'd forgotten almost everything about CESIL. I had vague recollections about it being like assembly language, but all my memory of it had faded away. Right up until I found Andrew Jacobs' CESIL site at http://www.obelisk.demon.co.uk/cesil, and then it all came flooding back. Curse you, Andrew Jacobs! :-)

As an excuse to learn the fantastic pyparsing module, and just for the sheer nostalgia, I thought I'd hack up a CESIL interpreter in Python.

Requirements

You will need the pyparsing module.

Installation

The usual Python incantation:

python setup.py install

Examples

The examples directory contains a bunch of CESIL programs to have a play around with. Most of them come from Andrew Jacobs' site, which see for documentation on all 14 (yes, 14!) CESIL program instructions. Or, for a tutorial, look at my primes.ces example.

Implementation

This implementation differs from ANSI standard CESIL in a few ways:

  • Lines starting with # are also recognized as comments. This is so that you can make executable CESIL scripts, using the standard sha-bang syntax.
  • Newline characters (\n) are recognized in strings, and come out as a new line, as you would expect. This makes the LINE statement redundant, in line with the rest of the language.

Other stuff

The contrib directory has a GNU Emacs CESIL mode, which you can use to develop your own graphical CESIL applications (once CESIL use has taken the developer community by storm and grown a bunch of different non-standard extensions, just like Pascal did :-).

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.