4 ms·
There is a lot of battle-tested Fortran out there. If you're for one reason or another in a situation where you have to deploy to the web platform and you need
by jabl 9y ago
There is a lot of battle-tested Fortran out there. If you're for one reason or another in a situation where you have to deploy to the web platform and you need some numerical algorithms, I can imagine it could make sense to pick some routines from netlib instead of reinventing the wheel.
- goatlover 9y agoWhy not keep the numerical code on the sever?
- jabl 9y agoHmm, I guess it depends on the application whether that's a good idea or not. Or rather, before flang + emscripten/wasm/whatever, there was no reasonable way to run Fortran in a browser; now there is. Application developers can then choose whatever is most important for their application. Disclaimer: my web dev experience predates the "modern web" with SPA's, fast javascript runtimes, html5 etc.
- goatlover 9y agoNever thought I'd live to see the day people would be talking about compiling fortran to javascript to run in a web browser. Just mind blowing.
- kardos 9y agoIf you can run the processing on the client side, then you can scale up much, much easier and provide whatever service much cheaper, or even free. Eg, you can provision fewer servers, no need to build a processing queue or load balancing setup, if the input is provided by the client then you use less bandwidth by avoiding a round trip on that, etc.
- goatlover 9y agoNot sure it makes sense for computationally expensive code to be running in the user's browser.
- kardos 9y agoCluster-scale calculations? Probably not. If we could /easily/ port FORTRAN code to JavsScript then you could do this [1] kind of thing with a lot less manual re-implementing. [1] http://physics.weber.edu/schroeder/fluids/ http://physics.weber.edu/schroeder/fluids/
- walshemj 9y agoUsing python would possibly make more sense here
- anentropic 9y agopython numeric code using numpy and the like ultimately depends on some fortran libs underneath
- marmaduke 9y agoNumpy has no Fortran whatsoever
- jabl 9y agoThe numpy.linalg module depends on LAPACK, which is Fortran. Core numpy depends on BLAS, for which both Fortran and non-Fortran implementations are available.
- marmaduke 9y agoGo to the source, it's called lapacklite and it's C code translated from Fortran https://github.com/numpy/numpy/tree/master/numpy/linalg https://github.com/numpy/numpy/tree/master/numpy/linalg
- jabl 9y agoHmm, seems you're right. Though that seems to be some fallback thing which is used if the real thing isn't found during the build. At least on Ubuntu 16.04 the lapack_lite module links against the real (Fortran) lapack library: % ldd /usr/lib/python3/dist-packages/numpy/linalg/lapack_lite.cpython-35m-x86_64-linux-gnu.so|grep -E 'lapack|fortran' liblapack.so.3 => /usr/lib/liblapack.so.3 (0x00007fb619ce7000) libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007f5ae0911000)
- marmaduke 9y agoThe style of netlib is isolated standalone routines, easy to recompile to js. Numpy would be far more complicated.