Does anyone have practical experience with replacing small parts of a python stack with clojure? (as in "I've done this at my company", not "clj-python exists") I've encountered certain problems in a project, that scream for being solved in clojure while solving them in python, even with toolz, is painfully verbose.
I've done it, yes. Gradually migrated the whole backend of a complex CMS from Python to Clojure.
Sweet. Care to share more details?
Since the eventual plan was to go full Clojure anyway, I didn't try to make the layer between Clojure and Python anything more than "it works".
The whole app is pretty much a stateless collection of mostly independent and sometimes communicating processes (in the conceptual sense), so I just wrote all the plumbing in Clojure and called the remaining Python functions by shelling out and calling something like python -m ... and feeding it serialized data. The performance was acceptable for that case, and eventually it got rewritten in Clojure anyway.
Good to know that this can work. That'll certainly help me to avoid letting perfect become the enemy of good:)
But I think that was before libpython-clj. Nowadays I'd probably use that.
All the way till the first hiccup, because those tend to consume way more time than just the head-on dumb python -m ... with de/serialization.
What do you mean by hiccup here?^^
Anything that doesn't work the way you'd expect it to work. It's easy to imagine something like a weird type or maybe a bug in libpython-clj that somehow surfaced only in your app and not before that just prevents you from proceeding and forces you to either use a different approach altogether or spend an unknown amount of time figuring that issue out. I'd go immediately with the former in this case since it's a short-term thing.
Maybe #basilisp is an option, although I don't think it's production ready yet π
I was also wondering about how basilisp might fit there. Iβm curious to try interop especially for machine learning stuff. I understand people are using basilisp in production already, though it isnβt that mature.