- Mon Mar 28, 2016 7:54 am
#44167
It's amazing that people like mmiscool and others have managed to squeeze entire languages into the limited memory of a tiny ESP8266, but two into one won't fit.
Being able to run a bit of C code from Basic seems like a reasonable request, until I started thinking about things, and realised that not even the C compiler can just run a few lines of desired 'must have' C code. It needs the full working sketch complete with variable declarations and required libraries etc, and if even the tiniest semi-colon or curly brace is missing then the C compiler has indigestion. It also requires the one and only memory-mapped address space which is available, and which is of course already being used by the Basic compiler. I hasten to add that I'm not a programmer and don't really know what I'm talking about, I'm just trying to think things through logically with what little I do know.
So wishing to use compiled C within Basic would seem no less of an unrealistic 'ask' than wishing the C compiler could also run interpreted Basic... and if THAT had been possible then mmiscool wouldn't have needed to create ESP Basic in the first place.
But take a step back and you'll see that it IS possible to get the best of both worlds, but by having them side-by-side instead of on top of each other.
Remember the initial game-changing bonus of being able to attach a postage-stamp sized ESP8266 to give an arduino interactive wifi connectivity using AT Commands?
Well, ESP Basic is now becoming the game-changer, so looking at things from a different perspective, it is just as practical to consider attaching interactive arduino C++ device capability to your ESP Basic device if wished. Unlike the rigid AT Commands you are free to concoct whatever transfer commands you choose, such as DoThis or DoThat - your only real constraint is to obviously ensure that your receiving device is looking for whatever serial commands you have chosen to send from the other device.
And soon we won't even be restricted to serial communications, because mmiscool and cicciocb are already busy adding node-to-node network command messaging facilities to ESP Basic. Arduino C++ has udp libraries available which could give the required network interaction, but I suspect it might not be long before someone creates a similar simple-to-use arduino C++ network command messaging library to make that 'inter-species' interaction childs play, and that really would then offer the very best of both worlds.