Earlier quoted context omitted.
I wonder, why that kind of ambiguity or complexity even comes to your mind at all. Just because python is weird? def foo(self, arg=expression): could, and should work as if it was written like this (pseudocode) def foo(self, arg?): if is_not_given(arg): arg=expression if "expression" is a literal or a constructor, it'd be called right there and produce new object, if "expression" is a reference to an object in outer…
What you want is for an assignment in a function definition to be a lambda. def foo (self, arg=lambda : expression): Assignment of unevaluated expressions is not a thing yet in Python and would be really surprising. If you really want that, that is what you get with a lambda. > most languages with closures and default values for arguments do it this way. Do these also evaluate function definitions at runtime?
Python 3.15's JIT is now back on track
251–260 of 330 posts
Re: Python 3.15's JIT is now back on track
#252Earlier quoted context omitted.
Feel free to correct the market and make oodles of money.
Risk my money based on a bunch of wallstreetbets idiots yoloing their money using a random number generator and seeing the word AI on twitter posts, sure lol. I’ll let you play in that cesspool.
Re: Python 3.15's JIT is now back on track
#253Earlier quoted context omitted.
> python code could be so much faster if it didn't have to assume everything could change at any time Definitely, but then it wouldn't be Python. One of the core principles of Python's design is to be extremely dynamic, and that anything can change at any time. There are many other, pretty good, strictly dynamically typed languages which work just as well if not better than Python, for many purposes.
I feel that this excuse is being trotted out too much. Most engineers never get to choose the programming language used for 90% of their professional projects. And when Python is a mainstream language on top of which large, globally known websites, AI tools, core system utilities, etc are built, we should give up the purity angle and be practical. Even the new performance push in Python land is a reflection of this.…
Re: Python 3.15's JIT is now back on track
#254`from future import time_travel`
Re: Python 3.15's JIT is now back on track
#255Python really needs to take the Typescript approach of "all valid Python4 is valid Python3". And then add value types so we can have int64 etc. And allow object refs to be frozen after instantiation to avoid the indirection tax. Sensible type-annotated python code could be so much faster if it didn't have to assume everything could change at any time. Most things don't change, and if they do they change on startup (e…
Still churning on it, will probably publish it and do a proper blog post once I've built something interesting with the language itself.
Re: Python 3.15's JIT is now back on track
#256Earlier quoted context omitted.
I feel that this excuse is being trotted out too much. Most engineers never get to choose the programming language used for 90% of their professional projects. And when Python is a mainstream language on top of which large, globally known websites, AI tools, core system utilities, etc are built, we should give up the purity angle and be practical. Even the new performance push in Python land is a reflection of this.…
You’re always free to create your own Python-like language that caters more toward your goals. No excuses, then.
Re: Python 3.15's JIT is now back on track
#257Over 100% speedup sound like "the code compiled before you asked the compiler to start working". `from future import time_travel`
But I do agree that it would be a bit clearer to talk in terms of time taken rather than speedup % i.e. instead of "20% slowdown to over 100% speedup" it's clearer to say "takes between 50% and 125% of the original time". (Especially since people very often say things like "3 times faster", which technically means 4 times as fast, when they should say "3 times as fast"; "takes 1/3 of the time" is unambiguous.)
Re: Python 3.15's JIT is now back on track
#258Earlier quoted context omitted.
But that's just not what python is for. Move your performance-critical logic into a native module.
I’ll be happy if over night all Python code in the world can reap 10-100x performance benefits without changing much of a codebase, you can continue having soup of multiple languages.
Re: Python 3.15's JIT is now back on track
#259I'm been occasionally glancing at PR/issue tracker to keep up to date with things happening with the JIT, but I've never seen where the high level discussions were happening; the issues and PRs always jumped right to the gritty details. Is there anywhere a high-level introduction/example of how trace projection vs recording work and differ? Googling for the terms often returns CPython issue tracker as the first resul…
> I've never seen where the high level discussions were happening Thanks for your interest. This is something we could improve on. We were supposed to document the JIT better in 3.15, but right now we're crunching for the 3.15 release. I'll try to get to updating the docs soon if there's enough interest. PEP 744 does not document the new frontend. I wrote a somewhat high-level overview here in a previous blog post ht…
Re: Python 3.15's JIT is now back on track
#260Earlier quoted context omitted.
You’re always free to create your own Python-like language that caters more toward your goals. No excuses, then.
If you're a contributor to Python, my apologies.