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

1

u/zerhud Sep 18 '26

Yep, use cpp mostly.

So, it depends on tasks: can I use platform methods (for example mmap some file or open a socket)? How pointers are handled (what if a can manipulate it and got some data)? If it all is ok, why I cannot use an so?

Why js: it easy to control, easy to embed and it’s not so plain as lua, also everybody knows the language

Why not cpp: if a can write a script on cpp i can create an so, it would be better for me (imho)