> Even in optimised code, there were temporary objects and copies all over the place, and they were very hard to eliminate without resorting to using global arrays everywhere.
Could you elaborate a bit with some examples, because this goes against everything I understand about the strengths of the language: (without having used it beyond a few first examples myself)
- you can define types and operations on them down to the bits themselves, giving you a lot of control over the memory (and definitely a lot more than Python)
- it has a lot of support for in-place mutation out of the box
- globals are almost always bad news for performance
Sure, adding two arrays with
C = A + B
.. produces an intermediate array, yes, but if you know A and B are not reused, wouldn't using:
Could you elaborate a bit with some examples, because this goes against everything I understand about the strengths of the language: (without having used it beyond a few first examples myself)
- you can define types and operations on them down to the bits themselves, giving you a lot of control over the memory (and definitely a lot more than Python)
- it has a lot of support for in-place mutation out of the box
- globals are almost always bad news for performance
Sure, adding two arrays with
.. produces an intermediate array, yes, but if you know A and B are not reused, wouldn't using: .. instead be enough?