Hacker News new | ask | show | jobs
by micmus 2587 days ago
Given that NumPy is implemented in C and only with bindings to Python, you can do exactly the same on the BEAM and indeed it exists (though not widely used): https://github.com/versilov/matrex
2 comments

I'm using Matrex on some embedded devices, it performs plenty well enough for the task. The (micro) benchmarks for Matrex are intriguing. They appear to show Matrex being faster than NumPY for common matrix tasks. It's not improbable considering BEAM in general appears faster than CPython and erlang nif FFI is simpler than CPYTHON'S which may translate to quicker FFI calls. Of course that's mostly speculative, but at least Elixir/Erlang can be on par with Python in matrix maths.
Wow, I did not know about Matrex and was looking for something that would give me the best of both worlds... very cool