Python and Diaspora

Python and Diaspora

How other languages have influenced Python for 25+ years

9ac051aa8b199b55b5da8aeb1679d71d?s=128

Hong Minhee

August 12, 2017
Tweet

Transcript

  1. Python and Diaspora How other languages have influenced Python for

    25+ years PyCon Korea 2017 Hong Minhee <hongminhee.org>
  2. Diaspora (διασπορά) A diaspora (…) is a scattered population whose

    origin lies within a smaller geographic locale. Diaspora can also refer to the movement of the population from its original homeland. —“Diaspora.” Wikipedia. E.g. Zainichi Korean, Koreans in China
  3. Origin myth Guido van Rossum has started to create Python

    since 1989. A famous anecdote.
  4. Origin myth, or history Guido van Rossum has started to

    create Python since 1989. However, don't we have any history for 25+ years since then?
  5. “Pythonic”

  6. What is Pythonic? P y t h o n 1

    . 5 . 2 ( # 1 , A u g 1 1 2 0 1 7 , 1 3 : 3 2 : 3 4 ) [ G C C 4 . 8 . 4 ] o n l i n u x 4 C o p y r i g h t 1 9 9 1 - 1 9 9 5 S t i c h t i n g M a t h e m a t i s c h C e n t r u m , A m s t e r d a m > > > ' W h a t i s P y t h o n i c ? ' . u p p e r ( ) T r a c e b a c k ( i n n e r m o s t l a s t ) : F i l e " < s t d i n > " , l i n e 1 , i n ? A t t r i b u t e E r r o r : ' s t r i n g ' o b j e c t h a s n o a t t r i b u t e ' u p p e r '
  7. What is Pythonic? P y t h o n 1

    . 5 . 2 ( # 1 , A u g 1 1 2 0 1 7 , 1 3 : 3 2 : 3 4 ) [ G C C 4 . 8 . 4 ] o n l i n u x 4 C o p y r i g h t 1 9 9 1 - 1 9 9 5 S t i c h t i n g M a t h e m a t i s c h C e n t r u m , A m s t e r d a m > > > ' W h a t i s P y t h o n i c ? ' . u p p e r ( ) T r a c e b a c k ( i n n e r m o s t l a s t ) : F i l e " < s t d i n > " , l i n e 1 , i n ? A t t r i b u t e E r r o r : ' s t r i n g ' o b j e c t h a s n o a t t r i b u t e ' u p p e r ' > > > i m p o r t s t r i n g > > > s t r i n g . u p p e r ( ' W a s i t P y t h o n i c ? ' ) ' W A S I T P Y T H O N I C ? ' > > > s t r i n g . j o i n ( [ ' f o o ' , ' b a r ' , ' b a z ' ] , ' / ' ) ' f o o / b a r / b a z ' > > > s t r i n g . f i n d ( ' H e l l o , w o r l d ! ' , ' , ' ) 5
  8. Not about invented tradition Eric Hobsbawm & Terence Ranger. The

    Invention of Tradition.
  9. Platform To become popular, a programming language has to be

    the scripting language of a popular system. Fortran and Cobol were the scripting languages of early IBM mainframes. C was the scripting language of Unix, and so, later, was Perl. Tcl is the scripting language of Tk. Java and Javascript are intended to be the scripting languages of web browsers. Being Popular. Paul Graham.
  10. Platform Language Platform COBOL IBM mainframes C Unix JavaScript Web

    Python
  11. Platform Language Platform COBOL IBM mainframes C Unix JavaScript Web

    Python
  12. Glue language Because it is interpreted, it is suitable for

    rapid prototyping and program development. Because it easily incorporates modules written in other languages, it is an excellent glue language for the overall structure of large programming projects. Python is not suitable for programming algorithms which require very rapid or time critical execution such as data compression, device drivers, complex floating point calculations or complex database operations. —“Internet Programming with Python.” Linux Journal #42, October 1997.
  13. Glue language Python is extensible: if you know how to

    program in C it is easy to add a new built‑in function or module to the interpreter, either to perform critical operations at maximum speed, or to link Python programs to libraries that may only be available in binary form (such as a vendor‑specific graphics library). Once you are really hooked, you can link the Python interpreter into an application written in C and use it as an extension or command language for that application. —Whetting Your Appetite. Python 1.5.2 Tutorial.
  14. Lisp and Python

  15. “Acceptable Lisp” I guarantee you there isn't one single Lisp

    programmer out there who uses exclusively Lisp. Instead we spend our time hacking around its inadequacies, often in other languages. —Lisp is Not an Acceptable Lisp. Steve Yegge.
  16. Early users familiar with Lisp Thus, early users familiar with

    such languages found themselves implementing comparable functionality in Python. … In late 1993, users had been throwing around various ideas for creating anonymous functions as well as various list manipulation functions such as m a p ( ) , f i l t e r ( ) , and r e d u c e ( ) . —Origins of Python's “Functional” Features. The History of Python. Guido van Rossum.
  17. 1993 Anonymous function? m a p ( ) ? f

    i l t e r ( ) ? r e d u c e ( ) ? Do languages without such features even exist?
  18. 1995 Java JavaScript Ruby

  19. 1995 Java (lambda and m a p / f i

    l t e r introduced in 2014) JavaScript ( m a p / f i l t e r introduced in 2005) Ruby
  20. Haskell and list comprehensions The idea of list comprehensions originally

    comes from the functional programming language Haskell. Greg Ewing argued most effectively for adding them to Python and wrote the initial list comprehension patch, which was then discussed for a seemingly endless time on the python‑dev mailing list and kept up‑to‑date by Skip Montanaro. —“List Comprehensions.” What's New in Python 2.0.
  21. Smalltalk and Python

  22. Subclassing s t r P y t h o n

    3 . 6 . 2 ( d e f a u l t , J u l 2 4 2 0 1 7 , 1 9 : 4 7 : 3 9 ) [ G C C 4 . 9 . 2 ] o n l i n u x T y p e " h e l p " , " c o p y r i g h t " , " c r e d i t s " o r " l i c e n s e " f o r m o r e i n f o r > > > c l a s s M y S t r i n g ( s t r ) : . . . d e f c o u n t _ a ( s e l f ) : . . . r e t u r n s e l f . c o u n t ( ' a ' ) . . . > > > M y S t r i n g ( ' f o o b a r ' ) . c o u n t _ a ( ) 1 > > >
  23. Subclassing s t r P y t h o n

    1 . 5 . 2 ( # 1 , A u g 1 1 2 0 1 7 , 1 3 : 3 2 : 3 4 ) [ G C C 4 . 8 . 4 ] o n l i n u x 4 C o p y r i g h t 1 9 9 1 - 1 9 9 5 S t i c h t i n g M a t h e m a t i s c h C e n t r u m , A m s t e r d a m > > > c l a s s M y S t r i n g ( s t r ) : . . . d e f c o u n t _ a ( s e l f ) : . . . r e t u r n s e l f . c o u n t ( ' a ' ) . . . T r a c e b a c k ( i n n e r m o s t l a s t ) : F i l e " < s t d i n > " , l i n e 1 , i n ? T y p e E r r o r : b a s e i s n o t a c l a s s o b j e c t
  24. Types and classes Like Smalltalk, Python has dynamic typing and

    binding, and everything in Python is an object. However, Python distinguishes built‑in object types from user‑defined classes, and currently doesn't allow inheritance from built‑in types. —Comparing Python to Other Languages. April 1997. Guido van Rossum. (Emphasis added.)
  25. Before PEP 253 3.4 U s e r D i

    c t — Class wrapper for dictionary objects This module defines a class that acts as a wrapper around dictionary objects. It is a useful base class for your own dictionary‑like classes, which can inherit from them and override existing methods or add new ones. In this way one can add new behaviours to dictionaries. —Python Library Reference. Release 1.5.2. April 1999.
  26. Before PEP 253 3.4 U s e r L i

    s t — Class wrapper for list objects This module defines a class that acts as a wrapper around list objects. It is a useful base class for your own list‑like classes, which can inherit from them and override existing methods or add new ones. In this way one can add new behaviours to lists. —Python Library Reference. Release 1.5.2. April 1999.
  27. Subtyping built‑in types This PEP proposes additions to the type

    object API that will allow the creation of subtypes of built‑in types, in C and in Python. —PEP 253 “Subtyping Built‑in Types.” May 2001.
  28. Digital Creations … the members of PythonLabs are making Digital

    Creations their new home. Guido van Rossum was kind enough to answer a set of questions … Do you expect the PythonLabs people to work on Zope as well? Yes — Zope is a very interesting piece of software, and we'd like to help. I certainly have some ideas that I'd like to try out. But I don't think this will be a large portion of our time — instead, we'll be improving Python in ways that will make it possible for Jim Fulton's team to make Zope better. “Guido van Rossum on the move to Digital Creations.” November 1, 2000. LWN.
  29. Smalltalk and Zope It looks like you have been a

    Smalltalk programmer. Jim Fulton: Yes. Smalltalk is very cool. I built a visual chart editor for the USGS using GNU Smalltalk. I also spent a little time serving on the ANSI Smalltalk committee. There seems to be some neat work still going on with Smalltalk, especially Squeak. —Jim Fulton Interview. Zopera (French Zope UG). February 2002.
  30. Smalltalk and Zope Do you have a vision of the

    future of web development that you follow since many years, or do you try to follow industry standards and to keep best of them? Jim Fulton: I'm an object zealot, and Zope has always been about employing the power of object technology and Python to make building web solutions to complex problems as easy as possible. —Jim Fulton Interview. Zopera. February 2002.
  31. Making Python look more like Smalltalk This PEP proposes changes

    to the introspection API for types that makes them look more like classes, and their instances more like class instances. For example, t y p e ( x ) will be equivalent to x . _ _ c l a s s _ _ for most built‑in types. —PEP 252 “Making Types Look More Like Classes.” April 2001.
  32. Then and now P y t h o n 1

    . 5 . 2 ( # 1 , A u g 1 1 2 0 1 7 , 1 3 : 3 2 : 3 4 ) [ G C C 4 . 8 . 4 ] o n l i n u x 4 C o p y r i g h t 1 9 9 1 - 1 9 9 5 S t i c h t i n g M a t h e m a t i s c h C e n t r u m , A m s t e r d a m > > > t y p e ( ' a ' ) < t y p e ' s t r i n g ' > > > > s t r < b u i l t - i n f u n c t i o n s t r > > > > t y p e ( ' a ' ) i s s t r 0 P y t h o n 3 . 6 . 2 ( d e f a u l t , J u l 2 4 2 0 1 7 , 1 9 : 4 7 : 3 9 ) [ G C C 4 . 9 . 2 ] o n l i n u x T y p e " h e l p " , " c o p y r i g h t " , " c r e d i t s " o r " l i c e n s e " f o r m o r e i n f o r > > > t y p e ( ' a ' ) < c l a s s ' s t r ' > > > > s t r < c l a s s ' s t r ' > > > > t y p e ( ' a ' ) i s s t r T r u e
  33. Zope and Python web frameworks Trac, Edgewall Software (2004) Pylons,

    Ben Bangert & James Gardner (2005) WebOb, Ian Bicking (2007) r e p o z e . b f g , Agendaless Consulting (2009)
  34. Zope and Python web frameworks Trac, Edgewall Software (2004) Pylons

    Project Pylons (2005) → Pyramid (2010) WebOb (2007) → Pyramid (2010) r e p o z e . b f g (2009) → Pyramid (2010)
  35. Perl and Python

  36. Package managers are the norm now Perl (1987): CPAN Python

    (1989): PyPI & p i p Ruby (1995): RubyGems Java (1995): Maven Haskell (1990): Cabal & Stack JavaScript (1995): n p m
  37. Though they weren't back then Perl (1987): CPAN (1995) Python

    (1989): Cheese Shop (2002) & p i p (2011) Ruby (1995): RubyGems (March 2004) Java (1995): Maven (July 2004) Haskell (1990): Cabal (2005) & Stack (2016) JavaScript (1995): n p m (2010)
  38. Python was in envy of Perl's CPAN It's been said

    more than once that Python really needs a CPAN‑like module repository. What's the current thinking in that regard? That it's true. We don't yet have immediate plans in that direction, but in the long term I think we'll be improving the www.python.org website (making it a Zope site run by the community) and this would be a logical thing to add. Note that the distutils package added to Python 2.0 makes installation of 3rd party code much easier. “Guido van Rossum on the move to Digital Creations.” November 1, 2000. LWN.
  39. ESR on Perl and Python So the real punchline of

    the story is this: weeks and months after writing fetchmailconf†, I could still read the fetchmailconf code and grok what it was doing without serious mental effort. And the true reason I no longer write Perl for anything but tiny projects is that was never true when I was writing large masses of Perl code. I fear the prospect of ever having to modify keeper‡ or anthologize‡ again—but fetchmailconf gives me no qualms at all. —“Why Python?” Linux Journal #73, May 2000. Eric S. Raymond. † ESR's software written in Python. ‡ ESR's softwares written in Perl.
  40. Conclusion

  41. ABC It was the eighties now, and Basic was the

    language of choice for a new generation of amateur programmers… Our team considered the Basic language a pest that the world should be rid of. The language we were building, ABC, would “stamp out Basic”, according to our motto. Sadly, for a variety of reasons, …, ABC was abandoned. Since then I've spent many hours trying to understand why the project failed … my best answer is that ABC died because there was no internet in those days, and as a result there could not be a healthy feedback loop between the makers of the language and its users. ABC's design was essentially a one‑way street. —King's Day Speech. Guido van Rossum.
  42. Popularity So whether or not a language has to be

    good to be popular, I think a language has to be popular to be good. And it has to stay popular to stay good. Being Popular. Paul Graham.
  43. How we've defined “Pythonic” Other languages have inspired what Python

    is.
  44. How we will define “Pythonic” Other languages have inspired what

    Python is. Other languages can inspire what Python should be in the future, too.
  45. Thank you Slides: <bit.ly/pyconkr2017‑hong‑en>