Hey Madlios,
You aren't missing anything—native TypedArray constructors (like Float32Array, Int32Array, etc.) are not currently exposed directly in the Horizon Worlds TypeScript environment. This is a known limitation of the current scripting sandbox, which is why DataView is the only "official" way to interact with an ArrayBuffer right now.
Regarding performance:
- DataView vs. TypedArray: You are correct that DataView is generally slower for high-frequency access because every read/write involves a function call (e.g., getFloat32()) rather than a direct memory offset access. In standard JS engines (like V8), this gap has closed, but in the specific constraints used here, that overhead can still be significant.
- Alternative: If DataView is proving too slow you might actually find better raw performance using standard number[] arrays. While they use more memory (doubles) and lack the cache locality of a true binary buffer, the access speed ( arr[i] ) can sometimes beat the function-call overhead of DataView in these sandboxed environments.
Hopefully, they add full TypedArray support for those of us doing heavy data manipulation!"