3 ms·
The main problem with nim is that you can't really pair it with Python whereas you can have Rust and Python call each other if you want.
by the_mitsuhiko 11y ago
The main problem with nim is that you can't really pair it with Python whereas you can have Rust and Python call each other if you want.
- Siecje 11y agoCan you expand on why that is?
- untothebreach 11y agoJust a guess, but it is probably because they each have their own GCs, and that makes it harder* to ensure that objects created in language A, from language B, haven't been collected when language B needs them again. * harder, but not impossible
- the_mitsuhiko 11y agoNim requires a runtime to operate. Figuring out how to safely share the runtime between different Python extensions requires the cooperation of all of those extensions. You probably also need to move all nim code into a thread.
- chrisheller 11y agoHave you played around with Nimborg? That allows embedding Python in Nim fairly easily. https://github.com/micklat/NimBorg https://github.com/micklat/NimBorg I've been able to call into the Nim side from Python by treating the Nim code as C functions to call. That works, but it would be interesting to come up with a more Pythonic way of doing that.