You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Well, JavaScript is an interpreted language, rather than a compiled language. It means that no work is done 'up front' by a compiler. The way there's no type checking makes compilation quite difficult.

    On a PC, with something like Chrome and V8, it cheats - and when the webpage is loaded V8 does a lot of clever stuff and basically 'compiles' the JavaScript to native code every time a webpage is loaded. On other (often older) JS interpreters they compile the code to an intermediate form (like a bytecode).

    On Espruino there just aren't the resources to do that on the chip, so it actually executes the text strings your wrote directly - which makes it a lot slower.

    I'm actually doing some work on partially compiling the JS code up front using the Web IDE, but that's still some way off being useful.

    At the end of the day, it can still all be done, and can be done really easily using the built in Graphics class... but if you want to write your own new Graphics class then you're probably better off using something else like a Pi with node.js.

About

Avatar for Gordon @Gordon started