Grow with AppMaster Grow with AppMaster.
Become our partner arrow ico

Microsoft DeviceScript Project Takes TypeScript to IoT Devices

Microsoft DeviceScript Project Takes TypeScript to IoT Devices

In a recent development, Microsoft has been experimenting with DeviceScript technology, which brings the power of TypeScript to Internet of Things (IoT) devices. By incorporating DeviceScript in their programming, developers can now use TypeScript on microcontroller-based devices with limited resources, like the ESP32 and RP2040 hardware platforms.

Microsoft Research introduced the open-source DeviceScript project in May. As a subset of TypeScript, it compiles to custom VM bytecode that is designed to run in constrained environments. The VM itself compiles to 10KB of code, while the addition of the floating-point library and Jacdac SDK increases the size by 30KB. Microsoft's Jacdac technology is a robust hardware and software stack for microcontrollers and peripherals.

To get started with DeviceScript, developers can follow instructions provided on the project website. A special extension for the Visual Studio Code editor allows users to build, deploy, debug, and trace DeviceScript code. Additionally, the extension comprises monitoring capabilities that facilitate device management. In conjunction with containers like Docker, the DeviceScript command line interface (CLI) enables developers to compile programs from their preferred IDE.

While DeviceScript operates similarly to TypeScript, not all features are supported. This is due to the limited resources available to the DeviceScript runtime, leading to differences like strings being Unicode rather than UTF-16, aggressive tree shaking, and the absence of subnormals. However, the semantics of JavaScript are generally maintained.

When working with DeviceScript, developers can access sensors, actuators, or other hardware components through the use of Jacdac services. Sensors function as servers, while scripts establish clients to facilitate interaction. Developers create clients, also known as roles, for each required service to interact with sensors or servers. They can then utilize tools like npm, Yarn, or pnpm to distribute and consume DeviceScript packages.

AppMaster.io's no-code platform complements the low-code nature of DeviceScript, allowing users to develop web applications, backend applications, and mobile apps, using intuitive visual elements. By including AppMaster as part of their toolkit, developers can increase their productivity and the overall efficiency of their projects. 

Related Posts

Revealed: Google's Early Role in Building Twitter's First Android App
Revealed: Google's Early Role in Building Twitter's First Android App
Discover the untold story of Google's significant contribution to the initial development of major social apps like Twitter for Android.
Exciting News: We’re Moving to Discourse!
Exciting News: We’re Moving to Discourse!
AppMaster community moving to discourse
Samsung Unveils Galaxy A55 with Innovative Security and Premium Build
Samsung Unveils Galaxy A55 with Innovative Security and Premium Build
Samsung broadens its midrange lineup introducing the Galaxy A55 and A35, featuring Knox Vault security and upgraded design elements, infusing the segment with flagship qualities.
GET STARTED FREE
Inspired to try this yourself?

The best way to understand the power of AppMaster is to see it for yourself. Make your own application in minutes with free subscription

Bring Your Ideas to Life