text: // Functions for dealing with arrays.
  
  function newArr(n, x) {
      var arr = [];
      for(; n >= 0; --n) {
          arr.push(x);
      }
      return arr;
  }
  
  // Create all views at once; perhaps it's wasteful, but it's better than having
  // to check for the right view at each read or write.
  function newByteArr(n) {
      // Pad the thing to multiples of 8.
      var padding = 8 - n % 8;
      if(padding < 8) {
          n += padding;
      }
      var arr = {};
      var buffer = new ArrayBuffer(n);
      var views = {};
      views['i8']  = new Int8Array(buffer);
      views['i16'] = new Int16Array(buffer);
      views['i32'] = new Int32Array(buffer);
      views['w8']  = new Uint8Array(buffer);
      views['w16'] = new Uint16Array(buffer);
      views['w32'] = new Uint32Array(buffer);
      views['f32'] = new Float32Array(buffer);
      views['f64'] = new Float64Array(buffer);
      arr['b'] = buffer;
      arr['v'] = views;
      // ByteArray and Addr are the same thing, so keep an offset if we get
      // casted.
      arr['off'] = 0;
      return arr;
  }
  