Re: Proposal: Add new 'Matrix' object

2019-05-15 Thread Isiah Meadows
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.

https://github.com/tc39/ecmascript_simd
https://github.com/stoklund/portable-simd/blob/master/README.md

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.

https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md

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  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
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-- 
-

Isiah Meadows
cont...@isiahmeadows.com
www.isiahmeadows.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Add new 'Matrix' object

2019-05-14 Thread 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
http://faculty.ucmerced.edu/frusu/Papers/Conference/2017-ssdbm-dot-product-join.pdf


On Tue, May 14, 2019 at 1:24 AM guest271314  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  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  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
>>> es-discuss@mozilla.org
>>> https://mail.mozilla.org/listinfo/es-discuss
>>>
>> ___
>> es-discuss mailing list
>> es-discuss@mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Add new 'Matrix' object

2019-05-14 Thread 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  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  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
>> es-discuss@mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Add new 'Matrix' object

2019-05-13 Thread 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  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
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Add new 'Matrix' object

2019-05-13 Thread David Teller
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
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Add new 'Matrix' object

2019-05-12 Thread 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  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 
> 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  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
>>> es-discuss@mozilla.org
>>> https://mail.mozilla.org/listinfo/es-discuss
>>>
>> ___
>> es-discuss mailing list
>> es-discuss@mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Add new 'Matrix' object

2019-05-12 Thread 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  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  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
>> es-discuss@mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Add new 'Matrix' object

2019-05-12 Thread guest271314
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  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
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Add new 'Matrix' object

2019-05-12 Thread J Decker
On Sun, May 12, 2019 at 2:51 AM Ed Saleh  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...
https://js.tensorflow.org/api/latest/#Operations-Arithmetic
:)
they call them 'tensors' though.


> Thank you,
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Add new 'Matrix' object

2019-05-12 Thread 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  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
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss