Showing posts with label CSA. Show all posts
Showing posts with label CSA. Show all posts

Thursday, August 10, 2017

The Ethical Maintainer: Community Service Award Recipient Glyph Lefkowitz


Glyph Lefkowitz was barely 20 years old when he promised himself, "I am never going to use a proprietary programming language again!" He had been writing a Java application for his first professional programming job, which he had started directly after high school. The firm was a mom and pop shop that sold inventory software. Glyph was hired to rewrite their application for a contemporary platform: Java's Abstract Window Toolkit. With the hubris of the young, he promised, "Sure, I can rewrite your whole application in a new language." He could do it working only four days a week, too, and make time to work on his multiplayer online game.

"I had a pretty terrible experience with Java," he says. In those early days of the Java AWT, on classic Mac OS it leaked a tiny bit of memory every time it opened and closed a window, and in his application, nearly every task a user desired required opening and closing a window. On the constrained Macs of the time, the application would crash after about 100 tasks, often taking the whole OS down with it. The AWT was proprietary, so there was no way to fix the bug himself. "I was fired," says Glyph, "because I was having a nervous breakdown over this."

The Birth of Twisted

Meanwhile, Glyph was also building his multi-user text adventure in Java. He wanted to rapidly experiment with varied gameplay logic, and to avoid constantly restarting the server as he tried new code, he built a system in Java that could load new modules at runtime. When, burned by his Java defeat, he switched to Python, he found that practically all of the Java code required to load modules and execute them simply disappeared.

The switch from Java to Python had another effect, which profoundly determined the direction of Glyph's career. He discovered async.

Glyph's friend James Knight, who would become an original contributor to Twisted, helped with the Python port. The initial code for the Python server ran a thread per player, but Knight used a select call to determine, within each thread, whether it was time to read a message from the player or send one. When young Glyph saw that code he was astonished. "It's doing two things at once! But it's also kind of one thing." After all the bugs he'd battled in his multithreaded Java, he thought, "Couldn't we just do one thing all the time?" He and Knight rewrote the entire game server as a single-threaded event loop. He liked how it simplified the code. Only one thread accessed a shared data structure at a time. His original motivation to use an event loop was not efficiency: rather, it was how much easier it was to make his code correct.

Glyph says that his strength, in his 20s, was knowing what he didn't know. His father is a programmer, and he taught Glyph that most programming techniques are already well-known. Therefore when Glyph and James Knight got their event loop working, Glyph thought, "Someone must have done this before." He searched on Alta Vista and found the ACE project, which included a C++ event loop. Glyph refined his Python event loop based on the best practices he found in ACE, and this became the basis for Twisted, which is now one of the oldest and most influential of all Python libraries.

Based on this early experience discovering that event loops were a well-known technique, Twisted's motto is "no new ideas allowed." Twenty years later, however, Glyph has begun to innovate on the margins. For example, his Tubes library implements asynchronous I/O as "flows" of data with flow control and backpressure. But when it comes to event loops, he says, "There's so much prior art that coming up with new inventions is not worthwhile."

Twisted's Influence On Python

In the second quarter of 2017, the Python Software Foundation recognized Glyph Lefkowitz with a Community Service Award for his work on Twisted and his contributions to the Python community. Nick Coghlan nominated him, saying that Twisted "predates almost all other Python event handling systems by years, and still has by far the most comprehensive set of network protocol handlers." The decade-long journey from PEP 342's generators-as-coroutines, which enabled Twisted's inlineCallbacks feature and Tornado's Futures, to native coroutine support with "async" and "await", began with Twisted. Coghlan says that evolution could be reasonably described as taking the concepts first embodied in Twisted and drawing them ever closer to the center of the language.

In 2012, Guido van Rossum began writing asyncio, an async framework for the Python standard library. He collaborated closely with Glyph, as well as Tornado's maintainer Ben Darnell, to incorporate their best ideas in asyncio. He was interested in Twisted's notion of a Deferred, but he couldn't seem to understand it. Glyph says that trying to explain Deferred to Guido "was the worst time I've ever had on a mailing list." Guido wrote, "I really don't get Deferreds. Don't bother pointing me to docs or tutorials; I tried and failed." He said that Glyph's "snarky tone is seriously affecting my ability to process your response." Then he went silent for a week.

Glyph was devastated. He felt like he'd been flamed and ghosted by the founder of the language itself. Then Guido suddenly returned to the mailing list, with what Glyph calls "the most trenchant and keenly observed critique of the Deferred module. It was possibly the best code review I've ever received." It was suddenly clear that Twisted's Deferred would interoperate just fine with the new asyncio event loop. "We were all on board."

Responsibilities of Open Source Programmers

Glyph is distinct among Python programmers for his outspoken views on ethics. In his 2015 PyCon talk he proposed that programmers write a code of ethics, similar to other professions such as medicine and journalism. If we don't, he says, "someone else is going to do it for us, and they are not going to understand our field well enough to do it correctly." Since software is eating the world and it influences nearly all economic activity, we have a grave obligation to write code ethically.

Open source programmers often think we owe our users nothing, because we give away code for free. But this attitude ignores the benefits that we've gained. "Being an open source maintainer has opened all sorts of doors for me," says Glyph. "Whenever anyone does anything with Twisted the credit accrues to me. That's not really accurate, because there are lots of other maintainers like Amber Brown, David Reid, Ashwini Oruganti, Jean-Paul Calderone, Moshe Zadka, and Christopher Armstrong." Regardless, anyone who releases open source code engages in a subtle exchange with users, which obliges the coder to uphold some responsibilities. In my conversation with him, Glyph identified three responsibilities for open source programmers: to make clear promises, to secure our code, and to release code of appropriate quality.

Open source maintainers are uniquely obliged to make clear promises. If a maintainer abandons a project, her main obligation is to announce her departure and to transfer control. "Being an open-source maintainer is not a life sentence," says Glyph. But it is irresponsible to make a worthy piece of software, gain users, then disappear without a word.

We also have a responsibility to protect our personal information security; for example, a Python project maintainer must protect her PyPI account so her users know they won't be hacked when they install her package. That responsibility is shared with the community's infrastructure maintainers, and Glyph cites PyPI as one of the best modern examples. "It doesn't get enough credit because of Python's checkered history with packaging," he says, "but the way Donald Stufft thinks about practical information security, and the other folks who work on PyPI as well, and the resources the PSF has invested there," have laid a foundation for securely distributing open source Python.

And finally, many of us set a low bar for the quality of code that we release: if the project scratched our own itch, we might as well open-source it. In Glyph's opinion, we must more carefully consider the impact of the code we give away, because we can't predict how it will be used. Glyph knows that many of the largest sites run Twisted somewhere in their stack, and he feels the responsibility keenly.

"A lot of our software completely escapes its originating context," says Glyph. The author might intend to release a mere prototype, but downstream packagers come to depend on her code, and other programmers even farther downstream might not know they depend on it at all. Of course, software users share some responsibility for auditing what code they use. "This responsibility is not black or white," says Glyph. "There's small tradeoffs and fractional proportions. It's not 100% yours or not, but you've got to think about it."

Wednesday, January 13, 2016

2015 Community Service Award goes to Berker Peksağ

Last month I posted about the wonderful work of Terri Oda, who was recognized with a Community Service Award. Today’s post is about another 2015 Fourth Quarter CSA recipient, Berker Peksağ, who will be receiving a Community Service Award  … for his consistent volunteer efforts with pydotorg in 2015 (see Resolutions).
As many of you know, pydotorg has been undergoing renovation for a long time now. It has been, and continues to be, a labor of love involving many people (the Python infrastructure team, Marc-André Lemburg, and Benjamin Peterson, to name just a few). Still, the work done by Berker over the past year has been remarkable, resulting in significant improvement to the site and to users' experience. 
His contributions in 2015 include:
  • Helping get the second redesign working on the staging website
  • Working on the new job board with Marc-André Lemburg
  • Helping fix bugs on python.org (e.g., corrections to URLS for Python downloads; scrolling issues on landing pages and PEPs)
  • Making sure the site uses an up-to-date version of Django
  • Committing code to improve the user experience (e.g., adding a feature for updating board minutes on the site; making a change so broken images would not appear; updating the members' section to allow members to edit their profiles, and non-members to sign up; updating membership using django-admin so staff can download member files; updating the PEP RSS feed; updating Open Graph protocol on the website
  • Updating contributor documentation describing how to install the GitHub repo and how to contribute to the site
  • Improving the contributor experience (e.g., by switching from Chef configuration to Ansible)
  • Reviewing and merging community pull requests
  • Cleaning-up code
Wondering how Berker came to make so many awesome contributions, I asked him about himself and learned the following:
Berker is a software developer, living in Istanbul, Turkey, who first started learning Python in 2010. At the time he had been engaged in web development for over five years, but within a year of learning Python he built his first non-trivial Python project with a friend. 
Desiring to become more active in Python, Berker discovered pythonmentors.com in late 2011. This discovery gave him the courage and support to contribute to CPython. As he tells it: 
"I still don’t know what I was thinking since I [didn’t] even know enough Python at that moment :). I don’t remember all the names, but Antoine Pitrou, Brett Cannon, Éric Araujo and R. David Murray were really helpful. Brett also merged my first patch to CPython in early 2012."
Berker's enthusiasm and skills increased, and by 2014, he had become a core developer. Today he works as a Python consultant in Istanbul.
I  asked Berker what more needs to be done on pydotorg, and he replied 
"Our stack is little bit outdated (Python 3.3 and Django 1.7), and we have a few blockers before switching to the latest releases of Python and Django. We also need to improve community contributions. I have a few ideas, but I couldn’t find enough time to work on them."
So here’s an opportunity for those of you who would like to help!  And for everyone, please join me in congratulating Berker on his well-deserved award and in thanking him for his contributions to our community.
I would love to hear from readers. Please send feedback, comments, or blog ideas to me at msushi@gnosis.cx.

Monday, August 31, 2015

CSA Awards to Tollervey, Stinner, and Storchaka

Greetings Readers, 
I apologize for the hiatus I’ve taken recently from writing this blog -- other commitments temporarily got in the way. But during this time the PSF has been hard at work, and I intend to catch you up on their activities in the next few posts. 
First of all, the Community Service Awards have been given out for both the second and third quarters of 2015. I am extremely happy to announce that the second quarter award went to our good friend, Nicholas Tollervey, for his excellent work in education and outreach. You can read more about Nick in a recent previous post to this blog (Tollervey), so I’ll forgo saying more about him here, other than congratulations,  and will turn to telling you about our third quarter award recipients.
RESOLVED, that the Python Software Foundation award the 2015 3rd Quarter Community Service Award to Victor Stinner and Serhiy Storchaka (PSF CSA).
Both Stinner and Storchaka are extremely active Python core developers. In the past three years, Serhiy has contributed well over 2000 commits, while Victor comes in a close second with almost 2000. Their hard work and dedication have helped increase Python’s vitality, relevance, and amazing growth -- a fact that the PSF wishes to recognize with this award.
In addition, Serhiy Storchaka is active on the Python tracker, taking the time to help other contributors by reviewing and committing their patches.
Victor Stinner’s work additionally includes 20 PEPs (see PEPs) as well as active participation in the Python community. You can view his PyCon 2014 talk here. He is also one of the developers of the tulip/asyncio project which provides asynchronous I/O support to Python. It was Victor who ported tulip/asyncio to Python 2; its usefulness has resulted in its recently being included as part of the Python 3.4 standard library.

Victor Stinner
Please join me in congratulating our latest CSA recipients and in thanking them for their important work.
I would love to hear from readers. Please send feedback, comments, or blog ideas to me at msushi@gnosis.cx.