Hacker News new | past | comments | ask | show | jobs | submit login
Writing a Python C extension in 2018 (speakerdeck.com)
6 points by jbaviat on May 16, 2018 | hide | past | favorite | 1 comment



I'm the author of https://github.com/sqreen/PyMiniRacer, used as example in this deck.

I introduce how I leveraged ctypes + Python manylinux wheels (PEP513 / PEP571) in order to allow loading V8 easily into Python, without requiring local compilation on install nor having us maintaining a huge test matrix:

    $ pip install py-mini-racer
    $ python
    >>> from py_mini_racer import py_mini_racer
    >>> ctx = py_mini_racer.MiniRacer()
    >>> ctx.eval('1+1')
    2

So this shared object could be used in any language allowing to interact with arbitrary shared objects (e.g. Ruby with fiddle).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: