A simple interpreter for implementation and expansion inside a C ++ Windows application

I need a simple interpreter that will perform (evaluate) simple expressions / operators, and also call functions from main C ++ applications. At the moment, I do not need to create application scripts, but may be useful later.

It is also necessary that other team members can pull my application from the source repository and build it, without having to install an additional application, libraries, etc. Search for new options: Python (via Boost and / or Python API), Lua, Guile, TinyScheme.

I'm closest to Python, but using Boost to create the Python library, the complex task of pairing the main application with Python makes this choice unnecessary, maybe I'm wrong.

There should be a simple solution for this request, what are your impressions and suggestions?

+3
source share
4 answers

Two great options that you have already indicated are Python and Lua. Here are some of the tradeoffs for your consideration:

Python

  • A more complete and powerful language (IMHO!) With libraries for anything, as well as many support and communities around the world.
  • Syntax is not fully C-like
  • Although Python was not specifically designed for embedding (it is much more commonly used as a stand-alone language, extended by C / C ++ code), it is very difficult to implement. The white papers contain some examples, and the following Boost examples should not be much more complicated.

Lua

  • , .
  • C-, Python

, - , , . , , , .

+4

, ae, Lua .

+3

, (, , Python), SWIG (www.swig.org), ++. ++ python ( ruby, lua, guile, ), .

boost:: python, , , Python/++ ( , ). , , SWIG , scads python, Python distutils.

+2

Guile , , .
libguile lib guile .
guile Windows.

+1

Source: https://habr.com/ru/post/1768762/


All Articles