News for hackers. Stuff that matters.
Re:Write Python inline in your Rust code by m-ou-se on Tuesday April 23, 2019 @01:49PM (#19731041)
In Python, all data (even simple integers) are all allocated on the heap. ToPyObject makes a deep copy of everything, converting everything to `PyObject` on the heap, so all data is owned.

The numpy crate helps if you need to convert large arrays to Python, as numpy does not store every element separately on the heap.

Re:Write Python inline in your Rust code by maccard on Tuesday April 23, 2019 @07:10PM (#19733935)
> In Python, all data (even simple integers) are all allocated on the heap.

Total sidebar, this leads to one of my favourite programming language "quirks" - you can redefine the value of 1! http://hforsten.com/redefining-the-number-2-in-python.html