The capabilities of the language itself are growing with each version.
It's not that the first version of JavaScript would not be appropriate
for today's web applications, but since we identify regular patterns in
a language, we are able to add more layers of abstraction. But not only
syntactic features can be abstracted to describe what the programmer
wants with as little code as possible to give the engines more room for
optimization, also the standard library should get extended. And I mean,
it gets extended quite a lot - so tensors could be just one of these
additions.
The link of J Decker is a good starting reference
https://github.com/yiransheng/tensor-ops-js
It's not hard to use the features of JavaScript to implement a library
like this. The hard part is to make an API like this as fast as possible
to meet future demands for web applications. And this is the purpose of
a standard library: 1) Providing regular functionalities without the
need of external dependencies (e.g. libraries) and 2) Making them as
fast and accurate as possible on a given machine.
And I think all these points make tensors a good fit for Web Assembly.
Robert
Am 28.01.18 um 15:08 schrieb Michał Wadas:
Why should be it included in standard library?
Are there widely used libraries providing similar capabilities?
Why is it preferable to implementing tensor operations in Web Assembly?
On 27 Jan 2018 2:50 am, "Robert Eisele" <rob...@xarg.org
<mailto:rob...@xarg.org>> wrote:
Hello,
Allocating multi-dimensional arrays in Javascript is only possible
by building each dimension individually. In addition to being a
very tedious job, a developer has no control over memory usage,
which in general is likely to be very high.
Seeing an array algebraically as a vector, typed arrays have
already created the ability to work more efficiently and
memory-consciously with lists of numbers. A natural extension of
this is not just a matrix, but a tensor.
I would like to suggest tensors as a native language construct in
ES. This would have the advantage that developers could write
highly parallelizable code independently of WebGL. As an API one
could introduce the following classes in analogy to typed arrays:
- IntXTensor
- UintXTensor
- FloatXTensor
Where X is one of {8, 16, 32, 64}. To make these tensor objects
really effective, it is necessary to introduce meaningful
operations, maybe similar to the features of TensorFlow. I think
by introducing tensors in the browser (but also node.js), a wide
range of new applications open up. For example, working with deep
learning right in the browser or calculating filters on images
without having to write shaders for them.
The most important thing probably is having a way of storing high
dimensional data in the browser without worrying about the memory
footprint, even for complex applications.
What do you think about it?
Robert Eisele
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org <mailto:es-discuss@mozilla.org>
https://mail.mozilla.org/listinfo/es-discuss
<https://mail.mozilla.org/listinfo/es-discuss>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss