Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For Python libraries that do significant computation, the actual code is often in C, C++, or Fortran with the Python part just serving to tie the libraries together.


Fortran???


If I understand correctly, numpy was (still is?) a wrapper around Fortran libraries such as linpack.


Like it or not, Fortran is a very fast and memory efficient compiled language with compilers supporting most platforms and many open source libraries written in it.

These days, it survives mostly as an authoring language for math and statistical libraries.


I was told recently to use some Math library for .net that was clearly a wrapper around a Fortran library. All method names were a 4 characters hex, I think the same for parameter names. I just refused.


That's probably a wrapper for BLAS/LAPACK. The majority of BLAS/LAPACK implementations use the original functions names as the reference implementation found on Netlib. The names are not in hex, but acronyms and short forms e.g. GEMV refers to double general matrix-vector multiplication.

What did you end up using as alternative? In C++ for example, there's a template based library (Eigen) that fuses multiple operations and gives you some speedup compared to the usual libraries, at the cost of very long compilation times. For C#, I imagine there could be some library that does the same thing in JIT instead.


It was the Nag library for .net [1]. What I really wanted to use is Extreme Optimization, but couldn't get the company to buy a license. In the end I realised I could express the problem as a linear program and used Google OR Tools and LPSolve.

[1] https://www.nag.com/numeric/dt/nagdotnet_dtw02/html/contents...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: