Fork me on GitHub
#off-topic
<
2022-11-05
>
teodorlu09:11:34

Out of pure curiosity, are anyone of you running a Clojure application that you've written yourself as a "service" on your own system? If yes, why? Context: I've spent lots of time understanding and tweaking my Linux system. Lots of configuration, lots of shell scripts. I've started migrating stuff to babashka. But there are some things that I want a JVM for. For instance if I want to work with some kind of virtual file system (FUSE). And I don't want to keep starting and restarting the JVM all the time. So why not just keep it running? Sort of like the old smalltalk systems. And just expose an NREPL port so that I can tweak it on the fly.

Ben Sless09:11:01

I would do that if dynamically adding dependencies was more officially supported

💯 4
teodorlu09:11:14

Yeah - having to restart to pick up new deps is definitely a drawback.

Ben Sless10:11:08

That's actually a case where I'd want dynamic deps and conditions/restarts, because that process shouldn't die on me no matter what

👍 1
1
Ben Sless10:11:55

If I were to use it like an operating system, it might have several threads busy doing other things I won't want to lose

👍 1
1
teodorlu10:11:28

Right - we want to be able to rely on the process finishing what it's doing. If the system is syncing some data in the background, I don't want to corrupt the state just because I'm restarting to add in a new dependency.

borkdude10:11:31

@U3X7174KS nbb may also help here: you can add npm deps at runtime and load them with nbb. it supports nrepl

teodorlu10:11:48

Huh, interesting. Didn't know that. Thanks!

borkdude10:11:40

and it will likely also use less memory than a JVM - although with a reasonably sized laptop this isn't likely a problem with a JVM either

👍 1
borkdude10:11:36

for deps.edn there is the add-lib branch for adding deps dynamically

borkdude10:11:02

#C1DV21X9P have some libs around this as well I think - but not the "official" tooling

👀 1
teodorlu10:11:20

> for deps.edn there is the add-lib branch for adding deps dynamically > Are you talking about JVM Clojure now?

borkdude10:11:33

(I've never tried it myself)

teodorlu10:11:00

Gotcha. Thank you! Reading up on https://github.com/lambdaisland/launchpad now. This is interesting+useful.