yaml / yamlscript

Programming in YAML
MIT License
402 stars 31 forks source link

C++ bindings #195

Open loonycyborg opened 5 days ago

loonycyborg commented 5 days ago

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.

ingydotnet commented 5 days ago

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 commented 5 days ago

I'll also look at pybind11 for examples

loonycyborg commented 5 days ago

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 commented 5 days ago

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.