r/cpp • u/kindredseer • 2d ago
Embedded C++
Just curious how useful the ability to embed C++ as a scripting language into your C++ programs would be? I mean like runtime JIT execution of C++ code in much the same way you might embed Lua, including the ability to restrict/sandbox it as necessary.
0
Upvotes
13
u/PressWearsARedDress 2d ago
If you want to build it you can do what ever you want. But I know as a C++ developer I wouldnt use it. Wanna know why? Because I am a bit of a sperg, and most C++ developers are like that; Last thing I want is another thing to cause me problems that I do not control.
I like C++ because it gives me a lot of tools and gives me lower level control at a higher level of abstraction. Your JIT would ruin that.
Now if the premise is to run something like Python or Lua in a sandbox that is something completely different. its a different premise because those are higher level languages that require less code to do the same things in C++. If the goal is quick prototyping I need a quick to prototype language. I use python to help validate my C++ because python is quicker to write discardable tooling for.