Hey, We are using Kotlin/Java at work and often I would like to fire up a REPL and inspect some state in our service. Is it possible to start a Clojure REPL alongside Spring Boot?
@jherrlin I would also like to put a repl in Spring Boot. Is there anything you can share about doing that?
Hi guys. A "bit" late to join your 2023 party 🥳, but it seems that Spring / JPA / Hibernate stack will stick with us to our last days 😅.
So FYI: there was this nice article by Jakub Holy from 2019 https://engineering.telia.no/blog/java-troubleshooting-on-steroids-with-clojure-repl, showcasing the integration you were discussing.
Inspired by that article (& really nice flow using clojure nrepl + clojure-mcp + LLM agent), last week I created Livewire: https://brdloush.github.io/livewire/
It's a spring (boot) - aware embedded REPL I always wished to have, but never bothered to invest time to build it from scratch 🙂
• It primarily started (and is continuing to be) as an experiment figuring out "how far can you get without restarting". And live inspection. And who knows what else.
• So far, I'm really pleased by the result 🎉
• Agents these days are quite clever and given "new toys to play with", they immediately start using them in very interesting ways.
â—¦ Biggest impact: agents start to test their own theories and hypotheses by writing and evaluating temporary clojure code. You can even choose "No.. and tell them to test their hypotheses in REPL before writing the final code.". They will.
â—¦ Even if you ask them a totally random question like "is query behind this endpoint an efficient one when it comes to DB indexes", they will figure out a way to query that database with explain or explain analyze. Even if you don't feed them a livewire repl, they will do their best to access that DB of yours.
◦ Always think about what you're accepting. Consider if you can allow that agent to see the data it's accessing, commenting and using. You have been warned 🙂
@mathpunk I havent had the time to do anything yet so atm I have nothing to share
It is. Include the clojure jar + nrepl jar and start an nrepl server with interop
There would be more steps to actually poke at the state in spring, but idk what they would be
Nice! Is it straight forward? Do you have examples?
Eh, sorta? And no
I have some examples of interop
But not doing that specifically
Yeah I am a bit afraid that Spring will hide stuff for me. Time will tell
Thx! I figure it out