I'm attempting to create a back end framework to interact with hardware over a serial connection. I need to be able to specify exactly how these hardware modules will interact without recompilation and running on a system with limited resources.
I already have the cpp code that is being re-used that interacts with the hardware and has the broad functionality to send messages to the devices. 
Run-time impact is a serious consideration and it is running on a very limited arch distro that we don't want to change too much for hardware reasons.
It would make the most sense to me to interface with a scripting language that can be easily generated to have a set of references to the cpp base that can be loaded on command.  (Sort of like a plugin system)
Python - is a really good option but I have almost no experience working with embedded python, I have looked into it and I guess where I might be confused is how the interpreted script would link to functionality in the original program without something like pybind11 and embedded python both working together. Binder certainly has a appeal. No Boost please - maybe a little.
LUA - is a robust option that is well tested but a little more difficult to generate on command. LuaBridge also has the functionality that I desire. Biggest concern is run time impact but I'm not an expert of course.
Just make the whole thing in cpp and load libraries like a regular person - solid option but likely the most difficult to generate and run syntax checks on easily.
Make the entire thing in a scripting language and get rid of the overhead of a compiler - I mean technically this is a option
These of course aren't all of the options but this is by far out of my area of expertise and I think it would be beneficial to discuss.
I would really like to know what I should spend my time researching. I have spent far too much time already looking into pybind and I find myself not being able to sleep easy at night.
Ideally this workflow would run somewhat like this:
On the main Controller :

Interface program is run (cpp)
Interface program does diagnostics and checks module status (already done)
Interface checks for run script to execute module functionality

The Script :

Generated from some source
Runs tests to verify generation does not have syntactical mistakes
Gets moved into a folder where the Interface program can grab it (In a "totally" safe way) I'm kidding I know the issues with that setup but we aren't considering it at this moment

That was super long and I'm sorry I'm just very lost and out of my comfort zone.
Yeah I'm sorry I didn't clarify why generated code was important. We built a very simple top level gui to interact with the hardware and that needs to be translated into a script to interact with the main interface for the controller.
Another option I came up with last night:
Write a very simple custom scripting langauge that I can parse on the cpp side and link that way
If you are generating a script, you can probably simplify things to a simple byte code that gets interpreted. Then you don't have to mess with parsing or syntax validation. Each "instruction" can be a simple opcode followed by zero or more operands, where each operand will be an integer, float or string (and any other primitive data types that your hardware supports/needs). You can use something like msgpack for encoding and decoding instructions compactly. 
If that model works, you can gradually add tools on the developer side, such as a minimal assembler, or even a script interpreter that generates the byte code and thus avoids any complexity within your constrained hardware environment.
What is a good way to generate code to interface with a running cpp application that doesn't require a recompile?