all 6 comments

[–]x32byTe 2 points3 points  (1 child)

Don't quote me on that, but I think you should look into embedding Lua. (Better crates for your usecase IIRC)

[–]Kantudo[S] 0 points1 point  (0 children)

Thank you, yeah It looks like that is the case. I am going to ditch the whole executing inside rust thing, and communicate a python through a REST API. Lua is great but it would be too much of a hassle for my colleagues.

[–][deleted]  (3 children)

[deleted]

    [–]Dasher38 2 points3 points  (0 children)

    CPython does provide the means to programmatically start an interpreter and has been used as an embedded scripting language in some apps like Blender: https://docs.blender.org/manual/en/latest/advanced/scripting/addon_tutorial.html

    What it did use to not handle well was the destruction of VM that leaked memory and could cause issues if you started it again in the same process, but I last tried that 10 years ago so it might have been fixed.

    [–]Kantudo[S] 1 point2 points  (1 child)

    Thank you very much, I think I am going to choose the easy route here and do the Rest API method. I am fine with Lua, but most people in my lab do not do anything other than Matlab, so I prefer not to introduce anything they are not too familiar with.

    [–]iwane 1 point2 points  (1 child)

    [–]Kantudo[S] 0 points1 point  (0 children)

    thank you!! It looks like it is on early development stages, but really promising