Automat State Machines with Glyph Lefkowitz

The Python Podcast.__init__

Episode | Podcast

Date: Sat, 01 Jul 2017 22:00:00 -0400

<h3>Summary</h3> <p>The venerable &#8216;if&#8217; statement is a cornerstone of program flow and busines logic, but sometimes it can grow unwieldy and lead to unmaintainable software. One alternative that can result in cleaner and easier to understand code is a state machine. This week Glyph explains how Automat was created and how it has been used to upgrade portions of the Twisted project.</p> <h3>Preface</h3> <ul> <li>Hello and welcome to Podcast.&#95;&#95;init&#95;&#95;, the podcast about Python and the people who make it great.</li> <li>I would like to thank everyone who supports us on <a href="https://www.pythonpodcast.com/podcastinit?utm_source=rss&amp;utm_medium=rss">Patreon</a>. Your contributions help to make the show sustainable.</li> <li>When you&#8217;re ready to launch your next project you&#8217;ll need somewhere to deploy it. Check out Linode at <a href="https://www.pythonpodcast.com/linode?utm_source=rss&amp;utm_medium=rss">www.podastinit.com/linode?utm_source=rss&amp;utm_medium=rss</a> and get a $20 credit to try out their fast and reliable Linux virtual servers for running your awesome app.</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 newsletter, read the show notes, and get in touch.</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>, or <a href="https://play.google.com/music/m/I7ogju4xv6adasgqz6545jndgsy?t=Podcastinit_-_Python_and_the_people_who_make_it_great&amp;utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Google Play Music</a>, tell your friends and co-workers, and share it on social media.</li> <li>Your host as usual is Tobias Macey and today I&#8217;m interviewing Glyph about Automat, a library that provides self-service finite-state machines for the programmer on the go.</li> </ul> <h3>Interview</h3> <ul> <li>Introductions</li> <li>How did you get introduced to Python?</li> <li>What is a state machine and when might you want to use one?</li> <li>There are a number of libraries available on PyPI that facilitate the creation of state machines. Why did you feel the need to build a new option and how does it differ from what was already available?</li> <li>Why do you think developers fall into the trap of complicated conditional structures rather than reaching for a state machine?</li> <li>For someone who wants to integrate Automat into their project how would they go about that and what are some of the gotchas that they should keep in mind?</li> <li>What do the internals of Automat look like and how did you approach the overall design of the project?</li> <li>What are some of the more difficult aspects of designing and implementing state machines properly?</li> <li>What are some of the technical hurdles that you have been faced with in the process of building a library for implementing state machines?</li> <li>What do you have planned for the future of Automat?</li> <li>What are some of the most interesting use cases of Automat that you have seen?</li> </ul> <h3>Keep In Touch</h3> <ul> <li><a href="mailto:glyph@twistedmatrix.com">Email</a></li> <li><a href="https://twitter.com/glyph?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">@glyph</a> on Twitter</li> <li><a href="https://github.com/glyph?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Glyph</a> on GitHub</li> </ul> <h3>Picks</h3> <ul> <li>Tobias <ul> <li><a href="http://www.homedepot.com/p/Commercial-Electric-3-Light-LED-White-RGB-Color-Changing-Puck-Light-Kit-21383NKIT-WH/206837266?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Commercial Electric color changing LED puck lights</a></li> </ul> </li> <li>Glyph <ul> <li><a href="https://www.omnigroup.com/omnifocus?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">OmniFocus</a></li> <li><a href="http://gettingthingsdone.com/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">GTD</a></li> </ul> </li> </ul> <h3>Links</h3> <ul> <li><a href="https://github.com/glyph/automat?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Automat</a></li> <li><a href="https://www.pythonpodcast.com/episode-17-glyph-on-ethics-in-software/?utm_source=rss&amp;utm_medium=rss">Glyph Interview About Software Ethics</a></li> <li><a href="https://en.wikipedia.org/wiki/Finite-state_machine?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Finite State Automaton</a></li> <li><a href="https://en.wikipedia.org/wiki/Yacc?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Yacc</a></li> <li><a href="https://www.gnu.org/software/bison/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Bison</a></li> <li><a href="https://github.com/westes/flex?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Flex Parser Generator</a></li> <li><a href="https://pypi.org/search/?q=state%20machine&amp;utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">PyPI State Machine</a></li> <li><a href="https://en.wikipedia.org/wiki/Mealy_machine?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Pure Mealy Machine</a></li> <li><a href="https://en.wikipedia.org/wiki/Moore_machine?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Moore Machine</a></li> <li><a href="https://www.youtube.com/watch?v=S352lyPZP00&amp;utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Mealy vs. Moore Machines</a></li> <li><a href="https://en.wikipedia.org/wiki/Leaky_abstraction?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Leaky Abstraction</a> <ul> <li><a href="https://en.wikipedia.org/wiki/Leaky_abstraction?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">The Law of Leaky Abstraction</a></li> </ul> </li> <li><a href="http://twistedmatrix.com/trac/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Twisted</a></li> <li><a href="https://docs.python.org/3/howto/descriptor.html?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Python Descriptor</a></li> <li><a href="http://www.graphviz.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">GraphViz</a></li> <li><a href="https://hypothesis.readthedocs.io/en/latest/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Hypothesis</a></li> <li><a href="https://www.youtube.com/watch?v=MtHscXjWbVs&amp;utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">PyCon Talk &#8211; TLS State Machine</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><img alt="" height="0" src="https://analytics.boundlessnotions.com/piwik.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fwww.pythonpodcast.com%2Fautomat-state-machines-with-glyph-lefkowitz-episode-116%2F&amp;action_name=Automat+State+Machines+with+Glyph+Lefkowitz+-+Episode+116&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" /></p>