One thing that resonated with me about FOCAL is its use of single uppercase characters as its unique commands, and variable names are formed from 2 or more characters, but only the first two are significant.
When you are memory and processing power limited, this makes absolute sense as it makes the line parsing so much easier, efficient and saves precious words of memory.
The early Forths used to do a dictionary search based on the first 3 characters and the length of the word. This adds flexibility but at the expense of additional complexity.
What about a minimalist language using single, printable ascii characters as the commands, variables and operations? The ascii value of the character provides a direct index into a look up table, and from this table a Jump address is loaded into the Program Counter.
Based on this concept, the inner interpreter of an extensible interactive language could be reduced to a jump table and a couple of hundred bytes of primitive instructions and support routines.
The concept is not new, single keypress commands have been used for decades in machine code monitors, but can this technique be extended to create a useful language, from which useful applications may be written?
Considering the example of the 6502. Could it provide sufficient functionality to allow hardware “bring up” and debug purposes to be performed more easily than a hex-monitor - such as WozMon?
So you use WozMon to type in a couple of hundred of bytes of hex codes and then you have a higher level extensible language, making code development somewhat easier.
One such example of this was the VTL-2 (Very Tiny Language) which reportedly fitted into 768 bytes of the three extension ROMs in the early 6800 system from Altair. VTL-2 has subsequently been ported to 6502 - and a few years ago was discussed here on the 6502.org forum.
http://forum.6502.org/viewtopic.php?f=2&t=2612
Porting languages between processors is something that was frequently done in the 1970s, and it can either be done using brute force, transcoding each fuunction in turn. Alternatively it can be done by way of a virtual machine - in a similar manner to Wozniak’s Sweet-16 or Tiny BASICs Interpretive Language (IL)
A more recent example is Marcel van Kervink’s Gigatron TTL Computer - where a 16-bit von Neuman virtual machine has been built on top of a Harvard 8-bit hardware architecture.
It could be argued that for most computing applications, 16-bit integer arithmetic is about the minimum pre-requisite. Even VTL-2 was built around 16-bit requirements.
The well known “From Nand to Teris” course implemented a 16-bit stack based VM on top of an insanely simple hardware architecture. This layer of abstraction turns the process of programming the machine from an impossibly frustrating machine code to something a little more human readable.
So we need a simple 16-bit VM, with a reduced instruction set and the means to enter code directly from the keyboard on a self hosted system. Can we do this in 768 bytes, unlikely, but I have done something similar in 900 bytes on an MSP430.
So my challenge for the rest of this week is to squeeze a useful extensible programming language with editor and assembler into 1024 bytes.