Podcast.__init__: Exploring Python’s Internals By Rewriting Them In Rust

The CPython interpreter has been the primary implementation of the Python runtime for over 20 years. In that time other options have been made available for different use cases. The most recent entry to that list is RustPython, written in the memory safe language Rust. One of the added benefits is the option to compile to WebAssembly, offering a browser-native Python runtime. In this episode core maintainers Windel Bouwman and Adam Kelly explain how the project got started, their experience working on it, and the plans for the future. Definitely worth a listen if you are curious about the inner workings of Python and how you can get involved in a relatively new project that is contributing to new options for running your code.

Summary

The CPython interpreter has been the primary implementation of the Python runtime for over 20 years. In that time other options have been made available for different use cases. The most recent entry to that list is RustPython, written in the memory safe language Rust. One of the added benefits is the option to compile to WebAssembly, offering a browser-native Python runtime. In this episode core maintainers Windel Bouwman and Adam Kelly explain how the project got started, their experience working on it, and the plans for the future. Definitely worth a listen if you are curious about the inner workings of Python and how you can get involved in a relatively new project that is contributing to new options for running your code.

Announcements

  • Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.
  • When you’re ready to launch your next app or want to try a project you hear about on the show, you’ll need somewhere to deploy it, so take a look at our friends over at Linode. With 200 Gbit/s private networking, scalable shared block storage, node balancers, and a 40 Gbit/s public network, all controlled by a brand new API you’ve got everything you need to scale up. And for your tasks that need fast computation, such as training machine learning models, they just launched dedicated CPU instances. Go to pythonpodcast.com/linode to get a $ 20 credit and launch a new server in under a minute. And don’t forget to thank them for their continued support of this show!
  • You listen to this show to learn and stay up to date with the ways that Python is being used, including the latest in machine learning and data analysis. For even more opportunities to meet, listen, and learn from your peers you don’t want to miss out on this year’s conference season. We have partnered with organizations such as O’Reilly Media, Dataversity, and the Open Data Science Conference. Go to pythonpodcast.com/conferences to learn more and take advantage of our partner discounts when you register.
  • Visit the site to subscribe to the show, sign up for the newsletter, and read the show notes. And if you have any questions, comments, or suggestions I would love to hear them. You can reach me on Twitter at @Podcast__init__ or email hosts@podcastinit.com)
  • To help other people find the show please leave a review on iTunes and tell your friends and co-workers
  • Join the community in the new Zulip chat workspace at pythonpodcast.com/chat
  • Your host is Tobias Macey and today I’m interviewing Adam Kelly and Windel Bouwman about RusPython, a project to implement a new Python interpreter in Rust

Interview

  • Introduction
  • How did you get introduced to Python?
  • Can you start by explaining what Rust is for anyone who isn’t familiar with it?
  • How did RustPython got started and what are your goals for the project?
  • Can you discuss what is involved in implementing a fully compliant Python interpreter?
  • What are some of the challenges that you face in replicating the capabilities of the CPython interpreter?
    • Are you attempting to maintain bug parity?
    • How much of the stdlib needs to be reimplemented?
    • Can you compare and contrast the benefits of Rust vs C?
    • Will the end result be compatible with libraries that rely on C extensions such as NumPy?
  • What is the current state of the project?
    • What are some of the notable missing features?
  • Can you talk through your vision of how the WebAssembly support will manifest and the types of applications that it will enable?
    • How much effort have you put into size optimization for the webassembly target to reduce client-side load time?
    • Are there any existing options for minification of Python code so that it can be delivered to users with less bandwidth?
  • What have been some of the most interesting/challenging/unexpected aspects of implementing a Python runtime?
  • What do you have planned for the future of the project?
  • What are the risks that you anticipate which could derail the project before it becomes production ready?

Contact Info

Picks

Links

The intro and outro music is from The Hug by The Freak Fandango Orchestra / CC BY-SA


Planet Python

A Song of Tableau and Data: Exploring Game of Thrones IMDB Ratings

Game of Thrones IMDB episode ratings

As the masses flock to their couches to re-binge-watch all the episodes of Game of Thrones, salivating for the final season like a pack of ravenous wolves, add this dashboard to your meta nerd repertoire.

I Drink and I Know Things

When the wine starts flowing and your friends finally take a break from preaching their favorite plotline conspiracies, it’s your moment to shine: “Did you know the first episode of every season tends to be among the lowest rated on IMDB?” Your question will linger in the air like the scent of stale Cheetos. Queue the sad trumpets as everyone’s balloon deflates … but, really! The data doesn’t lie. Take a peek at one of the visuals from the dashboards below:Game of Thrones IMDB episode ratings

Above: Data sourced from Kaggle

Now, let’s not be dramatic. The lowest-rated episode (Season 5, Episode 6: “Unbowed, Unbent, Unbroken”) still stands at an impressive 8.1 on IMDB, according to this dataset. That’s not bad by any means. But where’s the fun in shying away from dishing out a little tough love? We’re fans of the show, and sometimes it’s fun to stack episodes against each other. Turning the frown upside down, look how good the last couple of episodes tend to be! Sometimes you need to build up that story base at the beginning of the season, so the later episodes can come out swinging.

Which Episode Takes the Iron Throne

The average Game of Thrones episode rating stands at an impressive 9.1. The spirit of these dashboards is to help you see the information about the series in a convenient way. I didn’t want to bake in any opinions or focus on the plot—there’s plenty of that out there already. I just wanted to build a tool that lets us take a step back and consider the show itself. As you can see in the screenshot below, this allows us to get a feel for what people liked the most along the way:

Game of Thrones IMDB episode ratings

Above: Biggest winners early in the show appear to be Ned Stark’s execution (Baelor) and Tyrion’s defense against Stannis (Blackwater)

Until I stumbled upon this dataset, I didn’t realize how much I was missing having this Game of Thrones tool at my fingertips. I’m the annoying friend who points out, “Ooh, see that?! That didn’t happen that way in the books!” I promise not to be that person this season, friends. We’ve been in uncharted territory for a while now, as the most recent book was released in 2011.

Looking back, you remember the Red Wedding, don’t you? It might surprise some of you to know that in the books, Catelyn Stark transformed into Lady Stone, a zombie-like version of the Punisher, ruthlessly dispatching her enemies around the riverlands. Also unique to the books, Daenerys has a badass bodyguard named Belwas who eats an entire bowl of poisoned locusts meant to kill her (because he likes to snack), and he’s mildly inconvenienced by a tiny bellyache.

You Do Know Something, Jon Snow

My point is this: I like Game of Thrones, I enjoy talking to other people who like Game of Thrones, and I appreciate the series enough to want to know more information about the series itself. Which episodes did people like the most? Which director is associated with the best-rated episodes? Why was Battle of the Bastards the ‘most voted’ episode in the series? Okay, we know the answer to that one … because that episode was amazing. These are the fandom rabbit holes your mind might tumble down as you sift through these dashboards.

This metadata interests me, and maybe it interests you, too. That’s why these dashboards exist. You can dissect the show by its ratings, hover on elements of the dashboard to get extra information about the episodes and who directed them, view trends over time and just generally be an enabler to your inner Game of Thrones nerd.

I hope you enjoy playing with the dashboards and that they bring you a little extra joy heading into the final chapter of this awesome series!

The post A Song of Tableau and Data: Exploring Game of Thrones IMDB Ratings appeared first on InterWorks.

InterWorks

Vasudev Ram: Exploring the /proc filesystem: an article by me in Linux Pro Magazine


By Vasudev Ram – Online Python training / SQL training / Linux training


Hi, readers,

Somewhat recently, I wrote this article which was published in Linux Pro Magazine:

Exploring the /proc filesystem with Python and shell commands

As the title suggests, it is about getting information from the Linux /proc file system, which is a pseudo-file system that contains different kinds of information about running processes. The article shows some ways of getting a few kinds of information of interest about one or more specified processes from /proc, using both Python programs and Linux shell commands or scripts. It also shows a bit of shell quoting magic.

(The article has a few small errors that crept in, late in the publishing process, but any programmer with a bit of Python knowledge will be able to spot them and still understand the article.)

Check it out.

Enjoy.

– Vasudev


Vasudev Ram – Online Python training and consulting


I conduct online courses on Python programming, Unix / Linux commands and shell scripting and SQL programming and database design, with course material and personal coaching sessions.

The course details and testimonials are here.

Contact me for details of course content, terms and schedule.

Try FreshBooks: Create and send professional looking invoices in less than 30 seconds.

Getting a new web site or blog, and want to help preserve the environment at the same time? Check out GreenGeeks.com web hosting.

Sell your digital products via DPD: Digital Publishing for Ebooks and Downloads.

Learning Linux? Hit the ground running with my vi quickstart tutorial. I wrote it at the request of two Windows system administrator friends who were given additional charge of some Unix systems. They later told me that it helped them to quickly start using vi to edit text files on Unix. Of course, vi/vim is one of the most ubiquitous text editors around, and works on most other common operating systems and on some uncommon ones too, so the knowledge of how to use it will carry over to those systems too.

Check out WP Engine, powerful WordPress hosting.

Creating online products for sale? Check out ConvertKit, email marketing for online creators.

Teachable: feature-packed course creation platform, with unlimited video, courses and students.

Posts about: Python * DLang * xtopdf

My ActiveState Code recipes

Follow me on:


Planet Python