News for hackers. Stuff that matters.
Re:The Python scientific stack, compiled to WebAssembly by nerdponx on Friday August 24, 2018 @08:44AM (#17834556)
What happens to all of the C code in Numpy, and the calls to external libraries like BLAS?
Re:The Python scientific stack, compiled to WebAssembly by azakai on Friday August 24, 2018 @11:09AM (#17835392)
Python C extensions like NumPy are compiled into shared libraries, and loaded using dlopen() etc. normally by the main compiled Python runtime. (The only special thing here is that all those components are compiled to WebAssembly so it can run on the Web.)
Re:The Python scientific stack, compiled to WebAssembly by Scarblac on Friday August 24, 2018 @08:57AM (#17834622)
In particular, does this mean Javascript has access to Numpy? Sounds unbelievable, but would be extremely cool.
Re:The Python scientific stack, compiled to WebAssembly by mdboom on Friday August 24, 2018 @02:43PM (#17836936)
Yep. You can "import" python objects over to the Javascript side and start using them from there. It's not as pleasant as working with Numpy in Python, of course, due to lack of operator overloading, of course.
Re:The Python scientific stack, compiled to WebAssembly by mjs2600 on Friday August 24, 2018 @09:50AM (#17834911)
C can compile to WASM, but I have no clue about external tools like BLAS. I'd assume that things like Numpy are able to work without tools like BLAS, but you might also be able to compile the essential ones to WASM as well.
Re:The Python scientific stack, compiled to WebAssembly by gh02t on Friday August 24, 2018 @10:57AM (#17835305)
NumPy can work without libraries like BLAS or LAPACK, but it will be sloooooooooow. There are C versions of those libraries however, maybe they are using those?
Re:The Python scientific stack, compiled to WebAssembly by mdboom on Friday August 24, 2018 @02:44PM (#17836949)
Yes. It uses the C implementations of BLAS and LAPACK that ship in the Numpy source tree.