We have had this thought for many years… “Why do we need a PC to code?”. The BrainPad is more powerful than our first PCs and it can easily run BASIC, so why not connect a USB keyboard to a BrainPad and start coding it without using a PC?
Not only code, we can even step through code! We can build an IDE to step, debug and even inspect variables…yes right onto the BrainPad itself, without a PC.
So what language should be support? BASIC takes you back 50 years but it is VERY easy. Python is powerful and somewhat easy but still not first-step-friendly. What other options are out there? Do we teach coding with curly brackets or not? C is the mother of all languages, why not teach C?
None of the options are good “friendly starting point”. So let us make something BASIC-like C-friendly language. It should not be made to make us (developers) happy. It should be made so the average person feels like a real programmer quickly. It is made to show the user how computers “think”. And it must have the cool BrainPad’s instant-gratification user reward.
Turn an LED on… no more than a line
PINSET P3, HIGH
But then you can write it like this and it will still work
PinSet (P3,High);
What about a loop?
// curly brackets are optional!
WHILE
PINSET P3, HIGH
SLEEP 300
PINSET P3, LOW
SLEEP 300
ENDWHILE
// note how we ignore semicolons
while(1==1){
PinSet(P3, High);
Sleep(300);
PinSet(P3, Low)
Sleep(300)
}
We already have some interested community members, who are making this happen.
There are 2 sides to this development:
- the visual user interface (the IDE) running on a tiny display
- the interpreter. For reference, this BASIC interpreter is written in C# and already tested to work in TinyCLR. It might be a good starting point. GitHub - Timu5/BasicSharp: BASIC interpreter in C#
Finally, here is a repo to get the project going https://github.com/ghi-electronics/k-basic