Skip to content
forked from microsoft/pxt

Program embedded devices in a subset of TypeScript

Notifications You must be signed in to change notification settings

dominik-weber/yelm

 
 

Repository files navigation

yelm - Experimental Programming Environment for micro:bit

Build Status

Yelm combines the following:

  • a TypeScript library defining APIs available on the micro:bit
  • an ARM Thumb machine code emitter for TypeScript
  • a Blockly-based editor along with converter to TypeScript
  • a webapp hosting the Blockly-based editor and ACE-based editor for TypeScript
  • a command-line package manager

Yelm is an experimental platform for research on new ways of programming, especially focused on computer science education.

Name

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 Micro:bit-compatible devices.

Build

Building yelm command line tools:

tsd reinstall
npm install
jake

Building webapp:

cd webapp
tsd reinstall
npm install
jake
node server.js &
open http://localhost:3232

TODOs

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

web app

  • make blocks output file read only
  • do not type-check while auto-completing
  • scroll completion window with keyboard

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

Docs

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

pip install mkdocs
mkdocs serve
open http://127.0.0.1:8000

License

MIT

About

Program embedded devices in a subset of TypeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 81.7%
  • TypeScript 18.0%
  • Other 0.3%