Languages such as PHP, Perl, Python and Ruby are primarily used as standalone languages, but have support for using C or C++ modules.
The first thing necessary is to generate a module for the target language, this is where SWIG again helps us. Please see the SWIG documentation for examples on creating, testing and using a module.
The steps for using one of these languages inside your application is very similar to that of using one of the languages designed for embedding.
The main difference between these languages and the languages designed for embedding is the extra work to compile and distribute the language specific module which adds your applications API to the scripting language. SWIG provides the standard SWIG_init, SWIG_NewPointerObj and SWIG_ConvertPtr helper functions mentioned in the previous section to help with many of these steps.
These languages tend to each have a different prefered method of compiling a module and integrating these compilation methods into an existing project can be difficult.
Specific resources regarding compiling language modules is covered in the next section.
Recent comments
16 hours 22 min ago
1 day 22 hours ago
2 days 7 hours ago
1 week 4 days ago
2 weeks 1 day ago
2 weeks 3 days ago
3 weeks 14 hours ago
3 weeks 14 hours ago
3 weeks 2 days ago
4 weeks 8 hours ago