yamlscript icon indicating copy to clipboard operation
yamlscript copied to clipboard

C++ bindings

Open loonycyborg opened this issue 1 year ago • 4 comments

Although you can just use YS C api from C++, there's some value in easing access to C++ objects from YS code by mapping them to YS concepts somehow, in same way as pybind11 maps C++ objects to python objects.

loonycyborg avatar Nov 21 '24 04:11 loonycyborg

Can you tell me more exactly something you'd like to do with YS and c++?

I'm assuming you want to access a shared library from ys code, but maybe it's something else.

ingydotnet avatar Nov 21 '24 05:11 ingydotnet

I'll also look at pybind11 for examples

ingydotnet avatar Nov 21 '24 05:11 ingydotnet

I want to access api of the program that embeds YS, and also to make particular C++ variables/objects accessible depending on location in the yaml structure.

loonycyborg avatar Nov 21 '24 05:11 loonycyborg

In python when you eval something you can provide your own locals and globals, thus you have control on what variables that code piece sees. I'm not sure how easily such control is accessible in YS in general.

loonycyborg avatar Nov 21 '24 05:11 loonycyborg