Evaluating a script at runtime with the VM is pretty straightforward, but bridging the VM and your host program so they can pass data and call into each other is a bit more complicated. The tcompilerapi.nimtest in the nim repo is an example of how this can be done. Also, PMunch has an excellent 3 part blog serieson embedding the VM, and ElegantBeef wrote nimscripter, which simplifies the process quite a bit.