[Microbit-Python] Nicholas's MicroBit editor related brain dump

Nicholas H.Tollervey ntoll at ntoll.org
Fri Jun 5 15:33:07 CEST 2015


Hi,

Here's the promised brain dump:

The BBC have engaged Microsoft as a partner to create a web-based coding
platform for use by kids who want to program their MicroBit. They would
like the Python community to contribute a Python editor.

* The editor is a website based upon Microsoft's TouchDevelop platform
(https://www.touchdevelop.com/).

* The actual compiler is a hosted solution based upon ARMmbed
(https://mbed.org/).

* Put simply, some sort of digital asset representing the user's code in
the TouchDevelop platform is posted to ARMmbed. ARMmbed responds with a
compiled hex file (or, I presume, helpful error messages if compilation
fails) that the user drags/drops onto the device.

* All the capabilities of the device that we need to care about are made
available via a C++ Device Abstraction Layer (DAL) runtime / library
against which any code that is produced by the user is ultimately linked.

* To facilitate multiple target languages in the TouchDevelop platform
"editors" are embedded within iFrames within the wider TouchDevelop
editor environment. Such editors communicate with the TouchDevelop
environment via standard JavaScript postMessage techniques. TouchDevelop
handles generic web-app like features such as authentication,
authorization, storage of data etc.

* An editor is hosted by a third party (In our case,
http://pythonanywhere.com/) and has four responsibilities:

    1) To present an IDE into which code is entered.
    2) Tutorials / Howtos and other language specific help functions.
    3) Drive the Javascript based simulator embedded in the TouchDevelop
environment via a Javascript API that maps to the C++ DAL runtime
(presumably via postMessage passing).
    4) Provide a compilation mechanism that targets either Microsoft's
own AST (facilitating translation between languages) or C++ that is then
linked against the DAL C++ runtime mentioned above.

* The language implementation will likely be a Pythonic "shim" around
the C++ runtime (Pythin - a less heavy Python... geddit?) and will also
include further simple language features documented by the BBC such as
variables, control flow etc...

* Michael Sparks (of this parish) has already done a lot of work on
creating a reduced version of Python that compiles to C++ (although I
presume NOT the current DAL). I'll leave it to Michael to explain more. ;-)

I'm more than happy to answer any questions you may have about any of
the above.

My next task is to get you all access to the BBC's GitHub repos.

All the best,

Nicholas.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/microbit/attachments/20150605/2752a4a9/attachment.sig>


More information about the Microbit mailing list