Paul Krill
Editor at Large

Microsoft proposes Static TypeScript for embedded systems

news
Sep 6, 20192 mins

Static TypeScript is a subset of TypeScript that runs in a web browser and compiles to ARM Thumb machine code

typewriter typescript
Credit: Mira DeShazer

Microsoft is proposing a subset of TypeScript, the company’s popular typed superset of JavaScript, and its compiler/linker toolchain for use in embedded computing. 

In a paper titled, “Static TypeScript: An Implementation of a Static Compiler for the TypeScript Language,” Microsoft researchers describe a Static TypeScript system and the challenges of implementing embedded programming platforms in the classroom. Static TypeScript is considered useful for educational purposes while amenable to static compilation for small devices.

With Static TypeScript, a program is compiled to machine code in the browser and linked against a precompiled C++ runtime to produce an executable that is more efficient than the prevalent embedded interpreter approach. Battery life is extended and devices with as little as 16KB of RAM can be supported. An alternative to embedded interpreters, Static TypeScript is the core language supported by the MakeCode Framework used to build applications for microcontroller devices.

Features of Static TypeScript include:

  • Use of nominal typing for statically declared classes and support for efficient compilation of classes via classic techniques for v-tables.
  • A toolchain that runs offline, once loaded into a browser, with no need for a C/C++ compiler. The toolchain compiles Static TypeScript to ARM Thumb machine code, for linkage against the C++ runtime in the browser.
  • Generation of compact machine code, suitable for application domains such as game programming for low-resource devices.
  • No need for app or device driver installation when deploying Static TypeScript user programs to embedded devices. Access to a browser is all that is necessary. Compiled programs appear as downloads, to be transferred manually to a device.
  • The Static TypeScript runtime uses a mark-and-sweep garbage collector.

Researchers do not intend to expand Static TypeScript to support all of TypeScript. Only features useful in the embedded context would be added, based on user feedback.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author