Hacker News new | comments | ask | show | jobs | submit login
Writing a Python C extension in 2018 (speakerdeck.com)
6 points by jbaviat 8 months ago | hide | past | web | 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 | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: