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

Dan Callahan - My Python's a little Rust-y

Dan Callahan - My Python's a little Rust-y

Rust is a new systems programming language from Mozilla that combines strong compile-time correctness guarantees with fast performance... and it plays nice with ctypes! Come learn how you can call Rust functions from Python code and finally say goodbye to hacking C!

https://us.pycon.org/2015/schedule/presentation/411/

PyCon 2015

April 18, 2015
Tweet

More Decks by PyCon 2015

Other Decks in Programming

Transcript

  1. The Big Lie “Python’s fast enough, and I can always

    write a C extension.” But it’s not, and we never do.
  2. Lines of C/C++ in Projects Project # Lines % CPython

    3.5.0a2 399,387 43% NumPy 1.9.2 166,034 62% Pillow 2.7.0 22,669 52% MarkupSafe 0.23 178 21%
  3. Stack Heap Fast but tiny Slow but huge Function locals

    Globals Managed by CPU Unmanaged Only small values of known, fixed size can go on the stack. Growable things like vectors must go on the heap.
  4. Enforced Statically at Compile Time No dangling pointers No use

    after free vulnerabilities No pointer arithmetic No null pointer dereferencing This is a “Zero-Cost Abstraction.”