• Yes - flat strings are used for Typed Arrays, and store data with just a single 16 byte var at the start as overhead. They take a bit longer to allocate though as Espruino has to search through to find a contiguous block of variables - and you can't guarantee that it will.

    There's an issue open for using them to store function code - but we probably don't want to do it when we're creating functions inside functions as that might be too slow.

    I'd really like to avoid 're-packing' the data that's in RAM if at all possible - it just sounds like a recipe for disaster.

  • Are modules stored as flat strings? They probably should be...

    Maybe something like the "compiled"?

    function (x) {
    "flat";
    ...
    }

About

Avatar for DrAzzy @DrAzzy started