This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-21
Channels
- # calva (11)
- # cider (4)
- # clojure (15)
- # clojure-europe (20)
- # clojurescript (14)
- # clr (45)
- # conjure (2)
- # cursive (1)
- # fulcro (10)
- # helix (4)
- # honeysql (7)
- # hoplon (21)
- # humbleui (2)
- # hyperfiddle (23)
- # introduce-yourself (1)
- # malli (11)
- # matrix (3)
- # off-topic (6)
- # pathom (2)
- # practicalli (1)
- # re-frame (9)
- # releases (1)
- # specter (2)
- # sql (10)
- # xtdb (2)
Is add-libs from 1.12.0-alpha3 working for anyone? Am I using it wrong? Getting the following error(even when explicitly adding org.clojure/tools.deps as a dependency):
Clojure 1.12.0-alpha3
user=> (add-libs '{ring/ring {:mvn/version "RELEASE"}})
Namespace could not be loaded: clojure.tools.deps
Execution error at clojure.java.process/exec (process.clj:144).
Process failed with exit=1
user=> *e
#error {
:cause "Process failed with exit=1"
:via
[{:type java.lang.RuntimeException
:message "Process failed with exit=1"
:at [clojure.java.process$exec invokeStatic "process.clj" 144]}]
:trace
[[clojure.java.process$exec invokeStatic "process.clj" 144]
[clojure.java.process$exec doInvoke "process.clj" 128]
[clojure.lang.RestFn applyTo "RestFn.java" 140]
[clojure.core$apply invokeStatic "core.clj" 667]
[clojure.tools.deps.interop$invoke_tool invokeStatic "interop.clj" 34]
[clojure.tools.deps.interop$invoke_tool invoke "interop.clj" 14]
[clojure.repl.deps$add_libs invokeStatic "deps.clj" 48]
[clojure.repl.deps$add_libs invoke "deps.clj" 35]
[user$eval1 invokeStatic "NO_SOURCE_FILE" 1]
[user$eval1 invoke "NO_SOURCE_FILE" 1]
[clojure.lang.Compiler eval "Compiler.java" 7177]
[clojure.lang.Compiler eval "Compiler.java" 7132]
[clojure.core$eval invokeStatic "core.clj" 3221]
[clojure.core$eval invoke "core.clj" 3217]
[clojure.main$repl$read_eval_print__9236$fn__9239 invoke "main.clj" 438]
[clojure.main$repl$read_eval_print__9236 invoke "main.clj" 438]
[clojure.main$repl$fn__9245 invoke "main.clj" 459]
[clojure.main$repl invokeStatic "main.clj" 459]
[clojure.main$repl_opt invokeStatic "main.clj" 523]
[clojure.main$main invokeStatic "main.clj" 668]
[clojure.main$main doInvoke "main.clj" 617]
[clojure.lang.RestFn invoke "RestFn.java" 400]
[clojure.lang.AFn applyToHelper "AFn.java" 152]
[clojure.lang.RestFn applyTo "RestFn.java" 135]
[clojure.lang.Var applyTo "Var.java" 707]
[clojure.main main "main.java" 40]]}
What version of Clojure CLI do you have installed?
clojure —version
Yep, upgrading the clojure CLI fixed it. Thanks 🙂 (For reference, was previously on Clojure CLI version 1.10.3.986)
Does anyone have any recommendations for a disk-persisted cache? I am calling a bunch of (expensive, metered) 3rd party API calls and I want to cache them efficiently. I am fine with this being local and on-disk (actually, that would be ideal from a latency perspective). I can reasonably write this with some combo of clojure.core.cache + hasch + nippy or whatever, but it just seems like something other people have written before and might be trickier to do than I think 🙂
There’s https://github.com/shriphani/fort-knox which has been abandoned for a minute, but I’m sure mostly works fine
I tested lots of disk cache libs, including sqlite, #datalevin, and what worked best for clojure-lsp's case was the simple https://github.com/cognitect/transit-clj which is what clj-kondo uses as well. it's fast and easy to use
awesome, thank you! but just to make sure I understand: that library is just the serialization format, right? Meaning it’s a 1:1 replacement for nippy, but doesn’t solve any of the disk or cache parts?
Hum, yes, but there are methods for read and write given a input/outputstream, so you can write to a file and read https://github.com/clojure-lsp/clojure-lsp/blob/master/lib/src/clojure_lsp/db.clj#L49-L74
nippy is faster than transit I believe. There aren't any libraries that I am aware of that actively uses that to build an on-disk cache though. I would be interested in such a library though, it seems very useful.
Is there a way to generate a class from a proxy
with a specific name and not a random generated class name? similar to how proxy+
https://github.com/redplanetlabs/proxy-plus (I can't use it because of https://github.com/redplanetlabs/proxy-plus/issues/19 though)
AFAICS, the name is generated from proxy-name
https://github.com/clojure/clojure/blob/master/src/clj/clojure/core_proxy.clj#L37, which generates something like:
FullSuperClassName$ff19283
I would like to generate as
MyClassName