Episode

Python in Elixir Apps with Victor Björklund

Podcast
Elixir Wizards
Published
Jul 31, 2025
Duration seconds
2102
Processing state
processed
Canonical source
https://smartlogic.fireside.fm/s14-e10-python-in-elixir-apps
Audio
https://aphid.fireside.fm/d/1437767933/03a50f66-dc5e-4da4-ab6e-31895b6d4c9e/cf1b7aa3-a808-4496-ae0d-164677fde998.mp3
JSON
/v1/public/podcasts/elixir-wizards/episodes/python-in-elixir-apps-with-victor-bj-rklund
Markdown
/podcast/elixir-wizards/python-in-elixir-apps-with-victor-bj-rklund.md

Actions

  • POST https://stenobird.com/v1/public/podcasts/elixir-wizards/episodes/python-in-elixir-apps-with-victor-bj-rklund/transcription-requests
    Idempotently request low-priority transcript generation for this episode.
  • GET https://stenobird.com/podcast/elixir-wizards/python-in-elixir-apps-with-victor-bj-rklund.md
    Read the agent-friendly Markdown representation of this episode resource.

Summary

Evaluate the trade-offs between different integration patterns for running Python logic within Elixir applications. Learn how to manage the Python Global Interpreter Lock (GIL) and implement fault-tolerant communication using tools like ErlPort and Venomous.

Topics

  • Elixir
  • Python
  • ErlPort
  • BEAM
  • Global Interpreter Lock
  • Interoperability
  • Fault Tolerance
  • Software Architecture

Highlights

  • Main idea: Choose integration methods based on coupling needs, ranging from low-coupling HTTP APIs to high-performance embedded runtimes
  • Practical takeaway: Use process pools (like Poolboy) with ErlPort to mitigate the overhead of starting Python processes and manage the GIL
  • Failure mode: Avoid unhandled exceptions in Python by implementing try-catch logic in Python and pattern matching on results in Elixir
  • Practical takeaway: For low-frequency tasks like monthly reporting, simple ports are a low-risk entry point for using Python's ecosystem
  • Deployment strategy: Consider the complexities of packaging Python dependencies alongside Elixir Mix releases for production stability

Chapters

  1. 1:00 Introduction and Background: Victor Björklund discusses his journey from C and Python to the functional paradigm of Elixir.
  2. 3:30 The Landscape of Python-Elixir Interop: An overview of integration strategies, from decoupled HTTP APIs to embedded runtimes like PythonX.
  3. 6:10 Managing the Global Interpreter Lock: Strategies for handling Python's GIL and using process pools to maintain concurrency in Elixir.
  4. 8:30 Structuring Integration for Success: How to design communication patterns and manage pools of ports for efficient resource usage.
  5. 13:30 Leveraging the Python Ecosystem: When to reach for Python: using mature libraries like Scrapy when Elixir-native alternatives don't exist.
  6. 16:15 Error Handling and Fault Tolerance: Implementing robust error boundaries across the BEAM and Python boundary using try-catch and pattern matching.
  7. 21:20 Performance and Tool Selection: Comparing the speed and complexity of PythonX versus ErlPort for different project requirements.
  8. 24:20 Real-world Case Study: BankID: Discussing the complexities of integrating Swedish authentication protocols within a multi-language stack.