Question: can js call out to native libraries as well ? I'm wondering why BLAS/LAPACK is not callable from JS. there are all these questions about how to use LAPACK from js.. and none seem to work right. [1] http://stackoverflow.com/questions/21990243/use-emscripten-w... [2] https://github.com/software-engineering-amsterdam/MLitB/issu... [3] https://github.com/karpathy/convnetjs
If it needs to run in the browser you'll have to compile the libraries to JS so that all code runs in the security sandbox. With node.js, it is possible to directly call out into native code. Google has a native messaging feature which allows it to communicate with native applications but these need to have been installed traditionally.
Cheerp 1.2 – C++ to JavaScript: faster than Emscripten with dynamic memory
21–23 of 23 posts
Re: Cheerp 1.2 – C++ to JavaScript: faster than Emscripten with dynamic memory
#22Earlier quoted context omitted.
If it needs to run in the browser you'll have to compile the libraries to JS so that all code runs in the security sandbox. With node.js, it is possible to directly call out into native code. Google has a native messaging feature which allows it to communicate with native applications but these need to have been installed traditionally.
well nobody has been successful at calling out to BLAS/LAPACK from nodejs. I wonder why. is there a certain signature that the functions must expose or something ?
Re: Cheerp 1.2 – C++ to JavaScript: faster than Emscripten with dynamic memory
#23There are three relevant memory modes for Emscripten to compare with here, 1. Normal output, asm.js, no memory growth. Maximal speed, fixed memory size. 2. Memory growth. As the article mentions, asm.js no longer supports this, but Emscripten does. It just removes the 'use asm'. 3. Split memory. As the article mentions, this is non-asm.js. This supports not just growing and shrinking memory, but allocating each chunk…
Startup time: https://docs.google.com/spreadsheets/d/17fFM1YqhMV2-O0ZdymEv...
Execution time (small benchmarks): https://docs.google.com/spreadsheets/d/17fFM1YqhMV2-O0ZdymEv...
Execution time (larger benchmarks): https://docs.google.com/spreadsheets/d/17fFM1YqhMV2-O0ZdymEv...