Slashdot Mirror


Interviews: Q&A With Guido van Rossum

Guido van Rossum is best known as the creator of Python, and he remains the BDFL (Benevolent Dictator For Life) in the community. The recipient of many awards for his work, and author of numerous books, he left Google in December and started working for Dropbox early this year. A lot has happened in the 12 years since we talked to Guido and he's agreed to answer your questions. As usual, ask as many as you'd like, but please, one question per post.

44 of 242 comments (clear)

  1. From Google to Dropbox by nurhussein · · Score: 4, Interesting

    Hi,

    What prompted the move from Google to Dropbox? What did you do at Google, and what are you going to do at Dropbox?

  2. GIL by Anonymous Coward · · Score: 5, Interesting

    When will you remove the GIL?

    1. Re:GIL by HaZardman27 · · Score: 4, Informative

      I think they've always been open about the fact that the GIL will be removed once someone offers a good solution for removing it.

      --
      Apparently wizard is not a legitimate career path, so I chose programmer instead.
    2. Re:GIL by occasional_dabbler · · Score: 2

      Python has multi-threading, multi processing and wrappers for C and Fortran. The GIL is not holding back anything.

      --
      "Our opponent is an alien starship packed with atomic bombs," I said. "we have a protractor"
  3. Who's watching by Anonymous Coward · · Score: 5, Interesting

    Does the NSA have access to our Dropbox contents, as is apparently the case with Microsoft Skydrive?

  4. BC Breaking changes in 3 by PktLoss · · Score: 5, Interesting

    Do you regret the swath of backwards incompatible changes in version 3 that have lead to such slow uptake, or do you feel it was the best move for the language moving forward?

    1. Re:BC Breaking changes in 3 by HaZardman27 · · Score: 4, Interesting

      I would be very interested in seeing the answer to this. As a Python programmer I've nearly entirely avoided using Python 3.x in favor of 2.7. I just see fewer advantages to it than disadvantages (having to update old code, learning which libraries I use support 3.x, etc.). The Python community seems divided between 2.7 and 3, and this is problematic for a language designed to be clean with a "correct" and "pythonic" way of doing things.

      --
      Apparently wizard is not a legitimate career path, so I chose programmer instead.
    2. Re:BC Breaking changes in 3 by TeknoHog · · Score: 2

      One could argue that Python is learning from some of the early mistakes. For example print function vs. statement. On the other hand, one of the key strengths of Python is having lots of nice libraries by default, and these have undergone changes independent of the 2 -> 3 core language changes. It's a little inconvenient, but libraries evolve, no matter what language you use.

      --
      Escher was the first MC and Giger invented the HR department.
    3. Re:BC Breaking changes in 3 by gr8_phk · · Score: 3, Insightful

      This is my #1 reason for not using Python. Why use a language that has no commitment to backwards compatibility when there are plenty that do?

      Why use a language that is interested in "backwards compatibility" when Python is into "forward compatibility". You can "import from future *" to make your code use features that are not yet in the latest release. Why embrace legacy ways of doing things when you can be focused on the future instead? I find the push to make it more perfect for the future a plus even if it means short term pain.

    4. Re:BC Breaking changes in 3 by sydneyfong · · Score: 2

      Name me a mainstream programming language which has only been intentionally backwards incompatible *once* in its 20 year history.

      I can only think of C.

      --
      Don't quote me on this.
    5. Re:BC Breaking changes in 3 by wiredlogic · · Score: 2

      You know it is entirely possible to write 2.7 code that works with nothing more than a pass through 2to3. That does mean that any libraries you depend on are available for 3.x but the problem of lacking support from 3rd party libraries is beginning to diminish as more are ported over at an increasing rate.

      You can also start training yourself for the switch to Python 3 now by using all of the from __future__ imports which will also increase the ease of getting 2to3 output working when any missing support is implemented in the future. I used this approach on a 10K SLOC library that required a manual fix to a single line of code to get running on 3.x.

      --
      I am becoming gerund, destroyer of verbs.
  5. Interviews by semanticgap · · Score: 4, Interesting

    Guido

    When you interviewed at Google - did they ask you brainteaser or hard algorithmic questions, and if so, what did you think of it?

    Cheers!

  6. Re:When is python going to support parallel proces by NeverWorker1 · · Score: 2

    Python does support threading. The issue is that CPython implementation has the GIL to contend with. IronPython did away with the GIL, but it's no longer being maintained. Also, http://interviews.slashdot.org/comments.pl?sid=4105821&cid=44608065 beat you too it.

  7. Why did Python avoid some common "OO" idioms? by i_ate_god · · Score: 3, Interesting

    Interfaces, abstract classes, private members, etc... Why did python avoid all this?

    --
    I'm god, but it's a bit of a drag really...
    1. Re:Why did Python avoid some common "OO" idioms? by knapper_tech · · Score: 2

      Ultimately, since Python is dynamic down to being able to override the data model of an object on the fly, there would be no point. There is no point in any program really. Underscores do just as good of job as public/private declarations at telling me which parts of the API are for users and which are for the class. I might use private attributes and methods, but I ought to know what I'm doing if I do. Any program's data can be made public, and the more frequently the need arises, the better programmers get at using introspection to uncover the private members, and suddenly there's no point.

      One of the older justifications given for encapsulation and header files was to be able to sell binary objects. If you can't read the source for the library, you can't figure out how all the parts work, so you better use the public API or you might really screw something up. This is totally irrelevant in the world of open source software. Underscores are a totally valid solution to telling other programmers who might modify the encapsulation what the intent was at one point, giving them a strong hint that they need to dig deeper before messing around. If encapsulation is a gentleman's agreement, why does it need a language feature?

      --
      "There are some people that if they don't know, you can't tell them." ~ Louis Armstrong
  8. Multi-line lambdas by NeverWorker1 · · Score: 3, Interesting

    One of the most common complaints about Python is the limitations of its lambdas, namely being one line only without the ability to do assignments. Obviously, Python's whitespace treatment is a major part of that (and, IIRC, I've read comments from you to that effect). I've spent quite a bit of time thinking about possible syntax for a multi-line lambda, and the best I've come up with is trying to shoehorn some unused (or little used) symbol into a C-style curly brace, but that's messy at best. Is there a better way, and do you see this functionality ever being added?

    1. Re:Multi-line lambdas by blamelager · · Score: 3, Funny

      >>> from __future__ import braces

    2. Re:Multi-line lambdas by NeverWorker1 · · Score: 2

      Exactly. It's terribly unpythonic. Sadly though, I don't have a better way to do multi-line lambdas.

    3. Re:Multi-line lambdas by DriedClexler · · Score: 4, Insightful

      Solution:

      1) Make it a named function.
      2) Place the name where you'd otherwise put the lambda.

      It works, although you have to deal with the horror of a reusable function defined a few lines up.

      --
      Information theory is life. The rest is just the KL divergence.
  9. Re:Loving python by dmbasso · · Score: 2


    if you want to joke about indentation:
        at least make it syntactically sound

    while you're at it:
        follow pep8

    --
    `echo $[0x853204FA81]|tr 0-9 ionbsdeaml`@gmail.com
  10. Best & worst of Python? by Laxori666 · · Score: 2

    Compound question here: what part of Python is or became your favorite, and what's the worst thing, something that you would change if you knew now what you did then?

  11. One thing different by NeverWorker1 · · Score: 5, Interesting

    If you could go back to the very start and change one thing about Python, what would it be and why?

  12. PyPy by Btrot69 · · Score: 5, Interesting

    Do you see PyPy as the future ? http://pypy.org/
    Or do you remain unconvinced, and -- if so -- why ?

    1. Re:PyPy by occasional_dabbler · · Score: 3, Interesting

      Me too. In fact my question: Do you endorse PyPy?

      --
      "Our opponent is an alien starship packed with atomic bombs," I said. "we have a protractor"
  13. Python in the browser ? by Btrot69 · · Score: 3, Informative

    Over the years, there have been several attempts to create a sandboxed version of python that will safely run in a web browser.
    Mostly this was because of problems with Javascript.
    Now that Javascript works -- and we have nice things like CoffeeScript -- is it time to give up on python in the browser ?

  14. Another BDFL by Anonymous Coward · · Score: 4, Interesting

    What is your view on the tone that Linus uses on the LKML? Do you think it actually provides any benefits or just drives away would-be contributors?

  15. GIL and true parallelism by neonleonb · · Score: 4, Interesting

    The main thing that keeps Python from being really useful for my projects is the Global Interpreter Lock (GIL). I would love to write Python for my data-intensive code, but it is impossible to get really good parallelism with Python; the multiprocessing library isn't a magic fix because then I have to move all my data back and forth between processes.

    When, if ever, should I expect to be able to use Python to do parallel data processing? What is the priority for this, and what would need to be done to make thread-level parallelism possible?

    1. Re:GIL and true parallelism by neonleonb · · Score: 2

      And Jython doesn't work with numpy, which is one of Python's best features. The JVM is great for parallelism, but numerical computing on it isn't very fast.

    2. Re:GIL and true parallelism by neonleonb · · Score: 2

      I take your point; Python isn't the tool for proper threading.

      Nevertheless, I think your claim that "people who need threads are already using other technologies" isn't true. I think people keep butting up against that need as their projects grow, and it forces them to (painfully) move away from Python. I think Python could better serve those users with good parallelism.

    3. Re:GIL and true parallelism by shutdown+-p+now · · Score: 2

      IronPython is quite alive - they put up a new release candidate just two days ago. Note that their source repo is on GitHub these days, even though the binary downloads are still on CodePlex.

      Of course, the real problem with IronPython (and Jython) is that you can't use the multitude of Python libraries that use native code and the CPython extensibility API.

  16. Python 3 Regrets by n1ywb · · Score: 3, Insightful

    If you could go back in time, what, if anything, would you do differently WRT to developing and releasing Python 3?

    --
    -73, de n1ywb
    www.n1ywb.com
  17. Key question for any language designer by dkleinsc · · Score: 4, Interesting

    Have the prospects of Python in any way improved since you grew a beard? To what degree does language success correlate to beard length?

    --
    I am officially gone from /. Long live http://www.soylentnews.com/
  18. Any NSA backdoors in Python ? by Btrot69 · · Score: 2, Interesting

    Are you aware of any attempts by the NSA to add a backdoor in Python ?
    Of course, if you did get an NSA letter, you wouldn''t be allowed to say.
    You are welcome to NOT ANSWER this question.
    We will take note of that ;)

  19. functional programming by ebno-10db · · Score: 4, Insightful

    Some people claim that Python is, at least partly, a functional language. You disagree, as do I. Simply having a few map and filter type functions does not make for a functional language. As I understand it those functions were added to the libraries by a homesick Lisper, and that several times you've been tempted to eliminate them. In general it seems you're not a fan of functional programming, at least for Python.

    Question: do you feel that the functional programming approach is not very useful in general, or simply that it's not appropriate for Python? It would be nice to hear your reasons either way.

  20. why should I adopt Python 3? by js_sebastian · · Score: 3, Interesting

    What are the big features/improvements of python 3 that could/should convince me to make the effort to switch over from python 2.x to python 3.x?

    I am not able to do the switch now as I rely on some libraries that have not finished converting to python 3 yet, but having something to look forward to other than the pain of backwards-incompatibility could go a long way in getting me to prepare for the change instead of ignoring the issue.

    1. Re:why should I adopt Python 3? by js_sebastian · · Score: 2

      I feel that the reasons are evident in the release notes that describe the new features in 3.1, 3.2, 3.3... The more interesting question to me is what he thinks of the serious lag in library support for Py3, which I posted below.

      Care to point out some highlights? A little bit of evangelism would not hurt. If you ask Stroustroup what are the cool new features of C++11, he has a good answer ready. Other than the new unicode support, which is very important in some contexts but not everywhere, I see nothing else that's very exciting looking here: http://docs.python.org/3.0/whatsnew/3.0.html.

  21. Re:Loving python by strombrg · · Score: 2

    I've commented on python and whitespace enough times, that it became more practical to create a small web page about it: Read it here.

  22. Python as a shell language by js_sebastian · · Score: 3, Interesting

    Tools like ipython and fabric go a long way into making python into something that can replace my bash shell in many situations.

    The main obstacle to this use-case is python's semantic spacing and lack of braces (or something):

    - it is hard to do even a fairly simple if/else or loop in a single line so it will interact nicely with the terminal's history
    - it is hard to cut&paste code into the terminal because you have to be wary of leading spaces

    Ipython tries to solve some of this with shortcuts to bring up a built-in editor, which is an approach that works but is quite cumbersome.

    Do you think convenient usage on the interactive shell is a worthy goal that the language should support? if so, is there any direction the language or libraries could develop to better support it?

  23. If you were to design Python from scratch... by Anonymous Coward · · Score: 2, Interesting

    Guido, if you were to design Python from scratch now (without any constraint and legacy code using the old Python), what would you change and how different would it be from Python 3?

  24. What is your programming environment like today ? by Btrot69 · · Score: 5, Interesting

    How often do you get a chance to write serious code ?
    What's your default OS ?
    Command shell ?
    Version control ?
    Editor ?
    IDE ?
    Web browser ?
    IM client ?
    email client ?

    late nights or early rise ?

  25. Python 3 by MetalliQaZ · · Score: 3, Interesting

    How do you feel about the current state of the migration to Python 3 (Py3k)?
    From a user perspective it seems that the conversion of popular libraries has lagged far behind, which has impeded the transition. In my professional capacity, nearly every single system I use lacks an installed 3.x interpreter. In fact, 2.7 is a rarity. I'd like to get your thoughts.

    --
    "Here Lies Philip J. Fry, named for his uncle, to carry on his spirit"
  26. reasonable switch-case statement by chuckinator · · Score: 2

    Eh, I can give or take the lambdas. Just give me a halfway decent switch-case statement so I don't have to write huge, rolling if-elif-elif-elif-elif-elif-else-finally blobs. Using built in language reflection to parse a parameter into a function name you call later isn't an answer and has led to many, many python scripts crapping out on me when you actually want to use string data containing '-' or other strange, exotic ASCII characters in them as your key into the switch statement.

  27. Re:Loving python by js_sebastian · · Score: 2

    I've commented on python and whitespace enough times, that it became more practical to create a small web page about it: Read it here.

    Much as I love python, I see nothing to refute my objections to python's use of semantic spaces and lack of braces or other equivalent construct.

    - It makes python ineffective as a shell-replacement language, because you can't easily do a complex one-liner and then retrieve it from history
    - It makes cutting and pasting code difficult, which makes refactoring unnecessarily painful
    - It makes it impossible to fully auto-format code: all formatters I have seen for python do not trust themselves to touch leading spaces, nor should they. This leads to ugly, inconsistent-looking code.

    It's not just about the obvious problem of tripping up anyone who is not paying attention to this peculiarity of the language. If python had semantic line ends (but not semantic leading spaces) with optional semi-colons (for when you don't use a line end) plus braces, the amount of extra typing and visual clutter would be minimal, while these problems would go away, making python a more useful language.

  28. Explanation by Errol+backfiring · · Score: 3, Informative

    GIL stands for Global Interpreter Lock, see: https://en.wikipedia.org/wiki/Global_Interpreter_Lock

    --
    Nae king! Nae laird! Nae yurrupiean pressedent! We willna be fooled again!