r/cpp • u/kindredseer • 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
View all comments
Show parent comment
1
u/zerhud Sep 18 '26
Hmm.. it would be nice
Reasons why I want cpp as script language:
- all project described in cpp (for example all services are items in ct vector with info about services) and i have all needed headers
- I can use memory (own storage instead of new, for example)
- I cannot create so
- it’s possible to use platform’s methods
If all scripts tasks is just std::print it seems some script language would be better. But the cpp has an growing potential, it seems
As reference I use wasm: it’s a cpp instead of js and there is a lot of trouble with row wasm.