Dan Callahan · [email protected] · @callahad
"Python's fast enough, and
I can always write a C extension."
But it's not, and we never do.
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% |
Much like the video at
youtube.com/watch?v=718fskG2n34
C has no safety belts.
- Heartbleed
- Ghost
- CVE-2015-0080
I'm not smarter than the glibc or openssl devs.
C's Performance, Portability, and Embeddability.
With *guaranteed* safety.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.
- No dangling pointers
- No use after free vulnerabilities
- No pointer arithmetic
- No null pointer dereferencing
This is a "Zero-Cost Abstraction."
rust-lang.org
@callahad
github.com/callahad/pycon2015-rust
rust-lang.org