SWIG

SWIG

Infobox_Software
name = SWIG
developer = SWIG developers
latest_release_version = 1.3.36
latest_release_date = June 24, 2008
operating_system = Cross-platform
license = BSD licenses
website = [http://www.swig.org/ www.swig.org/]

SWIG (Simplified Wrapper and Interface Generator) is an open source software tool used to connect programs or libraries written in C/C++ with scripting languages such as Tcl, Perl, Python, Ruby, PHP, Lua, R and other languages like Java, C#, Scheme and Ocaml. Output can also be in the form of XML or Lisp S-expressions

How does it work?

The aim is to achieve the connection between the programs and the scripting languages with minimal effort: a small number of directives are added to the program's header files, and then the SWIG tool creates source code which provides the glue between C/C++ and the target language. Depending on the language, this glue comes in three forms:
* an executable that behaves like the original program but embeds an interpreter for the scripting language,
* a shared library that an existing 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 JNI in Java).

Purpose

There are two main purposes of embedding a scripting engine into an existing C/C++ program:
*The program can then be customized much more quickly, using the scripting language rather than 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 quite useful to write testing scripts.

There are several reasons to create dynamic libraries that can be loaded into existing 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

SWIG is written in C and C++ and has been publicly available since February 1996. The initial author and main developer was Dave 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 BSD type license, meaning it can be used, copied, modified and redistributed freely, for commercial and non-commercial purposes.

See also

*Foreign function interface

External links

* [http://www.swig.org/ Project home page]
* [http://swig.sourceforge.net/index.html Project home page] at SourceForge
* [http://www.dabeaz.com/cgi-bin/wiki.pl SwigWiki] - Wiki containing information about using SWIG.
*Article " [http://codeguru.com/csharp/.net/net_asp/scripting/article.php/c11103/ Expose Your C/C++ Program's Internal API with a Quick SWIG] " by Victor Volkman
*Article " [http://www.geocities.com/foetsch/python/extending_python.htm Python Extensions In C++ Using SWIG] " by Michael Fötsch
* [http://citeseer.csail.mit.edu/cs?q=SWIG Citations from CiteSeer]
* [http://www.skwash.com/ sKWash: the open source SWIG GUI]

* [http://language-binding.net/pyplusplus/pyplusplus.html Py++] - an object-oriented framework for creating a code generator for [http://www.boost.org/libs/python/doc/index.html Boost.Python] library


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • SWIG — Тип Инструмент для разработки Разработчики Сообщество Написана на C, C++ Операционная система POSIX, MS Windows Последняя версия 2.0.4 (21 мая 2011) Лицензия …   Википедия

  • Swig — Тип Инструмент для разработки Разработчики Сообщество ОС MS Windows Версия 1.3.33 23 ноября 2007 Лицензия Лицензия в стиле BSD Сайт …   Википедия

  • SWIG — (Simplified Wrapper and Interface Generator) ist ein Programmierwerkzeug, das in C oder C++ geschriebene Module für andere Programmiersprachen, insbesondere Skriptsprachen, verfügbar macht. SWIG ist ein Open Source Projekt und… …   Deutsch Wikipedia

  • Swig — Swig, v. t. [Cf. D. zwelgen to swallow, E. swallow, v.t.] 1. To drink in long draughts; to gulp; as, to swig cider. [Colloq.] [1913 Webster] 2. To suck. [Obs. or Archaic] [1913 Webster] The lambkins swig the teat. Creech. [1913 Webster] …   The Collaborative International Dictionary of English

  • swig — [swıg] v past tense and past participle swigged present participle swigging [T] informal to drink something in large mouthfuls, especially from a bottle = ↑gulp ▪ He sat swigging beer and smoking. >swig n ▪ She took a long swig of coke …   Dictionary of contemporary English

  • Swig — Swig, v. t. [Cf. Prov. E. swig to leak out, AS. sw[=i]jian to be silent, sw[=i]can to evade, escape.] 1. To castrate, as a ram, by binding the testicles tightly with a string, so that they mortify and slough off. [Prov. Eng.] [1913 Webster] 2.… …   The Collaborative International Dictionary of English

  • swig — [ swıg ] verb intransitive or transitive INFORMAL to drink something from a bottle, can, glass, etc. carelessly and in large amounts ╾ swig noun count …   Usage of the words and phrases in modern English

  • swig — swig·gle; swig; swig·ger; …   English syllables

  • Swig — Swig, n. 1. A long draught. [Colloq.] Marryat. [1913 Webster] 2. (Naut.) A tackle with ropes which are not parallel. [1913 Webster] 3. A beverage consisting of warm beer flavored with spices, lemon, etc. [Prov. Eng.] [1913 Webster] …   The Collaborative International Dictionary of English

  • SWIG — (de l anglais Simplified Wrapper and Interface Generator) est un outil dont le code source est libre. Il permet de connecter des logiciels ou bibliothèques logicielles écrites en C/C++ avec des langages de scripts tels que : Tcl, Perl,… …   Wikipédia en Français

  • swig — [swig] Informal vt., vi. swigged, swigging [< ?] to drink, esp. in great gulps or quantities n. an instance of swigging; deep draft, esp. of liquor swigger n …   English World dictionary

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”