MicroPython Demoed Running Bare Metal In Browser
Written by Kay Ewbank   
Tuesday, 13 June 2017

The developers of MicroPython have developed the ability to run MicroPython "bare metal" in a web browser. MicroPython is an implementation of Python optimised to run on microcontrollers and in constrained environments.

MicroPython combines Python 3 with a small subset of the Python standard library. Despite its limited size, you get features including an interactive prompt, closures, list comprehension, generators, and exception handling.  It implements the entire Python syntax and core datatypes including: str, bytes, bytearray, tuple, list, dict, set, array.array, collections.namedtuple, classes and instances. Built-in modules include sys, time, and struct. It claims to compile 99.99% of the standard library. The language will fit and run in 256k of code space and 16k of RAM.

 

micropythonbanner

 

The language is most commonly available on the MicroPython pyboard. This is a compact electronic circuit board that runs MicroPython on the bare metal, giving you a low-level Python operating system that can be used to control all kinds of electronic projects.

The browser-based "bare metal" MicroPython was put together using unicorn.js. This is an Emscripted version of unicorn, which is itself a stripped-down version of QEMU, the open source machine emulator and virtualizer. 

 

micropythonboard

 

The developers say they used unicorn.js to implement a Cortex-M3 based "virtual microcontroller" that runs in the browser. They then run a unicorn port of MicroPython on this virtual microcontroller.

Writing about the project on the MicroPython blog, Damien George of George Robotics said:

"Running this unicorn port of MicroPython will give you a good idea of what it's like running MicroPython on the bare metal of real hardware, and allows you to test stuff out quickly, and get to know (new) features of MicroPython."

The blog post said that the current port is pretty minimal and doesn't have many features enabled, but plans for the future include different builds of unicorn MicroPython to show-case size versus features.

 

micropython

 

More Information

MicroPython Site 

MicroPython Forum

Related Articles

Micro Python - The Latest Python

Commando Jump Game For The Micro:bit In Python

Lua 5.3 Released

Raspberry Pi Goes Commercial

Edison Is A PC On An SD Card

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


Data Wrangler Gets Copilot Integration
11/11/2024

Microsoft has announced that Copilot is being integrated into Data Wrangler. The move will give data scientists the ability to use natural language to clean and transform data, and to get help with fi [ ... ]



Remembering Thomas Kurtz, Co-creator of BASIC
15/11/2024

Thomas Eugene Kurtz, the co-founder of the BASIC programming language, has died at the age of 96. BASIC, which was developed for the purpose of education, popularized computer programming making it ac [ ... ]


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Tuesday, 13 June 2017 )