Skip to content

The EM™ Programming Language

Welcome to the world of EM [ˈɛm ] – a novel programming language and runtime environment targeting resource-constrained embedded systems. To increase your understanding of the language and its runtime, this site documents all aspects of the EM software platform.

1 — Why another language

To fill a void...  While C remains the dominant programming language for 8 / 16 / 32-bit microcontrollers [MCUs] with limited memory and processing resources, we see opportunites for a higher-level language which at the same time paves the way for higher-levels of embedded system performance.

2 — Where does EM make its greatest impact

Quite simply, by reducing overall program size – a careabout for software developers working with resource-constrained MCUs.  Reducing runtime memory requirements not only can improve program execution time, but can dramatically lower overall power consumption within the MCU as well.

Though the EM language translator ultimately generates (portable) C/C++ code as output, a novel configuration phase within the program build-flow serves as the "secret sauce" behind these performance improvements.

A quick pass through  EM . optimize = WPO + ACO  should offer some more insights.

3 — Show me some sample EM code

package em.examples.basic

from em$distro import BoardC
from BoardC import AppLed

from em.mcu import Common

module BlinkerP

end

def em$run()
    AppLed.on()
    for auto i = 0; i < 10; i++
        Common.BusyWait.wait(500 * 1000L)
        AppLed.toggle()
    end
    AppLed.off()
end
If you really can't wait to see some more code, visit Browsing EM.

4 — How can I benchmark EM against C

Comparing the more modern "look-and-feel" of EM against legacy C can take us down a slippery slope where personal taste quickly dominates the discussion.  EM must trump C quantitatively. 

To that end, we've provided a robust framework for benchmarking EM against C – not only by quantifying program size and execution time, but also by measuring power consumption and energy efficiency.

Have a look at CoreMark reimagined – the EM•Mark suite to learn about our latest efforts in this arena.

5 — What markets / applications does EM best serve

Broadly speaking, any "thing" under the Internet of Things [ IoT ] umbrella.  More specifically, what pundits now term the Ambient IoT – dominated by MCUs which push the size / power / cost envelope to ever-lower points.

Many of the applications served by EM will rely upon small batteries or harvested energy to power the underlying MCU – which senses / controls part of its environment, as well as communicates wirelessly with IoT hubs.

6 — Where did EM originate

Conceived at UC Santa Barbara in 2010, the EM language and runtime has now found its way onto more than twenty MCUs from almost a dozen silicon vendors.

Targeting high-volume commercial applications over the past decade, EM's uncanny ability to reduce firmware footprint proved critical in keeping system size, power, and cost in check.

The history of EM offers a more detailed telling of the language's origin story.

7 — Why should silicon vendors care about EM

While most MCU roadmaps point upwards – faster cores, more memory, advanced peripherals – the Ambient IoT space creates new opportunities for silicon vendors to take their MCUs down the "low-road", so to speak.

Many vendors also maintain a wide-range of "hidden" MCUs embedded within advanced peripherals (such as radios or accelerators) as well as within custom ASICs targeting high-volume vertical markets.

EM could benefit all of these scenarios, enabling more  MCU functionality while using less  MCU firmware.

8 — Why should universities care about EM

Birthed in academia and matured in industry, EM offers many collaborative opportunities for CS/CE departments to assume a leadership role in advancing the language and its runtime.

Faculty and students alike can learn more in Academia – say "hello world" to EM.

9 — Does EM fit within the RISC-V eco-system

The emergence of RISC-V as an open instruction-set architecture has triggered an abundance of innovation in MCU design.  While much of the focus remains on high-performance computing from the edge up to the cloud, EM could play a pivotal role in driving RISC-V "over the edge" towards the Ambient IoT fringe.

Consider our Tiny code → Tiny chips  premise as a starting point.

10 — How will EM mesh with AI / ML

Pushing intelligence from the cloud down to distributed edge devices has become standard practice; and as we move further towards Ambient IoT, we'll want to push AI / ML algorithms even closer to our input sources.

While TinyML has emerged as a standard for embedded MCUs, early prototypes integrating EM with the Meta AI Glow compiler have yielded significantly smaller runtime images for the same .tflite model input.

11 — How do I work with EM

To help flatten the learning curve, we offer EM Builder – a VS Code extension which integrates the language and its runtime into this popular IDE.  Visit Learning EM through VS Code for a quick introduction.

At the same time, we recognize the importance of having a robust command-line interface for use in automated build flows.  We've therefore exposed the em-cli command to streamline integration into your environment.

12 — What type of license covers EM

We've made all of the EM software – the language translator and its runtime components – openly and freely available under the terms of an Amended MIT License , which you can find here .

13 — Can I access the EM source code

Techincally speaking, the EM SDK ( downloaded as part of Installing EM ) already contains sources for the language translator as well as the runtime components.

Over time, you'll find all of the EM-SDK sources publically maintained on GitHub .

14 — Which MCUs does EM support

While EM has supported over twenty 8 / 16 / 32-bit MCUs from a dozen silicon vendors since inception, we've chosen the TI CC2340R5  for the public launch of EM – exemplifying a "typical" MCU targeted by the language.

Support for the ATSAMD21G18 – used in the Arduino Zero  and its many derivatives – will then follow; we also plan on targeting a comparable RISC-V MCU soon thereafter.

Choosing the next EM • MCU target hardware describes our thought process in greater detail.

15 — Can I port EM to my favorite MCU

Yes, you can – assuming you have knowledge of the MCU's architecture as well as experience writing "bare-metal" firmware for the target device.  Needless to say, you'll also have to learn a little EM !!

Porting EM will lay out a detailed process for incrementally developing an EM distro – all of the software required to support a new MCU.  Existing distros for MCUs already supported by EM will serve as exemplars.

16 — Who supports EM

The EM Foundation – a non-profit organization which promotes, sustains, and evolves EM programming technology for use within the broader embedded systems community.

The EM Foundation operates as a 501(c)(3) non-profit organization, as determined by the IRS.  Contact our COO for additional information.

17 — Does EM have any competition

Grace Murray Hopper(1) famously said,  "The most dangerous phrase [...] is:  We've always done it that way ".

  1. an early pioneer in computer science, credited for her leadership role in bring the COBOL language to fruition as well as for first coining the term "bug"

18 — How do I learn more about EM

Start with Introducing EM and go as far as you'd like – and don't worry about quickly skimming any material.  If you want to play with the language and its runtime, set your sights on Installing EM and then Using EM.

You'll find more informal discussions of this novel language in "byte-sized" posts at Blogging EM.

19 — How can I get involved in moving EM forward

learn as much as you can about the EM language and its runtime;

follow The EM Foundation on LinkedIn , tell your professional network about EM; and

don't hesitate to contact us (see below) if you'd like to engage more actively with The EM Foundation.

20 — I still have more questions about EM

once you start coding, we'll direct you to GitHub  for general comments and specific issues;

for higher-level queries about the language, use Blogging EM as your starting point;

you can always message The EM Foundation (privately) on LinkedIn ; and

if all else fails, just contact us by emailing hello@openem.org !!



Happy coding !!!   🌝   💻