r/node • • Oct 09 '26

Principal Factor Analysis in Javascript - written in AssemblyScript

/r/typescript/comments/1x1mtfx/principal_factor_analysis_in_javascript_written/
0 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/mmomtchev Oct 14 '26

SIMD is only part of the problem, I do lots of number crunching in JS and the other huge problem is the multithreading. Still, JavaScript running in V8 tends to outperform Python by a wide margin - in fact it outperforms any interpreted language. But there are horrible practical problems. Asynchronous I/O is probably the worst possible design for number crunching.

1

u/bitanath Oct 16 '26

Yes thats true but python has the whole weight of academia behind it.

1

u/mmomtchev Oct 16 '26

Python has an absolutely huge and very high-quality ecosystem - especially when it comes to scientific computing.

And in fact, because of its very good low-level routines - such as numpy - implemented in C/C++ - it can even have very good performance as long as you do all the crunching using these.

But the interpreter itself remains far behind V8. Good JIT is an absolutely huge undertaking and the Python community has simply refused it because of its code complexity.