You are reading a single comment by @Dutch_Peter and its replies. Click here to read the full conversation.
  • Regarding this global: may be some other ways of implementation could help. Node is JS but it is not the birth place of JS. It was the browser, and in the browser there is an implicit 'global'... where all the things 'hang of', similar as in Smalltalk, where #Smalltalk is the global.

    In a microcontroller context where resources are extremely scarce, some (software) technologies / techniques used in other contexts are not that overall beneficial. On the other hand - if developed in a simulation environment / cross-developed and then 'broken'/converted/transpiled down for the 'little cousin runtime environment - why not to use. Unfortunately, these transpilers & cie. are machines and deliver results not that easy for humans to consume... yes, I know, this already starts with source code maps... but for Espruino, they already cost the runtime code byte(s) for each of the functions.

  • Vanilla javascript should work in Typescript as well, although it can help to prevent some bugs. I like the clean one on one IDE. If you work in Typescript, you'll have to build/compile it to javascript before uploading it to an Espruino device.

    Maybe typescript uses a lot of polyfills, which would make the code bigger than vanilla javascript. Although Typescript can have its benefits. I'll doubt if it will be better for use in Espruino.

    I'm working on a StencilJS PWA-application, which works in Typescript, just like many other front-end applications. I started to convert to a typescript module, but it's a bit tricky.

    For now, I have put it in index.html and 'imported' window.Puck to use the Bluetooth connectivity.

    Regards, Peter


Avatar for Dutch_Peter @Dutch_Peter started