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/kindredseer Sep 18 '26

I’ve been programming for over 40 years and working on this project for seven years. Just because I’m using Claude to grind through the test suites doesn’t make me an amateur. Everyone is using AI these days (except for Andrew Kelley and friends).

5

u/PressWearsARedDress Sep 18 '26

Talk is cheap, show me the code

0

u/kindredseer Sep 18 '26

It uses the c++ library on your system (libstdc++ for Linux and Windows, libc++ for MacOS).

It supports x86, aarch64, ppc64le/s390x and riscv64. It comes in embeddable library form, standalone JIT binary and AOT compiler.

It currently supports about 98% of C23, 70% of C++11, 47% of C++14, 38% of C++17, 51% of C++20. It's a work in progress.

https://github.com/derekbsnider/madc