From 62f334173f2c41f0fd40e2e3c9a3d94013a9bca2 Mon Sep 17 00:00:00 2001 From: Tobias Wrigstad Date: Thu, 20 Mar 2025 13:04:29 +0100 Subject: [PATCH 1/2] Summit pitch --- summit-pitch.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 summit-pitch.md diff --git a/summit-pitch.md b/summit-pitch.md new file mode 100644 index 00000000000..a5ee33a8f74 --- /dev/null +++ b/summit-pitch.md @@ -0,0 +1,26 @@ +# Summit pitch + +Questions: who shall be the person that pitches? + +## Title +*The title of your talk/discussion topic. This will appear in the Language Summit schedule on the conference website.* + +Deep Immutability for Python + + +## Key discussion item +*What is the "thing" you want to discuss in front of mostly Python core developers? What decision to be made? What are your questions, and proposed solutions? This should fit in 10 minutes, to allow for 20 minutes of discussion. Therefore this should be very focused. This field will only be read by Language Summit co-chairs to determine the talk acceptance. You can include a rough outline, useful links, sample discussions, etc.* + +I want to discuss a PEP for adding deep immutability to Python outlined in this PEP: XXX. +The key motivation for deep immutability is concurrency safety. + +A builtin function makes an object -- and all objects it references -- immutable. This notably includes the object's class (and its super classes) but not reference counts. Certain aspects of immutability in Python is rather involved: how to handle functions that capture references to enclosing scopes; how to support subclassing of immutable class objects, etc. There is not a single "right design" so we wish to discuss some of the design decisions and issues and get feedback from the core developers. + + +## The public pitch +*This will be shown in the Language Summit schedule on the conference website and published ahead of the event. Write one or two short paragraphs to pitch this topic to the attendees. This is your chance to encourage people to discuss the topic with you!* + +Python's continuing evolution to a multi-threaded language stresses the need for safe sharing of data. The ability to construct immutable object graphs permits such safe sharing, gives strong guarantees against unintended modifications, simplifies correctness, security, and opens up for optimisations of memory management, object layout, etc. + +While immutable data is very useful on its own, it forms the basis of several extensions including support for sharing immutable data between subinterpreters and threads (with and without GIL), and clever ways to manage immutable cyclic data structures just using reference counting. + From 023fb833ce9fea7a1fcd26a223eb4c7118def452 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Mon, 24 Mar 2025 11:33:47 +0000 Subject: [PATCH 2/2] Alternative. --- summit-pitch.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/summit-pitch.md b/summit-pitch.md index a5ee33a8f74..5a89a714528 100644 --- a/summit-pitch.md +++ b/summit-pitch.md @@ -5,22 +5,33 @@ Questions: who shall be the person that pitches? ## Title *The title of your talk/discussion topic. This will appear in the Language Summit schedule on the conference website.* -Deep Immutability for Python +Fearless Concurrency in Python ## Key discussion item -*What is the "thing" you want to discuss in front of mostly Python core developers? What decision to be made? What are your questions, and proposed solutions? This should fit in 10 minutes, to allow for 20 minutes of discussion. Therefore this should be very focused. This field will only be read by Language Summit co-chairs to determine the talk acceptance. You can include a rough outline, useful links, sample discussions, etc.* -I want to discuss a PEP for adding deep immutability to Python outlined in this PEP: XXX. -The key motivation for deep immutability is concurrency safety. +> *What is the "thing" you want to discuss in front of mostly Python core developers? What decision to be made? What are your questions, and proposed solutions? This should fit in 10 minutes, to allow for 20 minutes of discussion. Therefore this should be very focused. This field will only be read by Language Summit co-chairs to determine the talk acceptance. You can include a rough outline, useful links, sample discussions, etc.* -A builtin function makes an object -- and all objects it references -- immutable. This notably includes the object's class (and its super classes) but not reference counts. Certain aspects of immutability in Python is rather involved: how to handle functions that capture references to enclosing scopes; how to support subclassing of immutable class objects, etc. There is not a single "right design" so we wish to discuss some of the design decisions and issues and get feedback from the core developers. + +We want to discuss a dynamically checked concurrency/ownership model for Python. +The concurrency model is based on "regions" and "deep immutability", and allows existing Python data structures to be used in multi-threaded programs. + +The presentation will be based on the ideas presented in the PLDI'25 paper (link to be added) +and prototyping work done on a fork of the CPyton interpreter. + +The aim of the presentation is to get feedback on the ideas, and to discuss the implications of the model for Python. +Getting something like this into Python would be a big change, and we want to discuss this with the core developers. +We will also discuss how the model can be implemented in CPython, and what changes would be needed to the language and runtime to support it. ## The public pitch *This will be shown in the Language Summit schedule on the conference website and published ahead of the event. Write one or two short paragraphs to pitch this topic to the attendees. This is your chance to encourage people to discuss the topic with you!* -Python's continuing evolution to a multi-threaded language stresses the need for safe sharing of data. The ability to construct immutable object graphs permits such safe sharing, gives strong guarantees against unintended modifications, simplifies correctness, security, and opens up for optimisations of memory management, object layout, etc. +With the move to free threaded Python, the challenges of concurrency are coming to Python developers. +The race conditions that are common in concurrent programming are hard to debug, and requiring different tooling to is commonly used in Python. +We believe there is an opportunity to build a new concurrency model for Python based on "regions" and "deep immutability". +The goal is to provide a model that is easy to use and flexible, so existing Python programs can be easily ported to multi-threading. +The model allows for safe sharing of data between threads (in free threaded Python) and sub-interpreters. -While immutable data is very useful on its own, it forms the basis of several extensions including support for sharing immutable data between subinterpreters and threads (with and without GIL), and clever ways to manage immutable cyclic data structures just using reference counting. +The presentation will be based on the ideas presented in the PLDI'25 paper: (link to be added).