This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-28
Channels
- # beginners (33)
- # cljs-dev (9)
- # cljsjs (1)
- # cljsrn (5)
- # clojure (123)
- # clojure-uk (2)
- # clojured (1)
- # clojurescript (11)
- # datomic (71)
- # defnpodcast (2)
- # dirac (8)
- # emacs (35)
- # events (4)
- # figwheel (7)
- # fulcro (29)
- # hoplon (6)
- # immutant (1)
- # keechma (4)
- # lumo (43)
- # nyc (1)
- # off-topic (16)
- # om (1)
- # onyx (9)
- # re-frame (12)
- # rum (15)
- # shadow-cljs (18)
- # spacemacs (1)
- # sql (6)
- # uncomplicate (1)
- # unrepl (5)
- # vim (1)
usually, the code in the buffer itself sets the ns, when you use load-file or load-string that change is not propagated back to the containing repl though
is https://clojurians-log.clojureverse.org - "dead"? the latest page for #clojure is 2017-11-16.html
@noisesmith as per @alexmiller, there is better way to get from sym to qualified keyword:
(keyword `foo/bar-baz)
The only downside is – 2-fold "api", instead of just 1-fold sym->kw
macro call. Requires more attention.I have an immutant app, which has many handlers responding to web requests. These pull out some data, generate some html and store some stuff in datomic. When it hands off to the browser, nothing is left hanging in memory. And still, once per day, sometimes twice, the entire system crashes due to the GC spinning out of control. What am I looking for?
> When it hands off to the browser, nothing is left hanging in memory. do you have proof of this?
doesn't datomic implicitly use a local cache so that you'd have to make new dbs and let the old be gc'd or else the other facts are sticking around in memory?
datomic does keep a local cache, but Im not sure its enough to shred a 4gb heap. I hope not
anyway, the easiest way to answer your question is attach a profiler agent to the app, then look at the resulting file in a profiler
you can probably find a decent answer well before generating a 4gig+ memory dump
there's also hprof which iirc both yourkit and visualvm can load up
Immediately after accessing a few backend pages there's a huge pile-up in the heap, and GC'ing manually does not resolve. That indicates heads are being kept intentionally, and that might very well be datomic
Confirmed from the heap-dump. Datomic caches 2gb of string-data as soon as its taken into use
wow - maybe 4gb is just too small for an app using datomic then?
From their own configs they use objectCacheMax thats about 10% of the JVMs xmx, meaning mine is about 200mb too high. But this is fiddling and guesswork
this page is 404 on http://clojuredocs.org (but other 1.9 functions aren’t) https://clojuredocs.org/clojure.core/swap-vals!
@laujensen that's pretty normal looking to me. Datomic (by default) uses 1/2 of your heap as a cache
if you're seeing a lot of garbage it may be due to cache churn, in which case you need to look into the size of your data compared to the size of your heap. How many datoms are in your DB and how many are your queries looking at, and how big are the values?
If you notice, your heap usage pretty much sits right at 2GB, which is 1/2 of a 4GB heap.
And there's several layers of caching in Datomic, I've haven't seen large caches hurt performance any, except when it comes to GC times.
@tbaldridge, thanks for weighing in. We've had a length discussion in #datomic with stuart and I think we've got an overview of what needs to be done
Do we have a fast hashing algorithm in clojure, preferably not prone to collisions?
Awesome
https://pragprog.com/search > search Clojure
- probably not
On the same note, I think I asked it before in the beginners channel ― does anyone have outstanding experience tutoring team members with clojure, if they have had little programming experience before (e.g. data scientists not hard core programmers)
I am somewhat reticent passing on clojure to some people, because of the heavy stumbling upon on Java classes and Java concepts that creep up a lot, specifically the weakly usable error messages that refer to java classes of clojure constructs
@matan, Ive struggled quite a lot with that. It looks to be very individual. If the person is smart and persistent, he'll figure it out, despite the "error messages". If not, it'll be an uphill battle. Java experience is a big plus, more so than fp it seems.
You kind of confirm my concerns. Our smart people over here have enough layers of challenges stacked to keep their neurons busy, learning Java through cryptic error messages about Java classes would be a waste of their attention 😉
@laujensen I appreicate the candor feedback!
Probably. On the other hand. Anyone who can dechiper "NO TRACE (:0) is worth investing in 🙂
I've written maybe a total of < 1000 lines of Java in my entire life -- all of it as part of some undergrad course -- and I found Java to be no problem in debugging Clojure errors.
Then, upon getting an error, having a nice IDE (like cider) which lets you view the stack framesi
I think clojure is home for a portion of the general population who have higher IQ or something
In C++, every 'try new thing = wait minutes for templates to compile', clojure repl instant feedback = godsend
@matan see http://blog.cognitect.com/blog/2017/6/5/repl-debugging-no-stacktrace-required
@matan, are you hoping that we’ll convince you to use Clojure despite the friction Java stacktraces produce? 🙂 how can we help you?
We're not discussing if Clojure is > than C++. Its a matter of assessing the amount of training and HR difficulties that follow using Clojure
@robert-stuttaford this is no platonic thread of conversation. The resource from @sundarjfor example might tilt the scales
you appear to be interested in having Clojure be used by data scientists, which leads me to think that you’ve had a look at the tools that are built for data scientists and found them wanting 🙂
@matan @laujensen: have either of you used cider + lispy ? you hit C-x C-e, get an error, then you hit a key or two to move to a sub exp, then you hit C-x C-e again ... repeat a f3ewtimes, and BAM, bug is obvious
@qqq, I use cider every day - And do occasionally hit problems with cryptic error messages that require some manual detective work
so, the java straces are annoying, but i don’t think they’re a good enough reason to ditch the language entirely. i suppose it depends on what you’ll have your target audience doing.
@laujensen: occasionally, I too get weird stack traces, espeically ones of he form "no stack trace found, enable this flag on your JVM to avoid omitting strck traces" -- but besides those, most have been obvious once I drill down to the precise sexp causing the issue
i can tell you that i’ve taught clojure to >10 people, with an even mix of OO-scarred-veterans and shiny-new-people, and the latter cohort has a far better time of it in my experience. so much to unlearn as a veteran.
the other thing is this -- assuming that this employee is going to work 40 hrs / weeks 50 weeks / year alteast 2 years, that's 4000 hours ; it's not a bad investment to have them spend 1% of that time, a single 40 hr week, mastering clojure tool chain
@robert-stuttaford couldn't agree more, OO fixates one's mind too much. That's a +1 for teaching clojure to data scientists
toolchain investment - yes cryptic error Java learning - not investment but ongoing time waste
one of my shiny-new-people is our sole data scientist 🙂 his first database is Datomic. he’s learned SQL only so that we can derive data from Datomic to there to connect to the BI universe
@robert-stuttaford thanks for sharing that 🙂
I wonder what programming languages or data environments did this individual as a case in point previously use? 🙂
i know several folks who do. i did the emacs thing
What's the investment for someone who used few different IDE in their lifetime getting used to emacs? asking about myself now..
@sundarj: thanks for sharing that debugging article, the (def n 24) is f***ing brilliant yet so obvious; I've been doing far less pleasant hacks to make things work
cursive’s twitter acct is active. @cfleming - is cursive still on the go? 🙂
emacs was 2 very hard weeks followed by 5 years of bliss
@laujensen come on, two weeks, what's so complicated there?
That sounds more like it... I would like to think there's nothing that twisted there to consume more than that for getting acclimated with resolve
So, emacs plus cider, and repl workflows, as the ultimate productivity toolchain in life? 🙂
Yeah, we built SabreCMS from 0 to public launch in 7 months or so. Beating our closest competition by about 11 years
Thats true. But a 2 man start-up surpassing systems like Webflow with 100+ million dollars in investments is quite a feat none the less
@seancorfield @sundarj thanks so much
@seancorfield care to repost that lecture link? looks like just what's helpful
@matan two weeks because i was also learning Clj, and unlearning OO and learning Mac keyboard.
Unlearning Java style OO is hard, and then you learn clojure protocols at some stage lol
Just one last, any of the books you guys know geared towards the non-OO programmer or even naive programming learner, rather than playing out like a Java antidote?
for algorithms, i think the typical answer would be http://www.4clojure.com / https://clojurecademy.com
@matan also http://clojurekoans.com is great - an experiential approach to learning the syntax and the semantics
a late thank you @robert-stuttaford
@matan Living Clojure by Carin Meier is another good intro book.
... or pick a small webapp, and start implementing it in clojure, and ask for help when you run into particular problems
The standard way to attach meta data is via ^{...}. Is there a way to attach meta data to defn and fn 's ?
(defn ^{:a 2} foo {:b 3} ([]) {:c 4})
#'boot.user/foo
(select-keys (meta (var foo)) [:a :b :c])
{:a 2, :b 3, :c 4}
@matan @robert-stuttaford Yep, Cursive is still actively developed