[IDEA]: Upgrade String - or introduce data type - to better handle binary data.

# Tim Smart (15 years ago)

With recent ECMAScript taking off outside the browser (not to point at any one implementation, but nodejs.org is an example), the handling of large arbitrary amounts of text and binary data, is becoming more and more common.

Would it be fair to make sure that future ECMAScript implementation's can handle these type of operations at a specification level, or would it boil down to preference of the VM implementer?

Just a couple of thoughts, from a user of ECMAScript outside browser-land.

# Ash Berlin (15 years ago)

On 30 Jun 2010, at 07:11, Tim Smart wrote:

With recent ECMAScript taking off outside the browser (not to point at any one implementation, but nodejs.org is an example), the handling of large arbitrary amounts of text and binary data, is becoming more and more common.

Would it be fair to make sure that future ECMAScript implementation's can handle these type of operations at a specification level, or would it boil down to preference of the VM implementer?

Just a couple of thoughts, from a user of ECMAScript outside browser-land.

This has come up before: esdiscuss/2009-November/010132

I don't recall what (if any) the outcome was, but read there first.

# Brendan Eich (15 years ago)

We're working with the WebGL folks to standardize something that can meet their needs. See

strawman:typed_arrays

and stay tuned here -- more coming soon on this subject.

# Tim Smart (15 years ago)

If you find any interest in how Node.js currently deals with binary data, it currently has a 'Buffer' object.

API documentation: nodejs.org/api.html#buffers-3 Implementation: ry/node/blob/master/src/node_buffer.cc, ry/node/blob/master/src/node_buffer.cc

ry/node/blob/master/lib/buffer.js

ry/node/blob/master/lib/buffer.jsIt does have a few

drawback in terms of cost; the call to malloc is not cheap - which makes creating new Buffer objects somewhat expensive. It does however have a nice and simple API.

Tim.

# Brendan Eich (15 years ago)

Mark Miller threw that up