Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Python and a Gopher walk into a bar - Embedding Python in Go. (dotGo2017)

A Python and a Gopher walk into a bar - Embedding Python in Go. (dotGo2017)

Python-to-Go migration stories are now commonplace, but how often do you hear of projects using Python and Go? We ported Datadog’s Agent to Go, but kept its plugins in Python. We’ll share lessons learned about cgo, the GIL & the pitfalls we encountered while bridging two languages in a single app.

Massimiliano Pippi

November 06, 2017
Tweet

More Decks by Massimiliano Pippi

Other Decks in Programming

Transcript

  1. A Python and a Gopher walk into a bar -
    Embedding Python in Go.
    Massimiliano Pippi
    @maxpippi
    http://dev.pippi.im

    View Slide

  2. View Slide

  3. TITLE

    View Slide

  4. TITLE
    A. Text
    B. text

    View Slide

  5. TITLE
    A. Text
    B. text

    View Slide

  6. Lessons learned
    https://twitter.com/kwinkunks/status/619496450834087938

    View Slide

  7. 1. Text
    2. Text
    TITLE

    View Slide

  8. TITLE
    A. Text
    B. text

    View Slide

  9. TITLE
    A. Text
    B. text

    View Slide

  10. View Slide

  11. Lesson learned: acquire the GIL!

    View Slide

  12. Lesson learned: know your runtime!
    https://morsmachine.dk/go-scheduler
    GIL is locked on M0
    GIL will be released on M1

    View Slide

  13. TITLE

    View Slide

  14. Thanks for listening!
    ● Try Datadog at https://www.datadoghq.com
    ● Find our OSS on https://github.com/DataDog
    ● Our tech blog is http://engineering.datadoghq.com
    Check out the new Agent on Github!
    https://github.com/DataDog/datadog-agent/

    View Slide