Earlier quoted context omitted.
I worked on Python almost exclusively for maybe five years. Then I tried go. Each time I wrote a go program, I am giddy with excitement at how fast my first attempt is, scaling so smoothly with the number of cores. I also wrote a lot of fairly performant C in the 90s, so I know what computers can do in a second. I still use Python for cases when dev time is more important than execution time (which is rarer now that…
You should try Nim, it's Python like but compiled so it's as far as C. These days if I want to script something (and don't need Python specific libraries like pandas) I use Nim.
Python 3.11 vs 3.10 performance
321–330 of 460 posts
Re: Python 3.11 vs 3.10 performance
#322Earlier quoted context omitted.
You should try Nim, it's Python like but compiled so it's as far as C. These days if I want to script something (and don't need Python specific libraries like pandas) I use Nim.
He's already using Go. Does Nim provide any "killer features" that Go doesn't?
Re: Python 3.11 vs 3.10 performance
#323Re: Python 3.11 vs 3.10 performance
#324Earlier quoted context omitted.
This is the first time I ever heard someone complain about Python's error messages in the 10+ years I've been using it. Even people who just learned it, pick up reading tracebacks after about a day of practice. The only problem I ever see is if a library swallows too much, and gives a generic error, but that's not something the language can fix. I really hope they don't change things too much.
I only rarely delve into the python world, but as a .net developer I always found it odd and confusing that the error message comes after the stack trace in python. I don’t see people complaining about it, so maybe it’s just a matter of habit?
But: it's kind of a virtue that the most important error message comes last. Far too many (ahead of time) compilers output too many errors. The most likely error to matter is the first one, but it is often scrolled way off screen; the following errors might even just be side effects that mislead or confuse the new users.
Re: Python 3.11 vs 3.10 performance
#325Earlier quoted context omitted.
In a way it's a nice incentive not to nest too much (I have that tendency too)
Hold my beer! https://i.redd.it/8waggyjyyle51.png
[x for stop in range(5) for x in range(stop)]Re: Python 3.11 vs 3.10 performance
#326Earlier quoted context omitted.
I use it for scripting mainly when I don't need Python specific libraries like pandas. The tooling is pretty good as well.
Seems like just going with bash would be more straightforward?
Re: Python 3.11 vs 3.10 performance
#327Earlier quoted context omitted.
You certainly can accept that slowdown if the total program run-time remains within acceptable limits and the use of a rapid prototyping language reduces development time. There are times when doing computationally heavy, long-running processes where speed is important, but if the 1000x speedup is not noticeable to the user than is it really a good use of development time to convert that to a more optimized language?…
I would note that the choice of programming language is a bit different. Projects are pretty much locked into that choice. You've got to decide upfront whether the trade off in a rapid prototyping language is good or not, not wait until you've written the project and then profile it.
But, they aren't.
I mean, profile, identify critical components, and rewrite in C (or some other low-level language) for performance is a normal thing for most scripting languages.
> You've got to decide upfront whether the trade off in a rapid prototyping language is good or not, not wait until you've written the project and then profile it.
No, you absolutely don't.
Re: Python 3.11 vs 3.10 performance
#328Re: Python 3.11 vs 3.10 performance
#329Yesterday, I watched Emery Berger’s “Python performance matters” Which is you should not bother to write fast Python, just delegate all heavy lifting to optimized C/c++ and the likes. His group has a Python profiler whose main goal is to point out which parts should be delegated. Of course optimized is better but the numeric microbenchmarks in this post are mostly examples of code that is better delegated to low over…
> you should not bother to write fast Python, just delegate all heavy lifting to optimized C/c++ and the likes Certainly that's something you can do, but unfortunately for Python it opens the door for languages like Julia, which are trying to say that you can have your cake and eat it too.
Re: Python 3.11 vs 3.10 performance
#330Earlier quoted context omitted.
Getting rid of the GIL will also immediately expose all the not-thread-safe stuff that currently exists, so there's a couple of waves you would need before it would be broadly usable.
Cool, they should start now. As a python dev, pythons multiprocess/multithreading story is one the largest pain points in the language. Single threaded performance is not that useful while processors have been growing sideways for 10 years. I often look at elixir with jealousy.