This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-06-23
Channels
- # admin-announcements (11)
- # announcements (1)
- # beginners (80)
- # boot (152)
- # cider (22)
- # clojure (141)
- # clojure-berlin (57)
- # clojure-india (2)
- # clojure-italy (18)
- # clojure-japan (4)
- # clojure-russia (27)
- # clojurescript (96)
- # datomic (6)
- # dunaj (29)
- # editors (1)
- # euroclojure (63)
- # instaparse (2)
- # ldnclj (28)
- # off-topic (36)
- # onyx (4)
- # overtone (1)
- # reagent (8)
Anyone have an idea how to include dependencies for lein javac? I’m trying to write a sample Onyx input plugin in java to test out our protocols and can’t figure out how to sensibly get the onyx dep on the classpath
Oh, maybe it’s just because I’m not gen-class'ing
@bmay Do you know about https://github.com/funcool/catacumba (a little bit of spam :P)
ghadi: I have, though not all the way to millions of rows
@niwinz: you might want to change the tag line from "clojure build on" to "Clojure built on"
@ghadi: not sure but I think @otfrom may have used Spark with Clojure (using Sparkling I think - https://github.com/gorillalabs/sparkling )
@danielcompton: thanks! changed.
@podviaznikov: cool! will be really nice to hear any kind of feedback from early adopters!
Whats a good way to make a function that takes some string and returns a pseudo-random, recognizable thumbnail? Basically like this: http://avatar.3sd.me/ but with deterministic results
@escherize: again, very cool, I just created my one
I wrote one of those in CLJS: https://github.com/nhusher/om-identicon - live: http://nickol.us/om-identicon/
is it bad practice to aot everything when building uberjars? Should I, in general, only AOT the app itself?
@calum Doesn't really matter. AOT-compilation is transitive, so anything your app depends on will be compiled along with it.
@teslanick: then there's this http://aaronlasseigne.com/2013/08/18/building-identicons-and-playing-with-clojure/
@stuartsierra: oh ok, it's just I ran into some namespace conflicts and not AOT'ing everything fixed it. I was told AOT 'can cause lots of problems', so I was wondering why it's on by default.
@escherize: I think I may have used that piece as a starting point.
AOT tends to cause problems with interactive development, e.g. reloading AOT-compiled sources at the REPL.
a benefit of AOTing everything is that your app doesn't have to compile when it's booting in production (which makes restarting faster)
ah ok, I'm still very new to clojure and had never heard of AOT compilation so I'm just trying to get my head around the pros and cons
AOT compilation definitely has issues. Some libraries don't work at all if you AOT compiled them. I believesome of these issues have been fixed in clojure 1.7
a thing I'd recommend is trying to boot your uberjar during your CI process. It'll catch anything like that
I separate AOT using lein profiles, that way I can use clojure.tools.namespace.repl in dev env and compile while releasing the jars
I personally prefer AOT only the entry point namespace. This allows avoid all the AOT related problems. My two cents.
stuartsierra: there has been a change (CLJ-979) in classloading wrt checking the dynamicclassloader class cache - this "fixes" some scenarios with repl reloading and AOT by preferring the more recently redefined deftype. However these changes also negatively affect some other issues (CLJ-1741 is one example).
However, I think the "solution" there is really to go back to address things like CLJ-322 (transitive compilation) and also reconsider whether \compile-path should be on the classpath (I now firmly believe it should not be, despite other instruction to do so)
that is, calling "compile" should produce outputs somewhere, but you should not further consume those outputs while compiling. Rather, compile will have the same side effects as load on your runtime environment (causing classes to be loaded etc)
@alexmiller: interesting idea. Sounds like it would be worth trying at least.
I have tried it, and it works pretty well. hard to be exhaustive about anything of course.
Of course.
I went back and read some of the irc logs from Rich, etc back when this stuff went in and I do not think the reasoning behind having compile-path on the classpath holds up in retrospect. We have better solutions to the dynamic classloading issues now than when that decision was made. The problem in CLJ-1741 is really hard to solve with that in play.
(some day I will reclaim all the space in my brain reserved for memorizing these jira ticket numbers and will do something useful with it)
@alexmiller: thanks for Clojure Applied. I’m really enjoying it!
you're welcome! hopefully the in-print version is not more than a couple months off.
that’d be nice, but the PDF /epub ones are very readable on a MB Retina plus I can copy/paste from the PDF, which is a plus
i tried following along on the “go shopping” example but got stuck — saying that I see you’ve fixed some issues I reported around that in B4, so I should try again...
Anyone got experience custom tags in Selmer? I’m trying to feed a template variable into a new custom tag {% new-tag var %}. I made sure the var carry the value by {{ var}} in the template and also done (var :var {var} {{var}} ) inside the {% %}. Am I missing something obvious?
common lisp and emacs lisp run above code correctly, but clojure throw stackoverflow exception
how large was n?
blows up on 3
for small n it should work
java stack will blow up
for large n
but in this case its related to the macro
I think that somehow the fact there your trying to use the macro within its own definition causes it to blow up
not sure that clojure supports recursive macros
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6691
so its trying to expand indefinitely?
Macros can call themselves, clearly, but even in regular functions loop/recur
is preferred over directly calling the function.
akiva correct but the JVM can support non tail recursion up to the JVM stack limit
akiva correct usually its not safe to do so
I still say this should be a function rather than a macro and the loop should be handled with reduce
where you can produce a range
with n
and dec
.
I guess they have a smarter macro expansion code
is there a strong use case for such macros?
Nice finding, its cool what you can learn from just reading the source
@voxdolo: I'm also looking at Clojure Stripe libraries, I'm working on an example project (haven't pushed code up to github yet though) http://github.com/gdeer81/stripeapp using stripe-clj. sorry my example repo is bare because I got called on to do a real app using stripe so I'll copy,paste,munge the code as I go.
before I hook up all of the backend stuff that will actually make them money, the business users always want to make sure that the front end looks really good and is reactive and web 2.0 and buzzwords etc.
@gary: cheers, I believe I stumbled across it yesterday whilst searching github. Didn't have a look then, will now
is it generally better to use (make-hierarchy) or add parent-child relationships to the global hierarchy? How would I make this decision?
@cpmcdaniel: Doesn't matter much. Hierarchies are very rarely used at all. The global hierarchy implicitly includes the Java class inheritance relationships.
@gary last time I used stripe, I ripped out whichever wrapper library it was, and just used clj-http directly
the author always forgets to include some parameter you need, and then you have to use both, or rip them out
this reminds me of a java client for the docker API that I was evaluating and then for fun, I implemented some of the stuff in clojure, thinking, uhm, there is no need for a wrapper fo any sort, just use clj-http for each call and you're done
How do I run this code in lein
without exiting from the jvm?
(ns hello-world.async-test
(:gen-class))
(require '[clojure.core.async :as async :refer :all])
(require '[clojure.repl])
(defn -main [& args]
(doseq [i (range 10)]
(go (while true (let [random (rand-int 10)]
(println "Random ::" random))))
))
I want to use lein trampoline run
command and watch JVM using jvisualvmAnyone care to nitpick my Bob? http://exercism.io/submissions/91030b016387454892653196a2c1817e (readme: http://exercism.io/exercises/clojure/bob/readme)
@mohan: go
returns a chan containing the result of the loop, when it exits. take from that, something like
Is there such a thing as a lazy map in Clojure? As in, a map where the value is only calculated when the key is accessed.
Hi, The at-at library https://github.com/overtone/at-at seems abandoned. Which function scheduler do you recommend?
@narkisr: thank you. 😃
Your welcome, it rather small code wise and optionally uses channels, the joda times integration is nice also
@malabarba: you can totally have lazy seqs and other things in a hash map as values
@malabarba: there is no structure I know of in which the mapping itself is lazily computed.
@arrdem i mean, the idea is that all the keys would be known ahead of time, like a regular map
Why not have a map that hold partial applied functions?
I'd like to be able to do (:some-key the-map) to get the value. Whereas, if the values are partially applied functions, I'll have to do ((:some-key the-map))
You could implement the associative protocol (I don't recall its name) and extend so on get it will call the function
Most of the implementation will just delegate, only the get stuff will call the function
@arrdem and @malabarba Datomic entity maps are lazy like you're describing
Not that that is useful in solving your own problem of course :)
I'm on the lookout for a secure over the WAN messaging protocol/implementation (for Clojure of course), iv already considered Zeromq (lacks security for the JVM) MQTT (requires a server which id rather to avoid) or SQS (tying me to Amazon)
Any other suggestion?