14: Scripting

Abstract

This advanced topic covers how to expose your C++ application programming interface through a scripting language such as Python, Ruby, Lua, Tcl, or Perl. The reasons you may want to do this are discussed, as well as the issues that you'll face in doing so, such as cross-language compatibility issues. A range of script binding technologies are then presented, including Boost Python, Simplified Wrapper and Interface Generator (SWIG), Python-SIP, Component Object Model Automation, and Common Object Request Broker Architecture. The remainder of the chapter provides practical instruction on how to add Python bindings using Boost Python and Ruby bindings using SWIG. In each case, specifics are covered, such as how to expose ...

Get API Design for C++, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.