4 ms·
python has a large ecosystem of scientific, mathematical, and machine learning libraries. there is no real replacement for that in the js world.
by zem 4y ago
python has a large ecosystem of scientific, mathematical, and machine learning libraries. there is no real replacement for that in the js world.
- brrrrrm 4y agoDo you think this will start to change? I often see posts on this site bemoaning the performance of Python (often referencing the order of magnitude performance differences of similarly dynamic languages like JavaScript). I'm hopeful that honest efforts to port over useful bits of the scientific/mathematical ecosystem to JS will start to take off someday soon.
- pjmlp 4y agoOther than the fact those libraries aren't written in Python, they are only bindings to native code libraries that can be used from any language with FFI.
- qsort 4y agoIt's massive work to reimplement say, Numpy and Pandas in javascript, in part because the language is different, and in part because the API is huge. It's technically possible, but not something that's available right now (nor there seems to be any real interest/serious effort going on). It's more likely that something like Julia ends up replacing Python, even though I still believe it's a low probability thing.
- brrrrrm 4y agoMore work than JIT compiling Python?
- qsort 4y agoThere's over 200k loc of Python in numpy alone, so yeah, it's the same order of magnitude of work to end up with a credible alternative.
- brrrrrm 4y agohmm, there's 1.6M lines of C++ in V8. And that's not a collection of simple mathematical functions - it's an entire compiler with many interdependent components. I think there's this weird but popular idea that people think it's easier to build a fast language than port a couple hundred independent functions.
- cdavid 4y agoThis is a common trope that does not really match reality. Pytorch readme quote pytorch is not a Python binding into a monolithic C++ framework. It is built to be deeply integrated into Python. could be applied to many key libraries of this ecosystem. For sure, a lot of those libraries rely on tons of compiled code in C/C++/Fortran, but the python code is not mere wrapping on top of those libs. And most of the compiled code inside those repos has a lot of internal logic as well. Some examples (using cloc on git main branch, as tokei does not understand cython): * sklearn: 150 kloc python, ~10kloc cython, not much of other languages * NumPy: 200kloc python, 350kloc for C/C++ * scipy: 800 kloc C, 200 kloc python (the 800kloc surprised me and it looks like a lot of it is C generated code from cython)
- pjmlp 4y agoPyTorch might be the exception, except not quite, as proven by the bindings selection on the website, where C++ and Java are also an option.
- cdavid 4y agoBut pytorch is not an exception. Scikit learn, scikit images, statsmodels, matplotlib are not mostly implemented in compiled languages.