3 ms·
> I am skeptical of targeting an array language to a VM that requires a type check on every element of the array. Numpy handles this by performing all its actio
by geocar 9y ago
> I am skeptical of targeting an array language to a VM that requires a type check on every element of the array. Numpy handles this by performing all its actions in a C library independently of the CPython VM.
If arrays are implemented as binaries then you should be fine.
> For example, summing an array should invoke an action in the VM that adds together all of the elements of the array with only a single type look-up.
Erlang makes it easy to add NIF when you want sum to be a little bit faster. I think this is the last problem anyone needs to solve though, the elegance of array-language solutions is far more important than their performance. That they're also performant is how we know all other languages are wrong :)
- equalunique 9y agoWould be interesting to hear what kinds of BEAM-specific concepts would be important for a well-designed implementation. I was curious to learn more about what a "NIF" is and this was helpful towards understanding: http://erlang.org/doc/tutorial/nif.html http://erlang.org/doc/tutorial/nif.html Also I found this which shows there are many examples where NIFs extend what Erlang can do: http://beam-wisdoms.clau.se/en/latest/interfacing.html http://beam-wisdoms.clau.se/en/latest/interfacing.html