Proposal: Add new 'Matrix' object

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposal: Add new 'Matrix' object

Ed Saleh
Hello,

Matrices are widely used today in in Computer Science, Engineering, and AI. I am proposing a new object type of `Matrix([ []... ])` which would make working with matrices easier, easily doing operations such matrices `multiplication` and `addition`.

Thank you,

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Add new 'Matrix' object

kai zhu
@ed, general-purpose matrix-ops work poorly with malformed data like ```[1.2, null, 4.234]``` which are ubiquitous in ux-workflow programming.  my experience in javascript linear-algebra mostly devolves to writing divide-by-zero "technical-debt" that's non-reusable/application-specific.  it ends up more cost-efficient for me to write custom for-loops, with malformed-data checks embedded in them.

On 12 May 2019, at 04:50, Ed Saleh <[hidden email]> wrote:

Hello,

Matrices are widely used today in in Computer Science, Engineering, and AI. I am proposing a new object type of `Matrix([ []... ])` which would make working with matrices easier, easily doing operations such matrices `multiplication` and `addition`.

Thank you,
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Add new 'Matrix' object

J Decker
In reply to this post by Ed Saleh
 

On Sun, May 12, 2019 at 2:51 AM Ed Saleh <[hidden email]> wrote:
Hello,

Matrices are widely used today in in Computer Science, Engineering, and AI. I am proposing a new object type of `Matrix([ []... ])` which would make working with matrices easier, easily doing operations such matrices `multiplication` and `addition`.

There is a pretty good library for that...
:)  
they call them 'tensors' though.
 
Thank you,
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Add new 'Matrix' object

guest271314
In reply to this post by Ed Saleh
Is this proposal different from ```DOMMatrix()```  https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix ?

On Sun, May 12, 2019 at 9:51 AM Ed Saleh <[hidden email]> wrote:
Hello,

Matrices are widely used today in in Computer Science, Engineering, and AI. I am proposing a new object type of `Matrix([ []... ])` which would make working with matrices easier, easily doing operations such matrices `multiplication` and `addition`.

Thank you,
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Add new 'Matrix' object

kai zhu
from what i can tell 1) w3c dommatrix is application-specific to 3d visualization and 2) tfjs is application-specific to gpu-accelerated machine-learning.

the question is, is it feasible to spec a tc39 "jack-of-all-trades" linear-algebra proposal that can underpin the above two (and many other) diverse use-cases, w/o ending up being a "master-of-none".

On Sun, May 12, 2019 at 11:20 AM guest271314 <[hidden email]> wrote:
Is this proposal different from ```DOMMatrix()```  https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix ?

On Sun, May 12, 2019 at 9:51 AM Ed Saleh <[hidden email]> wrote:
Hello,

Matrices are widely used today in in Computer Science, Engineering, and AI. I am proposing a new object type of `Matrix([ []... ])` which would make working with matrices easier, easily doing operations such matrices `multiplication` and `addition`.

Thank you,
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Add new 'Matrix' object

guest271314
Neither ```DOMMatrix``` nor tensorflow functionality are exclusive to any single use case. What is the use case of the Matrix object described at this proposal?

On Sun, May 12, 2019 at 7:06 PM kai zhu <[hidden email]> wrote:
from what i can tell 1) w3c dommatrix is application-specific to 3d visualization and 2) tfjs is application-specific to gpu-accelerated machine-learning.

the question is, is it feasible to spec a tc39 "jack-of-all-trades" linear-algebra proposal that can underpin the above two (and many other) diverse use-cases, w/o ending up being a "master-of-none".

On Sun, May 12, 2019 at 11:20 AM guest271314 <[hidden email]> wrote:
Is this proposal different from ```DOMMatrix()```  https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix ?

On Sun, May 12, 2019 at 9:51 AM Ed Saleh <[hidden email]> wrote:
Hello,

Matrices are widely used today in in Computer Science, Engineering, and AI. I am proposing a new object type of `Matrix([ []... ])` which would make working with matrices easier, easily doing operations such matrices `multiplication` and `addition`.

Thank you,
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Add new 'Matrix' object

David Rajchenbach-Teller-2
According to the specs, DOMMatrix is limited to 4d matrices. They can be
used to emulate 1d-3d matrices trivially. However, many applications
(e.g. in graph theory) require arbitrary numbers of dimensions.

I'm not really familiar with Tensorflow, but if I read the API
correctly, it seems to be limited to 1d-5d tensors. If I read the API
correctly, arithmetic operations are tensor operations, rather than
matrix operations, which have very different definitions.

Cheers,
 David

On 12/05/2019 21:31, guest271314 wrote:
> Neither ```DOMMatrix``` nor tensorflow functionality are exclusive to
> any single use case. What is the use case of the Matrix object described
> at this proposal?
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Add new 'Matrix' object

kai zhu
is that a tentative "no" as in tc39 can't easily spec some low-level linear-algebra primitives that would be useful for both dommatrix, and [gpu-accelerated] tensoflow?

i do find value to industry for enhancing client-side performance of 3d visualization and ML.  and i'm starting to see @Ed's original question as whether things like this falls in the scope of javascript language-design (as a fundamental UX-workflow problem), or should remain an embedder/userland concern.

-kai

On Mon, May 13, 2019 at 3:34 AM David Teller <[hidden email]> wrote:
According to the specs, DOMMatrix is limited to 4d matrices. They can be
used to emulate 1d-3d matrices trivially. However, many applications
(e.g. in graph theory) require arbitrary numbers of dimensions.

I'm not really familiar with Tensorflow, but if I read the API
correctly, it seems to be limited to 1d-5d tensors. If I read the API
correctly, arithmetic operations are tensor operations, rather than
matrix operations, which have very different definitions.

Cheers,
 David

On 12/05/2019 21:31, guest271314 wrote:
> Neither ```DOMMatrix``` nor tensorflow functionality are exclusive to
> any single use case. What is the use case of the Matrix object described
> at this proposal?
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Add new 'Matrix' object

guest271314
A matrix could be viewed as an array of arrays or sets or maps or other values. How the values in the arrays or indexes are mapped is dependent upon the requirement. The requirement could be to map the networks of this entire planet earth; create sets of permutations; create cross word puzzles. What is the basic functionality of the Matrix described at this proposal?

On Mon, May 13, 2019 at 3:29 PM kai zhu <[hidden email]> wrote:
is that a tentative "no" as in tc39 can't easily spec some low-level linear-algebra primitives that would be useful for both dommatrix, and [gpu-accelerated] tensoflow?

i do find value to industry for enhancing client-side performance of 3d visualization and ML.  and i'm starting to see @Ed's original question as whether things like this falls in the scope of javascript language-design (as a fundamental UX-workflow problem), or should remain an embedder/userland concern.

-kai

On Mon, May 13, 2019 at 3:34 AM David Teller <[hidden email]> wrote:
According to the specs, DOMMatrix is limited to 4d matrices. They can be
used to emulate 1d-3d matrices trivially. However, many applications
(e.g. in graph theory) require arbitrary numbers of dimensions.

I'm not really familiar with Tensorflow, but if I read the API
correctly, it seems to be limited to 1d-5d tensors. If I read the API
correctly, arithmetic operations are tensor operations, rather than
matrix operations, which have very different definitions.

Cheers,
 David

On 12/05/2019 21:31, guest271314 wrote:
> Neither ```DOMMatrix``` nor tensorflow functionality are exclusive to
> any single use case. What is the use case of the Matrix object described
> at this proposal?
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Add new 'Matrix' object

kai zhu
this is wishful thinking, but i've wondered whether [wasm] sqlite3 has better potential for general-purpose multidimensional vector-operations than whatever gets spec'ed out in javascript.  probably not, but there's been research on sql "dot-product-joins" [1].

[1]  Dot-Product Join: Scalable In-Database Linear Algebra for Big Model Analytics

On Tue, May 14, 2019 at 1:24 AM guest271314 <[hidden email]> wrote:
A matrix could be viewed as an array of arrays or sets or maps or other values. How the values in the arrays or indexes are mapped is dependent upon the requirement. The requirement could be to map the networks of this entire planet earth; create sets of permutations; create cross word puzzles. What is the basic functionality of the Matrix described at this proposal?

On Mon, May 13, 2019 at 3:29 PM kai zhu <[hidden email]> wrote:
is that a tentative "no" as in tc39 can't easily spec some low-level linear-algebra primitives that would be useful for both dommatrix, and [gpu-accelerated] tensoflow?

i do find value to industry for enhancing client-side performance of 3d visualization and ML.  and i'm starting to see @Ed's original question as whether things like this falls in the scope of javascript language-design (as a fundamental UX-workflow problem), or should remain an embedder/userland concern.

-kai

On Mon, May 13, 2019 at 3:34 AM David Teller <[hidden email]> wrote:
According to the specs, DOMMatrix is limited to 4d matrices. They can be
used to emulate 1d-3d matrices trivially. However, many applications
(e.g. in graph theory) require arbitrary numbers of dimensions.

I'm not really familiar with Tensorflow, but if I read the API
correctly, it seems to be limited to 1d-5d tensors. If I read the API
correctly, arithmetic operations are tensor operations, rather than
matrix operations, which have very different definitions.

Cheers,
 David

On 12/05/2019 21:31, guest271314 wrote:
> Neither ```DOMMatrix``` nor tensorflow functionality are exclusive to
> any single use case. What is the use case of the Matrix object described
> at this proposal?
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Add new 'Matrix' object

Isiah Meadows-2
In reply to this post by Ed Saleh
Check out the old (and retracted) SIMD.js proposal that aimed to bring SIMD support to JS and the related offshoot that attempted to cover WebAssembly interop as well.


Also, WebAssembly has a proposal, spearheaded from that work with JS, to try to bring SIMD support to it. The WebAssembly proposal is considerably lower level, but has broad implementor interest.


Hardware SIMD and matrices may seem like two entirely different things, but a large area of overlap exists between small matrix math and CPU vector instructions. Those instruction sets were designed with coordinate, vector, and small matrix math in mind. For instance:

- 2x2 matrix multiplication is maybe a dozen or so SSE instructions in modern Intel x86-64 assembly.
- Scalar matrix multiplication is only a single "multiply vector by scalar" instruction.
- 2x2 discriminant is a swizzle, a multiply, clear top two lanes, and horizontal subtract

And even with larger data sets, vector instructions can and do help. (Consider BLAS.)

On Sun, May 12, 2019 at 05:51 Ed Saleh <[hidden email]> wrote:
Hello,

Matrices are widely used today in in Computer Science, Engineering, and AI. I am proposing a new object type of `Matrix([ []... ])` which would make working with matrices easier, easily doing operations such matrices `multiplication` and `addition`.

Thank you,
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
--

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss