Hi,
I really like idea of Crystal, but pretty much all small scripts nowadays I am forced to write in Python. Not because I like it, but because I have very high probability of finding libraries automating 80% of work I need to do.
It would be great if I could use Crystal as primary script language and delegate some operations to Python libraries.
Is anybody working on something like that?
Unfortunately, I think that using Python in such a way would be such a clusterf* that it would more than nullify any advantage of these libraries.
And this is coming from the #1 fan of Python.
Also this is probably not the best place to ask a question that isn't about the core language. Try the forums or crystal-libraries-needed
I think Pyhton bindings are possible via C, but then it'll be just calling eval or similar from Crystal to Python and I don't know how you would communicate data back and forth. As @oprypin says, it's probably a recipe for a hard time, it might be easier to write whatever lib you need in Crystal. And yes, this is more a question for the forums, so closing.
To be fair, I think if Python bindings are approached in the same way as C bindings (binding generator or similar - with statically defined methods and types), then it could work. Still a ton of work and little flexibility.
And two separate garbage collectors 馃槄
Maybe worth mentioning, there has been some success in embedding other runtimes:
JS (via duktape): https://github.com/jessedoyle/duktape.cr
Lua (via liblua): https://github.com/veelenga/lua.cr
You might try one of those if you're looking to run scripts in a Crystal app, or maybe just to give them a try to see how embedding another rt works in practice.