Making The Case For A (Semi) Formal Specification Of CPython

The Python Podcast.__init__

Episode | Podcast

Date: Mon, 09 Nov 2020 22:00:00 -0500

<div class="wp-block-jetpack-markdown"><h3>Summary</h3> <p>The CPython implementation has grown and evolved significantly over the past ~25 years. In that time there have been many other projects to create compatible runtimes for your Python code. One of the challenges for these other projects is the lack of a fully documented specification of how and why everything works the way that it does. In the most recent Python language summit Mark Shannon proposed implementing a formal specification for CPython, and in this episode he shares his reasoning for why that would be helpful and what is involved in making it a reality.</p> <h3>Announcements</h3> <ul> <li>Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.</li> <li>When you&#8217;re ready to launch your next app or want to try a project you hear about on the show, you&#8217;ll need somewhere to deploy it, so take a look at our friends over at Linode. With the launch of their managed Kubernetes platform it&#8217;s easy to get started with the next generation of deployment and scaling, powered by the battle tested Linode platform, including simple pricing, node balancers, 40Gbit networking, dedicated CPU and GPU instances, and worldwide data centers. Go to <a href="https://www.pythonpodcast.com/linode?utm_source=rss&amp;utm_medium=rss">pythonpodcast.com/linode</a> and get a $100 credit to try out a Kubernetes cluster of your own. And don&#8217;t forget to thank them for their continued support of this show!</li> <li>Do you want to get better at Python? Now is an excellent time to take an online course. Whether you&#8217;re just learning Python or you&#8217;re looking for deep dives on topics like APIs, memory mangement, async and await, and more, our friends at Talk Python Training have a top-notch course for you. If you&#8217;re just getting started, be sure to check out the Python for Absolute Beginners course. It&#8217;s like the first year of computer science that you never took compressed into 10 fun hours of Python coding and problem solving. Go to <a href="https://www.pythonpodcast.com/talkpython?utm_source=rss&amp;utm_medium=rss">pythonpodcast.com/talkpython</a> today and get 10% off the course that will help you find your next level. That&#8217;s <a href="https://www.pythonpodcast.com/talkpython?utm_source=rss&amp;utm_medium=rss">pythonpodcast.com/talkpython</a>, and don&#8217;t forget to thank them for supporting the show.</li> <li>Your host as usual is Tobias Macey and today I&#8217;m interviewing Mark Shannon about his efforts to create a formal specification for the CPython interpreter</li> </ul> <h3>Interview</h3> <ul> <li>Introductions</li> <li>How did you get introduced to Python?</li> <li>Can you start by describing the current state of how the Python language and the CPython runtime are defined?</li> <li>What is your motivation in advocating for a specification? <ul> <li>After ~25 years of the language, why is now the time to pursue this effort?</li> <li>How does the history of the language and the scope of the ecosystem and community impact the effort required to make this a reality?</li> </ul> </li> <li>What is involved in creating the specification and where would it be located once complete? <ul> <li>What are some examples of languages that are formally specified?</li> </ul> </li> <li>What are the possible benefits of creating a specification for the CPython virtual machine? <ul> <li>What is the distinction between a specification for the VM as opposed to a specification for the language?</li> </ul> </li> <li>What are some potential downsides to having a (semi-)formal specification become part of the definition of the interpreter?</li> <li>Can you describe the process of doing the work to create the specification?</li> <li>How are you approaching the actual definition of the specification (e.g. prose vs programmatic)? <ul> <li>What are the tradeoffs of prose vs. an executable specification (e.g. TLA+, Alloy)?</li> </ul> </li> <li>How does this work tie into your goals of improving the speed of the CPython interpreter?</li> <li>What are some of the most interesting, unexpected, or challenging aspects of your efforts to bring this specification to CPython?</li> <li>How can the community contribute to this effort?</li> </ul> <h3>Keep In Touch</h3> <ul> <li><a href="https://github.com/markshannon?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">markshannon</a> on GitHub</li> <li><a href="https://sites.google.com/site/makingcpythonfast/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Website</a></li> </ul> <h3>Picks</h3> <ul> <li>Tobias <ul> <li>American Gods <a href="https://www.neilgaiman.com/works/Books/American+Gods/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">book</a> and <a href="https://www.imdb.com/title/tt1898069/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">TV series</a></li> </ul> </li> <li>Mark <ul> <li><a href="https://en.wikipedia.org/wiki/Roadside_Picnic?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Roadside Picnic</a></li> <li><a href="https://www.oculus.com/experiences/quest/2334376869949242/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">In Death (VR game)</a> &#8211;<a href="https://store.steampowered.com/app/605450/In_Death/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">On Steam</a></li> </ul> </li> </ul> <h3>Closing Announcements</h3> <ul> <li>Thank you for listening! Don&#8217;t forget to check out our other show, the <a href="https://feeds.fireside.fm/pythonpodcast/rss">Data Engineering Podcast</a> for the latest on modern data management.</li> <li>Visit the <a href="https://www.pythonpodcast.com?utm_source=rss&amp;utm_medium=rss">site</a> to subscribe to the show, sign up for the mailing list, and read the show notes.</li> <li>If you&#8217;ve learned something or tried out a project from the show then tell us about it! Email <a href="mailto:hosts@podcastinit.com">hosts@podcastinit.com</a>) with your story.</li> <li>To help other people find the show please leave a review on <a href="https://itunes.apple.com/us/podcast/podcast.-init/id981834425?mt=2&amp;uo=6&amp;at=&amp;ct=&amp;utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">iTunes</a> and tell your friends and co-workers</li> <li>Join the community in the new Zulip chat workspace at <a href="https://www.pythonpodcast.com/chat?utm_source=rss&amp;utm_medium=rss">pythonpodcast.com/chat</a></li> </ul> <h3>Links</h3> <ul> <li><a href="https://en.wikipedia.org/wiki/CPython?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">CPython</a></li> <li><a href="https://www.pypy.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">PyPy</a></li> <li><a href="https://www.python.org/dev/peps/pep-0380/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">PEP 380</a> yield from</li> <li><a href="https://us.pycon.org/2020/events/languagesummit/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Language Summit</a></li> <li><a href="https://rustpython.github.io/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">RustPython</a></li> <li><a href="https://www.jython.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Jython</a></li> <li><a href="https://en.wikipedia.org/wiki/C%2B%2B?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">C++</a></li> <li><a href="https://en.wikipedia.org/wiki/ML_(programming_language)?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">ML</a> programming language</li> <li><a href="https://en.wikipedia.org/wiki/Java_(programming_language)?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Java</a></li> <li><a href="https://github.com/markshannon/python_formal_semantics?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Python Formal Semantics git repository</a></li> <li><a href="https://www.pythonpodcast.com/cpython-parser-replacement-episode-285/?utm_source=rss&amp;utm_medium=rss">CPython PEG Parser Episode</a> with Pablo Galindo and Lysandros Nikolaou</li> <li><a href="https://www.ietf.org/standards/rfcs/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">IETF RFCs</a></li> </ul> <p>The intro and outro music is from Requiem for a Fish <a href="http://freemusicarchive.org/music/The_Freak_Fandango_Orchestra/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">The Freak Fandango Orchestra</a> / <a href="http://creativecommons.org/licenses/by-sa/3.0/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">CC BY-SA</a></p> </div> <img alt="" height="0" src="https://analytics.boundlessnotions.com/piwik.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fwww.pythonpodcast.com%2Fcpython-formal-specification-episode-288%2F&amp;action_name=Making+The+Case+For+A+%28Semi%29+Formal+Specification+Of+CPython+-+Episode+288&amp;urlref=https%3A%2F%2Fwww.pythonpodcast.com%2Ffeed%2F&amp;utm_source=rss&amp;utm_medium=rss" style="border: 0; width: 0; height: 0;" width="0" />