|
| LC |
UserPreferences |
| Edinburgh Computer History | FrontPage | RecentChanges | TitleIndex | WordIndex | SiteNavigation | HelpContents | moin.sf.net |
This was written originally to run on 16-bit minicomputers with not a lot of memory, and so used a compressed form for storing names in its lookup table. Although identifiers could be longer, only the first 6 characters were significant, and they were packed three each into two 16-bit words by mapping the letters and digits onto the numbers 1-36 and multiplying the first by 37 and adding the second if there was one, and then again if there was a third.
Hamish had used an even cleverer packing for HAL (and the same scheme was used in the file system on the Interdatas). By adding the not usually onerous restriction that, if you mixed letters and digits in identifiers, letters could not come after digits (at least not within each triple - so you could have LLL LLD LDD DDD LL LD DD L D but not LDL DDL LDD DLD DL), three characters could be packed into only 15 bits, leaving the 16th free, perhaps for use as a flag of some kind.
LC is much simpler than Imp in not having operator precedence, and not even having pointers, expecting you to do everything with array indexing instead. It does have functions, though, so there is no need to pass variables by reference. It doesn't do includes and defines, but has symbolic constants. It even does folding (evaluates constant expressions at compile time).
Unfortunately, my translated source (LC in LC) is lost and I only have
the original Imp. I do know the translated one existed, because I got it to compile itself.
If you want to try LC yourself, you can either use Andy Davis's Imp77 compiler for Intel, or try this
translation of LC into C which seems to work quite nicely. (Also
formatted version)
I do however have a
source of ECCE (the text editor) in LC and, once I upload this, people may like to view this alongside its
original Imp, which is online in the archive, to see how relatively easy the translation is.
There is a
Manual for LC as implemented on the APM.