Hacker News new | ask | show | jobs
by capableweb 2243 days ago
> Does this serialize functions to be sent over the wire?

That seems to indeed be one of the use cases.

> If so, why can't I just assign the function to a variable directly?

Clojure doesn't really have variables as you're used to it (I'm assuming your experience here). Instead, Clojure has Var, Refs, Bindings and more constructs. You can read about them here: https://clojure.org/reference/vars

> In the short-description it says "Function serialization between Clojure processes and dialects" but I can't find any example of using this cross-process-border in the readme.

It doesn't just have to be cross-process but cross-dialect. As Clojure has multiple runtimes (like JVM [most popular], JavaScript and CLR). So one use case of this library could be to have a frontend made in ClojureScript that dynamically requests behavior (functions) from a Clojure (JVM or CLR) backend in a nicer way than just sending the text of the function then calling `read` (that reads text into actual code).

> Though I applaud you for writing with an interesting vibe, I can't seem to get what you're describing.

But in the end, I agree with you. The author could make the use cases more clear and interesting, as that seems to be missing from the readme currently. What would be most interesting is not all the possible use cases, but the specific use case the author had in mind when writing this. What kind of interesting thing is the author building?

1 comments

Thanks! I've indeed used clojure for some personal projects.

Didn't think about requesting code from the Backend to the Frontend, which sounds like a reasonable use case.

However this hasn't been posted by the author as it seems so there probably won't come any answer about their use case.