q2K BHP
Black History Portal
THE BHP WIRE —
HIDDEN TRUTHS
What's New!
THE JOURNEY THROUGH TIME

Explore Black History

Explore the people, places, events, achievements, struggles and stories that shaped our journey.

✊🏾

Civil Rights

Movements, leaders, victories and the continuing fight for equality.

⚙️

Black Inventors

Innovation, patents, science, technology and world-changing contributions.

🏆

Sports

Pioneers, champions, Negro Leagues, records, activism and excellence.

♟️

People

Meet the people whose lives, choices and achievements shaped the journey.

📍

Places

Black towns, communities, institutions and places where history happened.

📜

Events

Moments that changed communities, movements, institutions and the nation.

Enter a person, place, event, or topic.
MY'STORY

The MOVE Fire

This is a personal recollection on the Move fire on May 13, 1985 Philadelphia police fired thousands of rounds at the MOVE house, city officials approved dropping an explosive device on the roof, the resulting fire was allowed to burn, 11 people—including five children—died, and 61 homes were destroyed. Philadelphia City Council later called it a “brutal attack carried out by the City of Philadelphia on its own citizens” and acknowledged that no individual faced criminal consequences for the bombing. One timeline correction worth preserving for the BHP record: the major previous MOVE-police confrontation was August 8, 1978, about seven years before the bombing, not a year or two earlier. Officer James Ramp was killed, other police and firefighters were wounded, nine MOVE members were later convicted, and television cameras recorded police beating Delbert Africa during his arrest. The 1985 MOVE Commission later specifically criticized city planners for failing to adequately use lessons from that 1978 confrontation. And that actually strengthens the point you’re making: 1985 did not happen without precedent or institutional memory. There had already been a deadly confrontation with MOVE, years of conflict, negotiations and police involvement before Osage Avenue.

MORE →
BLACK FACTS
The Truths They Never Taught You...

Katherine Johnson — Mathematics to the Moon

Katherine Johnson’s mathematical calculations helped guide some of America’s most important early space missions while she confronted the racial and gender barriers faced by Black women in twentieth-century America.

MORE →
BHP gathered finds from its connected research sources. Showing the 4 strongest Black History matches.
← BACK TO RESULTS
Wikipedia

SWIG

SWIG
Original authorDavid M. Beazley
DeveloperSWIG developers
ReleaseFebruary 1996; 30 years ago (1996-02)[1]
Stable release
4.5.0[2] Edit this on Wikidata / 6 August 2026; 2 months ago (6 August 2026)
Written inC, C++
LicenseGPLv3
Websiteswig.org
Repository

The Simplified Wrapper and Interface Generator (SWIG) is an open-source software tool used to connect computer programs or libraries written in C or C++ with scripting languages such as Lua, Perl, PHP, Python, R, Ruby, Tcl, and other language implementations like C#, Java, JavaScript, Go, D, OCaml, Octave, Scilab and Scheme. Output can also be in the form of XML.

Function

[edit]
Files involved when Swig is used for binding C++ to Python[3]

The aim is to allow the calling of native functions (that were written in C or C++) by other programming languages, passing complex data types to those functions, keeping memory from being inappropriately freed, inheriting object classes across languages, etc. The programmer writes an interface file containing a list of C/C++ functions to be made visible to an interpreter. SWIG will compile the interface file and generate code in regular C/C++ and the target programming language. SWIG will generate conversion code for functions with simple arguments; conversion code for complex types of arguments must be written by the programmer. The SWIG tool creates source code that provides the glue between C/C++ and the target language. Depending on the language, this glue comes in three forms:

  • a shared library that an extant interpreter can link to as some form of extension module, or
  • a shared library that can be linked to other programs compiled in the target language (for example, using Java Native Interface (JNI) in Java).
  • a shared dynamic library source code that should be compiled and dynamically loaded (e.g. Node.js native extensions)

SWIG is not used for calling interpreted functions by native code; this must be done by the programmer manually.

Example

[edit]

SWIG wraps simple C declarations by creating an interface that closely matches the way in which the declarations would be used in a C program. For example, consider the following interface file:[4]

%module example

%inline %{
extern double sin(double x);
extern int strcmp(const char *, const char *);
extern int Foo;
%}
#define STATUS 50
#define VERSION "1.1"

In this file, there are two functions sin() and strcmp(), a global variable Foo, and two constants STATUS and VERSION. When SWIG creates an extension module, these declarations are accessible as scripting language functions, variables, and constants respectively. In Python:

>>> example.sin(3)
0.141120008
>>> example.strcmp("Dave", "Mike")
-1
>>> print(example.cvar.Foo)
42
>>> print(example.STATUS)
50
>>> print(example.VERSION)
1.1

Purpose

[edit]

There are two main reasons to embed a scripting engine in an existing C/C++ program:

  • The program can then be customized far faster, via a scripting language instead of C/C++. The scripting engine may even be exposed to the end-user, so that they can automate common tasks by writing scripts.
  • Even if the final product is not to contain the scripting engine, it may nevertheless be very useful for writing test scripts.

There are several reasons to create dynamic libraries that can be loaded into extant interpreters, including:

  • Provide access to a C/C++ library which has no equivalent in the scripting language.
  • Write the whole program in the scripting language first, and after profiling, rewrite performance-critical code in C or C++.

History

[edit]

SWIG is written in C and C++ and has been publicly available since February 1996. The initial author and main developer was David M. Beazley who developed SWIG while working as a graduate student at Los Alamos National Laboratory and the University of Utah and while on the faculty at the University of Chicago. Development is currently supported by an active group of volunteers led by William Fulton. SWIG has been released under a GNU General Public License.

Google Summer of Code

[edit]

SWIG was a successful participant of Google Summer of Code in 2008, 2009, 2012. In 2008, SWIG got four slots. Haoyu Bai spent his summers on SWIG's Python 3.0 Backend, Jan Jezabek worked on Support for generating COM wrappers, Cheryl Foil spent her time on Comment 'Translator' for SWIG, and Maciej Drwal worked on a C backend. In 2009, SWIG again participated in Google Summer of Code. This time four students participated. Baozeng Ding worked on a Scilab module. Matevz Jekovec spent time on C++0x features. Ashish Sharma spent his summer on an Objective-C module, Miklos Vajna spent his time on PHP directors.

In 2012, SWIG participated in Google Summer of Code. This time four out of five students successfully completed the project. Leif Middelschulte worked on a C target language module. Swati Sharma enhanced the Objective-C module. Neha Narang added the new module on JavaScript. Dmitry Kabak worked on source code documentation and Doxygen comments.

Alternatives

[edit]

For Python, similar functionality is offered by SIP, Pybind11, and Boost's Boost.python library.

Projects using SWIG

[edit]

See also

[edit]

References

[edit]
  1. ^ "SWIG History".
  2. ^ "Release 4.5.0". Retrieved 19 August 2026.
  3. ^ Adapted from Ammar Nejati, Mikhail Svechnikov, Joachim Wuttke: Deploying a C++ Software with (or without) Python Embedding and Extension. In Bernoth et al, eds: deRSE24 - Selected Contributions of the 4th Conference for Research Software Engineering in Germany. ECEASST 83 (2025).
  4. ^ "SWIG Basics".
  5. ^ Müller, Marcus. "Changelog for GNU Radio 3.9.0.0". GitHub.

Further reading

[edit]
[edit]

Source: Wikipedia. Article content is retrieved live through the MediaWiki API.

No preview image
Wikipedia

SWIG

The Simplified Wrapper and Interface Generator (SWIG) is an open-source software tool used to connect computer programs or libraries written in C or C++ with scripting languages such as Lua, Perl, PHP, Python, R, Ruby, Tcl, and other language implementations like C#, Java, JavaScript, Go, D, OCaml, Octave, Scilab and Scheme. Output can also be in the form of XML.

MORE →
No preview image
Wikipedia

Swig

Swig may refer to:

MORE →
Wikipedia

Swig Program in Jewish Studies and Social Justice

The Swig Program in Jewish Studies and Social Justice is a Jewish studies program at the University of San Francisco in San Francisco, California. Originally founded in 1977, and re-established in 2008, it is the only program in the world to formally link the fields of Social justice and Jewish studies. It offers a minor in Jewish Studies and Social Justice (JSSJ), an annual Social Justice Lecture, an annual Human Rights Lecture, an annual Social Justice Passover Seder, intermittent films, presentations, and workshops, a study-abroad course, and Ulpan San Francisco.

MORE →
Wikipedia

Simon Swig

Simon Swig (1862 – July 30, 1939) was an American banker, politician and philanthropist.

MORE →
TOPIC OF THE DAY

Greenwood / Black Wall Street

Before the 1921 destruction of Tulsa’s Greenwood District, Black residents had created a remarkable center of business and community life. The district included stores, professional offices, entertainment venues and homes owned by Black citizens. Understanding Greenwood means learning what was built—not only what was burned.

MORE →
TRIVIA QUESTION OF THE DAY

What prosperous Tulsa district became widely known as “Black Wall Street”?

The Greenwood District.