Re:Everything you need to know about Python 3.13 – JIT and G...
by fulafel on Saturday September 28, 2024 @08:14AM
(#41679754)
We don't want Python programs to become the same kind of security swiss cheese as C/C++ programs.
Re:Everything you need to know about Python 3.13 – JIT and G...
by 0xFEE1DEAD on Saturday September 28, 2024 @07:24AM
(#41679531)
Let me preface this by saying I have no source to prove what I’m about to say, but Guido van Rossum aimed to create a programming language that feels more like a natural language without being just a toy language.
He envisioned a real programming language that could be used by non-programmers, and for this to work it couldn’t contain the usual footguns.
One could argue that he succeeded, considering how many members of the scientific community, who don’t primarily see themselves as programmers, use Python.
Re:Everything you need to know about Python 3.13 – JIT and G...
by William_BB on Saturday September 28, 2024 @08:20AM
(#41679785)
All the answers were good, but I think this explained it the best. Thank you
Re:Everything you need to know about Python 3.13 – JIT and G...
by dawnofdusk on Saturday September 28, 2024 @05:10PM
(#41683034)
But the performance motivations for removing the GIL seem at odds with this. I feel like the subset of Python users who care about the GIL and the subset who are "non-programmers" are entirely disjoint.
Re:Everything you need to know about Python 3.13 – JIT and G...
by charlieyu1 on Sunday September 29, 2024 @04:36PM
(#41690241)
I guess I am one of these people and have zero idea on how to write code in parallel programming. Would GIL removal benefit me, given that it seems like it would hurt performance?
Re:Everything you need to know about Python 3.13 – JIT and G...
by Numerlor on Saturday September 28, 2024 @07:11AM
(#41679479)
There is an expectation of not dealing with data races from Python code. Apart from being a language where people expect these things to not be an issue it is also the behaviour with thw Gil in place and would be breaking
Re:Everything you need to know about Python 3.13 – JIT and G...
by tliltocatl on Saturday September 28, 2024 @07:11AM
(#41679478)
Memory safety, heap integrity and GC correctness i guess. If you ignore facts like C your language will be as safe as C, except it's worse because at least C doesn't silently rearrange your heap in background.
Re:Everything you need to know about Python 3.13 – JIT and G...
by LudwigNagasena on Saturday September 28, 2024 @07:28AM
(#41679536)
Why not just use C and C++ at that point? People use Python because they don't want to manage data races or re-implement a hash table.
Re:Everything you need to know about Python 3.13 – JIT and G...
by William_BB on Saturday September 28, 2024 @07:54AM
(#41679656)
This was not a gotcha, sorry if it came across that way. It was a genuine question
Re:Everything you need to know about Python 3.13 – JIT and G...
by oconnor663 on Saturday September 28, 2024 @11:20AM
(#41680806)
It's harder to ignore the problem in Python, because reference counting turns every read into a write, incrementing and then decrementing the recount of the object you read. For example, calling "my_mutex.lock()" has already messed with the recount on my_mutex before any locking happens. If races between threads could corrupt those refcounts, there's no way you could code around that. Right now the GIL protects those refcounts, so without a GIL you need a big change to make them all atomic.
Re:Everything you need to know about Python 3.13 – JIT and G...
by William_BB on Saturday September 28, 2024 @01:47PM
(#41681782)
Oh wow, I haven't thought about refcounts on mutexes
Re:Everything you need to know about Python 3.13 – JIT and G...
by masklinn on Saturday September 28, 2024 @11:53AM
(#41680995)
> Worst case this is a datarace [... w]hat am I missing here?
That the worst case being memory unsafety and a compromised VM is not acceptable? Especially for a language as open to low-skill developers as Python?
Re:Everything you need to know about Python 3.13 – JIT and G...
by William_BB on Saturday September 28, 2024 @01:53PM
(#41681822)
Hm I get the memory safety part, but could you elaborate on the compromised VM part? I'm not sure I understand that.. Specifically I don't understand what you mean by VM here
Re:Everything you need to know about Python 3.13 – JIT and G...
by masklinn on Sunday September 29, 2024 @04:43AM
(#41685853)
Once you compromise memory safety you have access to the entire Python runtime, there is no separation.
Re:Everything you need to know about Python 3.13 – JIT and G...
by micheles on Saturday September 28, 2024 @12:07PM
(#41681097)
I am scientific Python programmer. 99% to 100% of my programs require parallelism, but it is ALWAYS embarrassingly trivial parallelism, nothing is ever mutated and I never need locks. Right now I am forced to use multiprocessing to get the performance, with all problems of multiprocessing, the major one being that I need to use more memory. For me using multithreading could mean the difference between running out of memory and not running out memory. The GIL removal matters for people like me, the proponents of the GIL removal comes from the scientific community.
> What happens if multiple threads try to access / edit the same object at the same time? Imagine one thread is trying to add to a dict while another is trying to read from it. There are two options here
Why not just ignore this fact, like C and C++? Worst case this is a datarace, best case the programmer either puts the lock or writes a thread safe dict themselves? What am I missing here?