Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


    yelm - Experimental Programming Environment for micro:bit

    Build Status

    Yelm is a platform for creating special-purpose programming experiences for beginners, especially focused on computer science education. Yelm underlaying programming language is a subset of TypeScript (leaving out JavaScript dynamic features).

    The main features of Yelm are:

    • a Blockly-based code editor along with converter to the text format
    • an ACE-based text editor with enhanced, robust auto-completion and auto-correction
    • a TypeScript library defining APIs available on microbit devices
    • an ARM Thumb machine code emitter
    • a command-line package manager


    Yelm is a city near Mt Rainier in Washington State with a name short enough for command line tool. It also stands for Your Experimental programming Language environment for microbit-compatible devices.


    Building yelm command line tools:

    tsd reinstall
    npm install

    Then install the yelm command line tool (only need to do it once):

    npm install -g yelm-cli

    After this you can run yelm from anywhere within the build tree.

    To start the local web app server do yelm serve within the root directory of build tree (where this file sits) and then browse to http://localhost:3232


    package mgr + compiler

    • image literals
    • code in top-level scope
    • only compile what's needed
    • don't emit unused global vars
    • testFiles: [ ... ] in yelm.json
    • class methods
    • class field initializers (?)
    • constructors
    • disallow direct references to class members (cannot copy JS semantics)
    • optional arguments
    • default arguments
    • +=, -= etc
    • proper caching for x.f++, x.f += ... etc
    • lambdas returning values (maybe just works?)
    • clear variables when they get out of scope to limit memory usage
    • function f() {...}; control.inBackground(f) in local scope
    • function f() {...}; control.inBackground(f) in global scope
    • //% shim=... weight=... help=... etc insteaf of {shim:...}
    • bit operators (&, |, etc)
    • inline assembly
    • use "(x + y) | 0" etc instead of "x + y" in simulator
    • do not generate empty action bodies for shim
    • check on compiler performance (1000ms on lang-test0)
    • forever() seems to have issues
    • skip unreferenced globals when initilized with literal
    • do not DECR no-closure functions
    • after uninstall pouch db throws 404 after reload
    • ptr-<username>-* as the main way publishing packages
    • in simulator currResume start loop() in nextTick
    • foo${bar}baz
    • x ? a : b

    web app

    • make blocks output file read only
    • do not type-check while auto-completing
    • scroll completion window with keyboard
    • indent when entering first character on a line
    • save source in hex
    • Save json
    • Drag and drop load
    • Link up simulator
    • Flag to hide from TS auto completion (eg: set sprite property with enum)
    • add markdown processor for docs
    • help for specific arguments
    • stepping debugger
    • attaching runtime warning to specific lines of code or block

    converter from TD to TS (different repo)

    • multi-line strings into backtick literals
    • use bit operators for bits.XYZ
    • fish out {shim:...} and friends
    • {hints:...} -> @param x Blah, eg: 100, 200 (?)
    • async is flipped
    • use expr as Type not <Type> expr


    We use mkdocs to generate the docs under the /docs folder. To setup mkdocs,

    pip install mkdocs
    mkdocs serve




    npm i yelm

    Downloadsweekly downloads








    last publish


    • avatar