devicescript
devicescript copied to clipboard
TypeScript for Tiny IoT Devices (ESP32, RP2040, ...)
This should run reasonably fast, but doesn't. ```ts let s = "" for (let i = 0; i < 2000; ++i) { s += "x" } ds.assert(s.length == 2000 &&...
``` const { interval = 500 } = options || {} ```
Same APIs as node.js. We already support `Buffer.getAt`, `Buffer.setAt` that maps internally to the C runtime serialization library; but it needs a friendlier layer. sources: https://github.com/microsoft/devicescript/blob/main/packages/core/src/buffer.ts#L35
These should make the generated bytecode a little smaller. Approximate size reductions are give here for "allcompile.ts" - 68k binary with 38k of function code (and 6k of fonts). -...
I'm disabling tree-shaking of class-methods by default to reduce surprises (I just hit it when doing servers). We should add an attribute to enable it on class-by-class basis.
```ts const b = new ds.Buzzer() console.log(b.isBound) ;(b as any).isBound = true console.log(b.isBound) ``` this could should throw on the assignment
Variables don't get separate closures for each loop iteration. The compiler complains. For example: ```ts const fns: any[] = [] let glb1 = 0 for (let k of [300, 20,...
If a program runs for more than 49 days the 32 bit millisecond timers can overflow. We should most likely restart the device.
Some notes on how to implement compacting/moving GC: * [ ] in addition to marking things as `PENDING` in too deep GC mark, also have a tmp list (16 elements...