On Tue, Apr 28, 2015 at 12:21 PM, Nick Wellnhofer <[email protected]> wrote:

> Ultimately, I'd like to have something that can also be used for arrays of
> other number types. Maybe with an API similar to JavaScript's TypedArray or
> DataView:
>
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays
>
> But with a clear distinction between immutable and mutable objects and the
> ability to append data.

I can see the use case here.   If we add `Set_I32` and `Get_I32` to ByteBuf,
we could use it to replace Lucy's I32Array.

For the time being, I think that the Clownfish core runtime only needs to
provide enough data types to support JSON: String, Hash, Vector, Integer,
Float, Bool, and NULL.  We do need Blob/ByteBuf to hold arbitrary binary data
(such as packed, undecoded JSON!) and for technical reasons we need iterators
on at least String and Hash.

IMO, for anything beyond that it would be best to experiment outside the core,
where the type can have a chance to evolve and mature.  The smaller and
simpler the Clownfish core, the easier it is to add support for more
languages, which is where we are currently have the most profound need.

So if you want to experiment with a data structure along the lines of
TypedArray or DataView, perhaps a good place would be within Lucy as a private
type replacing I32Array.

Marvin Humphrey

Reply via email to