swig
« Back to VersTracker
Description:
Generate scripting interfaces to C/C++ code
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: c-plus-plus bindings cross-language code-generation development
Install: brew install swig
About:
SWIG (Simplified Wrapper and Interface Generator) is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. It works by parsing C/C++ header files and automatically generating wrapper code to enable cross-language integration. This allows developers to reuse existing C/C++ libraries while scripting in languages like Python, Ruby, or JavaScript.
Key Features:
  • Automatic wrapper generation from C/C++ headers
  • Supports multiple target languages including Python, Java, and Go
  • Handles complex C++ features like classes, templates, and overloading
  • Extensible via typemaps for custom data type conversions
Use Cases:
  • Creating Python bindings for existing C++ libraries
  • Exposing C functions to scripting languages for automation
  • Integrating legacy C code into modern web applications
Alternatives:
  • Cython – Python-specific, better for Python-C integration but less language-agnostic
  • pybind11 – Modern C++11 focus, seamless Python interoperability but C++ only
  • cffi – Python-focused, simpler for C but lacks C++ support
Version History
Detected Version Rev Change Commit
Oct 26, 2024 9:53pm 0 VERSION_BUMP 1b6d67d0
Oct 4, 2024 8:47pm 0 VERSION_BUMP d431cb1b
Oct 4, 2024 1:06pm 0 VERSION_BUMP 1aeba0a6
Sep 17, 2024 1:49am 0 VERSION_BUMP d68a6bc0