Hacker News new | ask | show | jobs
by dagw 3017 days ago
I assume you're talking about in the web browser/pure js? Because otherwise you can just bind to the native CUDA etc. libraries like most other languages do.

And even on the browser side SIMD is being implemented in WebAssembly and (limited) GPGPU will be possible via WebGL 2.0 compute shaders. So as such I don't see any reason why JavaScript couldn't at the very least match python/numpy in performance if someone put their mind to it.

1 comments

About 5 years ago, SIMD.js has been announced, was implemented and then scrapped in favor of SIMD in WebAssembly, which does not exist until today. It has been announced, but I would not hold my breath for it. Presumably we'll only get 128-bit wide SIMD anyway, so another 2x to 4x waste of computing power there.

Additionally, 4 years ago, WebCL was announced and implemented in some browsers, but then it was scrapped in favor of compute shaders in WebGL 2.0. When WebGL 2.0 finally arrived, it did not have compute shaders. Instead, they have been delayed to be implemented as an extension at some indefinite point in the future.

Sorry if this sounds a bit grumpy, but I have been disappointed too often to be enthusiastic about this.

There are also issues like floating point rounding modes in JS and floating point precision in WebGL that have to be addressed. Should not be too hard, but who knows.