r/cpp • • Sep 18 '26

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.

6 Upvotes

92 comments sorted by

View all comments

Show parent comment

2

u/the_poope Sep 18 '26

You're still gonna compile the code, just by an embedded JIT compiler (which will likely just be GCC/Clang anyway, no?) so will it actually be faster?

If you want to develop and try out a specific part of the code you just write a unit test that does that, no need for hot swapping. Will compile and run in a second if your build system is properly set up.

1

u/kindredseer Sep 18 '26

No, I’m not using gcc/clang/llvm. It’s fully embedded including precompiled system headers.