Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python All The Things!

Python All The Things!

We’re familiar with Python as a scripting language, as a web server language, as a teaching language, as a data analysis language, and as a teaching language. But is that the limit of where Python can be used? What is the future for Python on other platforms? Is the prospect of using Python on those platforms a novelty, or a viable way to fend off an existential threat to the language? And how does this threat intersect with other threats we have to our community, and to our industry?

Video: https://www.youtube.com/watch?v=1sDyVJm3Ht0

B91373320dbc3bc52fcd870d3b21748f?s=128

Russell Keith-Magee

August 14, 2016
Tweet

Transcript

  1. Python all the things! Dr Russell Keith-Magee @freakboy3742 PyCon AU

    2016
  2. Python all the things! Dr Russell Keith-Magee @freakboy3742 PyCon AU

    2016
  3. None
  4. None
  5. None
  6. None
  7. None
  8. None
  9. How, and why?

  10. How

  11. What is Python?

  12. Python is a language specification.

  13. Python is a reference implementation.

  14. CPython is a reference implementation.

  15. Simplest approach: (Embedded) CPython

  16. Unix & C

  17. Porting CPython

  18. A cavelcade of platforms... $ ls -d Lib/plat-* plat-aix3 plat-freebsd7

    plat-next3 plat-aix4 plat-freebsd8 plat-os2emx plat-atheos plat-generic plat-riscos plat-beos5 plat-irix5 plat-sunos5 plat-darwin plat-irix6 plat-unixware7 plat-freebsd4 plat-linux2 plat-freebsd5 plat-mac plat-freebsd6 plat-netbsd1
  19. Compiling the kernel

  20. Cross-compiling the kernel

  21. Compiling CPython

  22. Embedding CPython

  23. Accessing system libraries

  24. ctypes & FFI

  25. ctypes from ctypes import * libc = cdll.LoadLibrary("libc.so.6") libc.strchr.argtypes =

    [c_char_p, c_char] libc.strchr.restype = c_char_p >>> print(libc.strchr(b"abcdef", b"d")) 'def'
  26. Where does this work?

  27. Alas, I have no compiler...

  28. Android, Java and Unix

  29. Platform limitations

  30. Python that isn't CPython

  31. Use a different compiler

  32. PyPy.js

  33. Inside a Python Parser Compiler Eval loop Standard library

  34. Implementing a new Python Parser Compiler Eval loop Standard library

  35. MicroPython Jython IronPython Skulpt Brython

  36. Implementing a new Python Parser Compiler Eval loop Standard library

  37. VOC

  38. Implementing a new Python Parser Compiler Eval loop Standard library

  39. Batavia

  40. Why not compile to Javascript?

  41. Spot the difference var x = 10; function scope_test(y) {

    x = x * y; } scope_test(3) console.log('x = ' + x); x = 10 def scope_test(y): x = x * y scope_test(3) print('x = ', x)
  42. Why not compile to Javascript?

  43. The missing pieces

  44. A different development cycle

  45. Implementing a new Python Parser Compiler Eval loop Standard library

  46. The Standard Library

  47. The Standard Library

  48. A reference Python standard library?

  49. Ouroboros

  50. Deployment and delivery

  51. Briefcase

  52. How

  53. Why?

  54. Existential threats

  55. Quo vadimus

  56. New platforms Phones Tablets Watches Set-top boxes Embedded systems

  57. An opportunity

  58. Polylingualism required Objective C Swift Java JavaScript

  59. A defence of polylingualism

  60. A counterargument to polylingualism

  61. First contact

  62. None
  63. Changing perceptions

  64. Why Python?

  65. Breadth of technical domains

  66. Social leadership

  67. Accessibility

  68. We're doing good. We can do better.

  69. Burnout

  70. Don't assume resources are free

  71. Relationship with money

  72. A side effect: Enabling Diversity

  73. The biggest challenges are non-technical

  74. The biggest challenges are non-technical

  75. The future

  76. None
  77. pybee.org/b/signup

  78. Fortune favours the prepared mind

  79. Thank You! russell@keith-magee.com @freakboy3742 pybee.org pybee.org/b/signup