This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-22
Channels
- # announcements (3)
- # babashka (6)
- # beginners (29)
- # calva (10)
- # cider (14)
- # clj-kondo (67)
- # cljfx (6)
- # clojure (34)
- # clojure-australia (1)
- # clojure-europe (46)
- # clojure-italy (5)
- # clojure-nl (3)
- # clojure-spec (6)
- # clojure-uk (27)
- # clojured (1)
- # clojurescript (26)
- # conjure (14)
- # cursive (5)
- # data-science (1)
- # datomic (26)
- # deps-new (10)
- # editors (1)
- # events (2)
- # fulcro (23)
- # graalvm (41)
- # honeysql (5)
- # introduce-yourself (1)
- # jobs (1)
- # jobs-discuss (1)
- # luminus (2)
- # malli (22)
- # meander (5)
- # observability (3)
- # podcasts-discuss (1)
- # rdf (3)
- # re-frame (27)
- # remote-jobs (7)
- # reveal (6)
- # shadow-cljs (45)
- # xtdb (8)
What’s the best way of reading a Clojure source code file (.clj) from disk so that you also get the metadata back?
i think i know what you're talking about. have it on the classpath and require
it. this lets source, doc, and line numbers work correctly. if it just sends all the forms through the repl you won't have all those goodies
Yeah, you pretty much have to execute it (`require`) so that the Vars get all the correctly computed metadata…
Okay, thanks!
@tengstrand if you're not interested in evaluated metadata, then you could just use the reader and no eval
if you're interested in preserving more information, you could also look at rewrite-clj
Okay, thanks for the tip! I need to read an external .clj file and get metadata, like clojure doc strings, back. I guess that library will solve that. I will have a look.
@tengstrand Example:
$ clojure -M:clj-kondo/dev --lint src/babashka/main.clj --config '{:output {:format :edn :analysis true}}' > /tmp/analysis.edn
$ cat /tmp/analysis.edn | jet --pretty --func '(fn [json] (->> json :analysis :var-definitions (filter :doc) (map (juxt :ns :name :doc))))'
([babashka.main
musl?
"Captured at compile time, to know if we are running inside a\n statically compiled executable with musl."])
Sure, will have a look at it later. Thanks.
I'm writing a blog post that touches on how tools like the Clojure CLI and leiningen
work and have been looking at some early Clojure documentation to figure out what people did before those tools existed. It looks like you could run a script using java -cp clojure.jar clojure.lang.Script script.clj
(this is officially deprecated, but still works as of Clojure 1.10.2). Was this the common approach? I assume people also started applications from the REPL? Leiningen and the first stable release of Clojure came out the same year (2009), so my guess is that people weren't using many dependencies pre-Leiningen.
I remember using ant
back in.... 2010 or 2011? I believe that was the "official" way of managing a clojure project, but how you obtained the dependencies was up to you - mostly by downloading jars and figuring out the classpath
Yeah, looking at some early commits to Compojure, it suggests using ant
to install the dependencies: https://github.com/weavejester/compojure/tree/0.3
I used (and all the contrib libs still use) the clojure-maven-plugin with Maven
I used maven as a build tool / test runner, swank to connect to a repl and some custom shell scripts for some more specialised jobs. It worked great for years, and I didn't actually migrate to lein till something like 2015. I was working at a startup and switching build tools just never got to the top of our priority list. But I came from a java background and was already comfortable with mvn.
Thank you for all the responses!
Hi - I have a long running Clojure process running on JVM Java 1.8 and the non heap memory is growing linearly. Has anyone any experience of this and/or methods of finding the culprit ?
you can use visualvm or https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#getAllStackTraces() to get a count of the active threads, the stack of each counts as non-heap memory
Thanks for the quick replies. https://metrics-clojure.readthedocs.io/en/latest/jvm.html is being used to monitor the memory.
Does anyone here have some experience integrating Okta into a Clojure web-app? Did you use any libraries or wrote your own stuff?
Can't claim much experience, but there's this: https://github.com/metabase/saml20-clj
Working to deploy our first Datomic Ion based application. It is a continuously running process that ingests information, processes, and stores in Datomic. My understanding is that ion's are typically called via AWS Lambda's on some event. Yet in this case I just want to deploy the application and have it start running (and stay running). (ie. call the run function which runs and sleeps on a 30 min cycle). Tips on the best way to achieve this? Do I need to make a Lambda initial trigger or is there a way to have it launch and run automatically / continuously?
@U025VPS4R7U If you haven’t already, you might have more chance of an answer in either #datomic or #ions-aws I suspect
Also, I believe Cognitect/Nubank do most of their actual support via https://forum.datomic.com/
Great, thanks for the suggestion! I missed finding those channels when I searched earlier.
For any others that have this question, ended up using CloudWatch time based triggers to kickoff running the lambda every 30min instead of controlling the timing from within the application.
For any others that have this question, ended up using CloudWatch time based triggers to kickoff running the lambda every 30min instead of controlling the timing from within the application.