News for hackers. Stuff that matters.
Re:The computers are fast, but you don't know it by p1esk on Friday June 17, 2022 @04:12AM (#31775433)
I mean TensorFlow is c++/cuda!

No. When I write Tensorflow code I write Python. I don’t care what TF does under the hood just like I don’t care that Python itself might be implemented in C. Though I got to say TF is quite ugly and not a good example of Python’s user friendliness. But that’s another topic.

Re:The computers are fast, but you don't know it by gpderetta on Friday June 17, 2022 @06:00AM (#31776093)
But as soon as you step out of the optimized path, the performance cliff is huge. Also you are forced to work in non idiomatic awkward meta-languages.
Re:The computers are fast, but you don't know it by easytiger on Friday June 17, 2022 @05:35AM (#31775958)
As long as you know python is doing little to no computational work.
Re:The computers are fast, but you don't know it by necovek on Friday June 17, 2022 @06:40AM (#31776314)
That's a known and widely publicised trait of Python.

In the early days, Python tutorial warned against adding to strings by doing "+" even though it works because that performed a new allocation and string copy.

What you were asked to do was use fast, optimized C-based primitives like "\n".join(list_of_strings) etc.

Basically, Python is an "ergonomic" language built in C. Saying how something is implemented in C at the lower level is pointless, because all of Python is.

Yes, doing loops over large data sets in Python is slow. Which is why it provides itertools (again, C-based functions) in stdlib.