I am slowly getting the SW stack for BasicPI together and wonder if I should implement a minimal shell language based on Plain. I can regardless run a Plain appliction at start-up for configuration, but a shell language means that we are able to connect on a CLI console and write/execute scripts and commands ad-hoc
Technically this can be done in two ways – I can compile the script on the PC which will require a specialized terminal with a build-in compiler, or I could try implementing a minimalistic compiler embedded as a shell script.
I think the answer to this is that I consider these options as I write the “Assembler” for Plain. I have so far only done a proof of concept on Plain, so it’s a bit left before I have a working system.
Regardless implementation technique the concept with a “shell” script is that you connect with a terminal and edit/execute the script. Pretty much the same way as we did in old 80s Basic computers. This means the program source needs to be stored on the device, something which is a pain with 1Mb Flash.
Some of the old Basic interpreters used a neat trick of replacing keywords with a 1 byte ID to reduce size – I can do that. But we still have to deal with comments etc. The advantage is that you can connect ad-hoc to any device and change the behavior by changing the script. The drawback is that you start adding complexity to an embedded system – which is something I want to avoid.
Plain will regardless be easy to disassemble since we have 1:1 between instructions and statements in the high level assembly language.
Working with Linux and embedded Python I must admit that I look forward to be working with Plain and a distributed system language rather than the old, fashioned device languages + I must admit that Python never will be a language that I will like due to the syntax and features like exception mechanism.
Thank your for reading my Friday morning rant 🙂