~/talk

Call C code quickly and compatibly with CFFI

Talkat PyCon Canada 2017 · 2017-11-18..11-21· [c-and-cpp, python]
links:none on file
slides:none on file

Shows how CFFI generates bindings that run on CPython and PyPy and across Python 2/3, and explains when it avoids libffi overhead by compiling a real extension versus using dynamic libffi at runtime. Walks through a concrete build: setup.py and an FFI builder that compiles a C red-black tree implementation into an importable module, wires C-to-Python callbacks, uses ffi.new_handle to keep Python objects alive, and demonstrates that the module imports and works.

AI-written summary · about

  1. 0:00Introduction to C FFI
  2. 1:54Why call C from Python
  3. 7:41Red-black trees example
  4. 8:45Setting up the C library
  5. 16:38Creating a pythonic API
  6. 17:00Callbacks, memory, and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.