This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-21
Channels
- # aatree (88)
- # admin-announcements (14)
- # alda (26)
- # announcements (4)
- # avi (6)
- # aws (7)
- # beginners (80)
- # boot (268)
- # braid-chat (58)
- # cider (4)
- # clara (54)
- # cljs-dev (16)
- # cljsrn (27)
- # clojars (13)
- # clojure (123)
- # clojure-chicago (2)
- # clojure-czech (8)
- # clojure-france (5)
- # clojure-hamburg (2)
- # clojure-miami (6)
- # clojure-nl (5)
- # clojure-russia (285)
- # clojure-spain (2)
- # clojurebridge (3)
- # clojurescript (137)
- # code-reviews (14)
- # community-development (6)
- # core-async (8)
- # core-matrix (10)
- # cursive (2)
- # datascript (1)
- # datomic (24)
- # dirac (2)
- # emacs (5)
- # hoplon (4)
- # incanter (6)
- # jobs (7)
- # ldnclj (42)
- # ldnproclodo (2)
- # leiningen (1)
- # mount (60)
- # off-topic (15)
- # om (134)
- # onyx (65)
- # perun (4)
- # portland-or (2)
- # proton (15)
- # random (1)
- # re-frame (24)
- # reagent (7)
- # testing (4)
- # yada (9)
@bradford: could you just run with different threads for the different ‘JARs’?
@danielcompton: Possibly? They still need to communicate with each other (one-way) through Queues of some type.
Oh yeah, core.async for your queues is probably a good idea
or just a juc queue maybe
but core.async will probably be easier
Although you're right, I don't need shared access to anything mutable, so maybe Agents are overkill.
Depending on how complex your JARs are, you could just put them in go
blocks
How do they know where to take from and deliver to?
I've got a DAG. In production, edges in the graph are Queues, and nodes are workers.
(It's a lot more complex than that, the DAG actually compiles to a Terraform file that spins up all the resources in the cloud)
nice. Sounds like it should be pretty easy to substitute core.async for queue and maybe go blocks for workers
That does sound nice, I'll have to read up on core.async. This'll be super cool when it's done though -- a developer can use the same config file to create a 100-node topology in the cloud, or just test the same topology on local.
And hey, I prefer clojure 'easy' to java 'easy' (maps of lists of maps of objects of maps to strings, forever)
Hrmm...another Q. I don't think I'm getting destructuring quite right:
(defn tst [a [w x] b] (str a w x))
=> #'sossity.core/tst
(tst "a" ["w" "x"])
ArityException Wrong number of args (2) passed to: core/tst clojure.lang.AFn.throwArity (AFn.java:429)
(apply tst "a" ["w" "x"])
=> "aw"
1. Why am I getting a wrong arity? I thought w
and x
were being destructured from b
? expected output is "awx"
2. Why am I not getting an arity error?you're going from (defn tst [a b])
to (defn tst [a [w x]])
because you're trying to get the pieces from b
, which you know is a vector of 2 items
@alexmiller: yup its there, I'm reading it and it's great!
So @crocket why do you think it's ironic that Clojure performs well?
http://benchmarksgame.alioth.debian.org/u64q/haskell.html Haskell vs Java benchmarks; http://benchmarksgame.alioth.debian.org/u64q/clojure.html Clojure vs Java benchmarks. /cc @crocket
Yup, and some benchmarks are faster in Haskell and some are faster in Clojure.
I don't know why that is surprising?
Usually, statically typed languages are a lot faster than dynamically typed languages.
Nothing to do with types. More to do with compilation.
Clojure is compiled (and strongly typed, just at runtime).
Unfortunately, the alioth clojure implementations are usually pretty ugly
Maybe this will improve as they’re rewritten with transducers
Most Clojure programs avoid type reflection.
I like transducers. I modified transducers to obtain middlewares. https://github.com/crocket/to-utf8-unix/blob/master/src/cljs/to_utf8_unix/middlewares.cljs
Clojure + Flight Recorder + targeted optimisations will pretty much always get you where you need to be
Java8 feature that is super awesome for profiling
https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr004.html#BABJCJDB
Unfortunately not
Its a commercial feature in Java8. You’re also supposed to pay for it if you run it in prod
It includes one but it’s really not comparable. This might be worth a look though https://github.com/RichardWarburton/honest-profiler
@seancorfield: What do you mean when you say https://clojurians.slack.com/archives/clojure/p1453364049014503 ?
I was referring to type hint. Type hint increases performance by suppressing reflection.
I don't know whether clojure compiler tries to suppress reflection without type hint.
And even though type hints are often ugly, they are well worth it when you care about performance. Reflection is really really slow.
Note that I used "when", not "if" above. I do not think that one should use type hints everywhere "because performance".
@hans, if it will be 70x faster, why the doc says we should avoid it only when there's a performance issue
@dm3 The reason I got the "cannot find symbol" error, was because there was a class slack.slackapi.class. My protocol interface was slack.slackapi.SlackActions. Just in case you're interested.
hi guys is this file *.abnf
the "next level" of file format for parsing @@
https://github.com/sfx/schema-contrib/blob/master/resources/email.abnf . I find it's much greater more detailed than any simple regex out there and it sure works correctly in many cases.
@jarodzz: Because 70x faster does not have a meaning if not seen in context. If you're calling a method a few times, then 70x faster will make no difference. If you're calling it a million times, 70x faster can be a deal maker.
@nxqd abnf is the format used by instaparse, which is used in that library to implement some of the validators. Turns out it's a standard format. https://github.com/Engelberg/instaparse/blob/master/README.md
@lucasbradstreet: most of the alioth programs would not benefit from transducers as they primarily involve tight mathematical loops using primitives. Transducers and seq fns can't retain or manipulate primitives (currently) - that's something Rich and I have talked about changing (but it's non-trivial).
@alexmiller: That's too bad, though it's good to know that. Thanks.
@alexmiller: you seem to know a lot about Clojure. Ever thought about writing a book? 😼
(If @meow wasn't joking) He did https://pragprog.com/book/vmclojeco/clojure-applied
@stuartsierra: you will quickly learn my particular sickness for sarcasm and obscure emoji, not to mention reactji performance art
I think I'm emoji-illiterate
I have mad respect and 💌 for @alexmiller
Would you use gradle to have one tool for building/dependency management/deployment, or both gradle and lein/boot to be able to use a build tool specific for clojure?
Using gradle for clojure doesn’t seem too attractive, but gradle is used for deployment which means duplication if lein/boot would be used for clojure
@slotkenov: if you just do a clojure server and get a proper repl running nicely with gradle gradle might be just fine
alternately, if all you need gradle for is deployment, make gradle invoke lein uberjar (or whatever your clojure build process is)
sorry to repeat myself - I have a clojure project that provides an http server, but as part of that project I've also written some scripts that do db schema migrations and such (on postgres). right now I'm just triggering those scripts in the repl, but it would be great if I could make some kind of standalone command (either through lein or outside it) that would run those. how might I go about doing that?
hi, i am new to clojure and trying to learn the language
thing is i dont know if im being too syntax oriented
i cant seem to find much resources regarding how the loops work or conditionals work
perhaps im looking in the wrong place
any ideas?
@jack_liang: There's a beginners channel, if you post any specifics to your problem in there you can usually get help pretty quick.
Do you have a specific question about loops and conditionals or are you just after the basics?
@dmitrig01: try lein help run
@immoh: oh woah, didn't realize you could run other functions than the main one. sweet, thanks!
may i ask whats the name of the beginners channel?
@jack_liang: #C053AK3F9
thank you
@dmitrig01: no need to apologize when your question doesn't get answered - that's the challenge with a large group on Slack. Nobody should feel hurt if they get ignored. It happens to all of us. And in addition to lein run
you might find boot conducive to your needs. Lots of great help on the #C053K90BR channel.
speaking of questions that didn't get answered... anyone got a solution to referring to the class your generating in a gen-class ns today? ie type hinting the this param https://groups.google.com/forum/#!searchin/clojure/gen-class/clojure/A9Si6Ow581U/sstYR15uBgAJ
If I just load things in my REPL without tools.namespace, everything is fine. Okay, I'm confused now.
markmandel: stating the obvious here but did you lein clean
?
I thought I had, but willing to give it another shot
....this looks promising...
@pgambling: excuse me while I go scream into a corner for a while. That was exactly it.
Thank you
you’re welcome
or lein
in general? I heard somewhere it's not really JVM startup that's the bulk of the time
a lot of people I know try to avoid restarting their repls using something like tools.namespace to reload the namespaces as necessary
@markmandel: Do you have anything AOT-compiled? That will often cause errors like that. Never mix AOT-compilation with reloading.
slester: there is also https://github.com/technomancy/grenchman which tries to automate long-lived repls a little
@stuartsierra heh... I may have a little bit.
has anyone run jitpack for private repos using leiningen? The documentation is sparse on where to provide the authentication token
@slester: there's also this page on the lein wiki if you haven't seen it: https://github.com/technomancy/leiningen/wiki/Faster
...and there's a #C0AB48493 channel which might be helpful
Hi, I have the following issue: I'm using org.httpkit.client for tousands file uploads (doseq [file (files dir)] (upload ... callback)) and in callback I'm updating an atom an checking whether it's done. When I run my function from REPL, it waits correctly, but when I compile and run from command line, then it end almost immediatelly. Can someone help, please?
@honzabrecka: in a repl, the main jvm thread is being kept open by the user input wait, if you don't have that then you need to find a way to manually tell the main thread to wait. either loop and check that atom and thread/sleep or some other mechanism
@bfabry: thanks!
I have a fun unicode problem. My app has an API that sends transit data, containing unicode strings. When I connect to the app on my laptop, everything works fine. When I connect in production ,going through AWS ELB, unicode gets corrupted, like ""Bras��lia, Brazil”. Does that ring any bells?
7 bits should be enough for everybody
I have a thing that produces a manifold stream (think core.async chan but different) to connect to syslog. metadata seemed like a useful place to store the internal client so it’s available for inspection. However, some types don’t implement IReference (which lead me to learn how meta even works internally). What’s the best way to solve this problem? Add metadata support to some types? Is there a way to implement IReference for existing types? (I guess there is)
@lvh I'd go with wrapping your data in a map or something over trying to play wack a mole with adding metadata to things that don't normally have it
ztellman: When using transform on a stream, are the transducers supposed to see deferreds? That seems like it would kind of defeat the point; but I’m seeing in a function being (map f)
‘d