clojure

2025-11-10T09:17:08.993399Z

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.

p-himik 2025-11-10T09:19:52.486719Z

I've done it, yes. Gradually migrated the whole backend of a complex CMS from Python to Clojure.

2025-11-10T09:46:20.454879Z

Sweet. Care to share more details?

p-himik 2025-11-10T10:16:20.930709Z

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.

2025-11-10T10:25:09.453269Z

Good to know that this can work. That'll certainly help me to avoid letting perfect become the enemy of good:)

πŸ‘Œ 1
p-himik 2025-11-10T10:30:24.564229Z

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.

2025-11-10T10:51:13.788709Z

What do you mean by hiccup here?^^

p-himik 2025-11-10T11:28:30.997799Z

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.

Mateo Difranco 2025-11-10T15:02:02.830419Z

Maybe #basilisp is an option, although I don't think it's production ready yet πŸ™‚

πŸ‘ 1
sventechie 2025-11-11T19:14:34.951069Z

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.