~/talk

Wrapping Go in Python

Talkat PyOhio 2016 · 2016-07-30..07-31· [go]
links:none on file
slides:none on file

Shows exactly how to compile a Go file into a shared object with go build -o name.so -buildmode=c-shared, load it from Python with ctypes.cdll and call the exported function by its exported name. Integers and floats round-trip with implicit or simple C type mapping, booleans appear as 0/1, strings require explicit conversion with C.CString/C.GoString and appear as bytes, and lists/dicts do not auto-convert. Example uses goroutines and channels to speed a prime counter; full code is on GitHub.

AI-written summary · about

  1. 0:00Introduction
  2. 0:34Github
  3. 1:07Talk Overview
  4. 1:31Section 1 It Can Be Done
  5. 3:59Shared Libraries
  6. 4:32Build
  7. 13:49Floats
  8. 14:07Prime Counter
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.