0

CircuitPython vs MicroPython on ESP8266
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CircuitPython vs MicroPython on ESP8266

by jerryn on Fri Jan 20, 2017 8:58 am

For the ESP8266 Boards, is it your intent to maintain compatibility between MicroPython and CircuitPython?
That is, clearly "nativeio" will not be supported by MicroPython, but will "machine" continue to be supported in CircuitPython?
Should I expect to be able to always take a working MicroPython script and execution it under CircutiPython on an ESP8266?

For the SAMD21 CircuitPython is the only option and I am hoping that it will be easy to port applications between the SAMD21 and ESP8266 boards.

Just curious what to expect. Thanks for all the work on CircuitPython.

jerryn
 
Posts: 1501
Joined: Sat Sep 14, 2013 9:05 am

Re: CircuitPython vs MicroPython on ESP8266

by tannewt on Fri Jan 20, 2017 2:54 pm

Our biggest focus is consistent APIs between CircuitPython ports (SAMD21 and ESP8266) and CPython. MicroPython compatibility will be preserved where it doesn't come into conflict with that goal.

The result is:
* time is different from MicroPython in favor of being a subset of CPython (no sleep_ms, sleep_us). We could add a utime with them for compatibility but its not a high priority.
* machine is kept but not changed at all.
* Code from CircuitPython should be portable to CPython assuming all modules are available.
* nativeio code is portable between CircuitPython ports (though I2C requires changing between nativeio and bitbangio)

So, to answer your question. No, don't expect to move working MicroPython code and run it in CircuitPython. You can and should expect SAMD21 code to port to ESP8266 though. Let me know where that is difficult and we'll improve it.

I'm confident that cross-port code will work because the Python API is defined in shared code and each port implements C functions that it calls. This way the C compiler validates most of it. It should also make it easy to add the APIs to other ports as other people want it.

tannewt
 
Posts: 2496
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.