#clojure logs

2015-01-06

00:06luxbockit doesn't appear to be possible to get the source for functions defined at the REPL
00:06luxbockI thought I could read them from the :file key of the meta data of the function
00:10rritochluxbock: Try (meta (var myfun)) That has the file
00:12luxbockrritoch: I can find the file, but it doesn't appear to contain the function definition
00:17rritochI see.. w/ (slurp (:file (meta (resolve (symbol "myfunc"))))), it is one complex construct
00:18luxbockrritoch: yeah, I couldn't see anything related to my function definition at all in there
00:19luxbocklooking at nREPL docs right now to try to understand everything better
00:36arrdemcfleming: rofl thanks for that
02:36black-bonzoHi, I've got a question w.r.t Leiningen - is it possible to detect what kind of build is actually being done (like ":dev", ":production", etc.) and act accordingly?
02:36jayp912,(var foo)
02:36clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve var: foo in this context, compiling:(NO_SOURCE_PATH:0:0)>
02:37jayp912,(try (var foobar) (catch Throwable t "caught"))
02:37clojurebotjayp912: Gabh mo leithscéal?
02:37jayp912What?
02:37clojurebotWhat is 2d6
02:37black-bonzoI mean, I'd like to achieve something like "conditional compilation" where, for example, when doing "devolopment" build I'm using one kind of resources (ex. translation files) and when doing "production" using completly different one
02:38jayp912I dont know
02:38jayp912You tell me
02:38jayp912Can some one help me? This might be stupid? How do I catch a failing (var x) invocation? (try (var foobar) (catch Throwable t "caught")) doesn't seem to work.
02:40luxbockjayp912: I think you'd need to use a macro
02:40jayp912black-bonzo: there is #leiningen i believe if you can't get an answere here. I am unable to help sorry.
02:41jayp912luxblock: I am writing a marco where I want to convert the param to a var, but if it fails, I get an uncatchable exception it seems.
02:41black-bonzojayp912: thanks, I'll look around there
02:42luxbockjayp912: could you use `resolve`?
02:42luxbock,(resolve 'foobar)
02:42clojurebotnil
02:42luxbock,(resolve 'map)
02:42clojurebot#'clojure.core/map
02:43jayp912i think that might work lux
02:43jayp912lemme see
02:44jayp912however, i would still like to know how one catches a failing (var x) invocation.
02:44jayp912there has to be a way of course. i just cant seem to get to it now.
02:45luxbockjayp912: it's not the var that's failing but its arguments
02:45jayp912,(def foo 1) (var foo)
02:45clojurebot#'sandbox/foo
02:45jayp912,(def foo 1) (var foobar)
02:45clojurebot#'sandbox/foo
02:46jayp912luxbock: dont understand you
02:46jayp912,(var count)
02:46clojurebot#'clojure.core/count
02:46jayp912,(var county)
02:46clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve var: county in this context, compiling:(NO_SOURCE_PATH:0:0)>
02:47jayp912in this case, var fails right?
02:47jayp912i want to catch that
02:47luxbock,(try (map not-defined [1 2 3]) (catch Throwable "Catched"))
02:47clojurebotluxbock: It's greek to me.
02:48luxbockhmm
02:48jayp912Throwable t
02:48luxbock##(try (map not-defined [1 2 3]) (catch Throwable "Catched"))
02:48lazybotjava.lang.SecurityException: You tripped the alarm! catch is bad!
02:48luxbock,(try (map not-defined [1 2 3]) (catch Throwable t "Catched"))
02:48clojurebotluxbock: excusez-moi
02:48jayp912,(try (map not-defined [1 2 3]) (catch Throwable t "Catched"))
02:48clojurebotjayp912: Titim gan éirí ort.
02:48jayp912haha
02:49jayp912it seems like clojurebot don't like catch
02:49luxbockyeah, it works in my REPL
02:49jayp912,(try (throw (Exception. "foo")) (catch Exception e "caught"))
02:49clojurebotjayp912: Cool story bro.
02:49luxbockanyways it would not catch it
02:49luxbockbecause the problem is not with map, but with its arguments
02:50luxbockthe fact that not-defined is not defined
02:50jayp912ahh i see
02:50cflemingarrdem: I thought you'd like that.
02:50jayp912i get it.
02:50jayp912thanks luxbock
02:50luxbocknp
04:36black-bonzowell, apparently there's hardly anybody in #leiningen, so I'' repeat my question: is it possible to detect what kind of build is actually being done (like ":dev", ":production", etc.) and act accordingly?
05:03Fenderi am not 100% sure but I think I saw something like that in the environment variables
05:05Fendercheck (System/getenv)
05:05Fender,(System/getenv)
05:05clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getenv.*")>
05:24llasramblack-bonzo: That's what Leiningen profiles are for
05:24llasramBut they work they other way around -- instead of having code which detects whether certain profiles are active, you have the profiles just specify what should be different
05:28llasramblack-bonzo: Additional, in my experience, trying to replicate a per-process "environment" state in Clojure is a path to tears
05:29llasramIn a standard Clojure development process you tend to have a single persistent JVM in which you (at the very least) want to both run a dev REPL and unit tests
05:29black-bonzollasram: yes, I know of Leiningen profiles, but actually, I'd like to be able to detect "mode" I'm running in,
05:30llasramblack-bonzo: My contention is that you really, really in fact do not :-)
05:30llasramWhat's the concrete effect that you're trying to achieve?
05:30black-bonzoof course, I can do it manually by switching some var (and using macros), but then I've actually got two compilation tools - Leiningen and my sort-of-tool
05:31black-bonzollasram: I'm writing an ClojureScript app,
05:32black-bonzoand depend on mode (dev vs production) I'd like to be able to use different resources (like strip some unnecessary files from production build, etc.)
05:33black-bonzollasram: right now, of course, I can have some "toggle" in which I can specify what is my desired mode,
05:34llasramYeah, so each Leiningen profile can have a sepearate set of paths for everything you can specify a a path for -- source, resources, etc
05:34black-bonzobut then I'd have to actually manually change my source file (at least in one place - where this "knob" resides) to achieve desired result
05:34llasramYou just specify dev-only resources in the :dev profile, and/or production-only in :production, etc
05:35llasramblack-bonzo: Then you should. My contention is that the "environment" like you want is state, and in Clojure you need an explicit mechanism to communicate that state
05:35black-bonzollasram: OK, that would work for resources - but what about changing actual behaviour of code (ex. to inline some files in production profile)?
05:37llasramI'm not quite following "inline some file" -- that sounds like a build option, which sounds like something which would already be specified in your Leiningen project file anyway?
05:38black-bonzollasram: that's one possibility and maybe the most appropriate - but then I could end up with production build that doesn't actually contain everything I want and, moreover, manually changing some knob in code seems kinda un-elegant
05:41llasramI get that it seems less convenient, but IMHO getting rid of implicit state almost always makes things *more* elegant :-)
05:42llasramAs an in-between, you can use Fender's suggestion of environment variables with https://github.com/weavejester/environ
05:43llasramSo you can use environment variables to communicate settings from Leiningen profiles to arbitrary code
06:00black-bonzollasram: by "inlining some file" I meant that in dev mode I can use normal CLJS map but in production, I'd like to be able to "render" it to JSON and "inline" (put to the output .js file) it
06:32hyPiRionblack-bonzo: did you get an answer to the question you posed in #leiningen?
07:52the-kennyHey! We're trying to make our Clojure application which is using stuartsierra's component-library uberjar-compatible. For some reason 'lein uberjar' is failing with NoClassDefFoundError on com.stuartsierra.component.Lifecycle.
07:53the-kennyOur -main is in foo.core which is (:gen-class)'d and :aot'd
07:54the-kennyOne google result suggested adding (:gen-class) to every component-ns, but that didn't do anything for us.
07:59martinklepschwhats a sane way to test async retries? the function to test returns immediately — currently I just do (Thread/sleep 100) and use super small retry intervals but it feels dirty
07:59martinklepschhttps://gist.github.com/martinklepsch/dbcc7702b36b7e879419
08:03the-kennyHm, I found a hacky solution to my problem: Add com.stuartsierra.{component,dependency} to :aot in leiningen. Quite ugly, imo :/
08:17OscarZhow many years does it usually take to master paredit?
08:22mearnshif master means fluent usage of paredit-convolute-sexp, i don't know
08:23mearnshbut i got most of it comfortable within a few days
08:39OscarZmearnsh, omg.. i think i managed to remove some parentheses :) there is hope..
08:45mearnshhehe it'll soon be second nature
08:45OscarZnow i messed up my whole file...
08:46atankanowOscarZ: i have the hardest time dealing with accidental parens in paredit
08:46mearnshyeah don't do that
08:46atankanownot sure what i'm missing ... most other things i'm fine
08:46OscarZif i have something like ()defn foo x []
08:46OscarZhow can i spread the () around the function ?
08:46atankanowctrl + shift + )
08:47dysfunhow 'heavy' are refs?
08:47atankanowdoes anyone use smartparens insted of paredit?
08:47atankanow*instead
08:47dysfuni'm guessing on the read front, presumably a pointer deref or similar
08:48OscarZatankanow, ive tried but nothing happens.. hmm maybe its the keyboard layout.. normally to get ) i need to press shift + 9
08:48mavbozo,(import javax.xml.bind.DatatypeConverter)
08:48clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
08:49mavbozois this one of the right way to create byte array from string?
08:49mavbozo,(byte-array (map byte "mavbozo"))
08:49clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
08:50AWizzArddysfun: refs are basically just a (mutable) box around a (typically/possibly immutable) object.
08:50OscarZi might as well type with my feet..
08:50mavbozoatankanow, i us smartparens too
08:50mavbozo*use*
08:51dysfunAWizzArd: what i mean to ask is "is it reasonable to create hundreds of thousands of them when working with large interdependent data?"
08:53atankanowOscarZ: I just hold ctrl + shift and hit 0 a few times to slurp the parens forward around the forms i need
08:54atankanowOscarZ: maybe it's a keyboard layout difference like you said
08:54AWizzArddysfun: when this is your usecase, then yes.
08:54OscarZhmm nothing happens.. ill try to change the mapping
08:54dysfuncool :)
08:54AWizzArddysfun: when you have objects in memory that have to cooperate, then you possibly want to use refs and the STM implementation.
08:55AWizzArdIn practical real-world apps this job is often forwarded to some external DB system.
08:55dysfunyes. it's actually a big nested map, so i was wondering whether i actually just want an atom
08:56AWizzArddysfun: possible
08:56AWizzArddysfun: however, remember that you may only read one single time from an atom during a transaction.
08:56OscarZwow.. the parens moved.. but only to the end of row? can i just keep on expanding on next rows ?
08:57atankanowOscarZ: yup
08:57AWizzArdFor a (let [x (atom {:a 1, :b 2})] …) you can not do something such as (+ (:a @x) (:b @x)).
08:58dysfunAWizzArd: so what's the practical impact of this? no speculative execution?
08:59AWizzArddysfun: the challenge here is that x might be modified during your execution of +.
08:59arrdem'morning
08:59AWizzArdWhen a and b represent the money in the bank accounts of two people, and a sends money to b, then before and after this transfer the sum a+b should be the same.
09:00dysfunoh right, sorry, i see what you mean
09:00AWizzArdBut it’s possible that the amount of a is read during the + operation, but changed before the end of that operation. The resulting a+b will not be consistent.
09:01AWizzArdSo, when using an atom you are forced to put all your transactions into singular functions. Function calls can not share a transaction state.
09:01AWizzArdRefs however do, because they can only be modified in (dosync …) blocks, which merge.
09:03dysfunright
09:03dysfuni think i see
09:03AWizzArdA map from which you want to read more than exactly one time per logical program unit, or to which you want to write, should better be placed in a ref.
09:04AWizzArdYou can play with atoms of course, but you must put all your transaction logic into the function that you pass to swap!.
09:04AWizzArdWhatever that FN does is safe.
09:05dysfuni think that's acceptable in this use case
09:06OscarZyeah i think it was a keymap issue... i took small steps towards sanity
09:18irctcdoes someone know how I can add points to an incantor scatter plot in a different color while maintaining point size
09:19irctcI have 2 data sets, [x1 y1] [x2 y2]
09:19irctcI want to display them in a scatter plot, both in different colors
09:56craigglennieI have 2 lein projects, project-1 and project-2. project-2 depends on project-1, but I can’t figure out how to get that to work. I know next-to-nothing about JARs or Maven, but I think I need to use lein’s “checkout dependencies”. Does that sound right?
09:56craigglennieDo I need to build a jar or anything to get project-2 to be able to import project-1? Or do anything with the class path?
09:57craigglennieI had hoped I could just add the namespace to :dependencies and create a symlink to the root of project-1 in the checkouts folder
10:00luxbockcraigglennie: you can use `lein install` on project-1 and then it should work as a dependency for project-2
10:02justin_smithcraigglennie: if you look up "lein checkout" there is a system that works with symlinks
10:03craigglenniejustin_smith: Yes, that’s what I’m trying to use. I think I have it working now - I had missed doing “lein install”, per luxbock
10:05justin_smithno, lein install is an alternative to checkouts
10:05justin_smiththe point of checkouts is you can simply make changes in the checked out project, without having to do another install / restart to see them
10:05justin_smiththe killer being the fact that you don't see the changes without a full repl restart
10:12stuartsierraI think you still have to `lein install` the first time before checkouts will work.
10:12craigglenniejustin_smith: Oh, that’s what I want. This part of the checkouts doc made me think that I still needed to do “lein install” when it couldn’t find my project. "After you've updated :dependencies, lein will still need to be able to find the library in some repository like clojars or your ~/.m2 directory. If lein complains that it could not find the library artifact, you can install it locally by running lein install in the checkout dependency
10:12craigglennieproject directory."
10:16justin_smithoh, I see
10:16justin_smiththanks for the clarification
10:17gfredericks,(rand-nth ())
10:17clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
10:17gfredericks&(rand-nth ())
10:17lazybotjava.lang.IndexOutOfBoundsException
10:17gfredericks&(rand-nth nil)
10:17lazybot⇒ nil
10:17gfredericksw00t
10:18Bronsa,(nth nil 0)
10:18clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
10:18Bronsa&(nth nil 0)
10:18lazybot⇒ nil
10:18gfredericks(dec clojurebot)
10:18lazybot⇒ 45
10:18Bronsa&(nth () 0)
10:18lazybotjava.lang.IndexOutOfBoundsException
10:18Bronsaweird justin_smith
10:19justin_smith?
10:19Bronsagfredericks* :P
10:19gfredericks(inc justin_smith) ;; for being a drop-in replacement for me
10:19lazybot⇒ 165
10:19craigglenniestuartsierra: Yup, the first “lein install” seems to be necessary, then it picks up changes after that
10:34zoti have a dumb interop question. i'm sure it's obvious, but it's my first time at this, and despite having the interop page open, i can't figure out what i've got wrong here. any clues: https://gist.github.com/anonymous/c3348aaa399d29dae411
10:34zot(reflection error included in the gist)
10:35justin_smithzot: well, that's not an error, just a warning that it can't resolve that method lookup
10:35justin_smithare you sure you have the exact args?
10:35zotyes, sorry, that was misspoken. but i like warning free compilation :)
10:35justin_smith(because the hinting would prevent that warning otherwise)
10:36zotahhhhhhhh
10:36justin_smithanyway, I think the key is hinting the arg
10:36zoti get it. i didn't type hint the argument.
10:36zotbingo
10:36zotthanks!!!
10:36zot(inc justin_smith)
10:36lazybot⇒ 166
10:36justin_smithyou shouldn't even need to hint the object itself, since the creation is unambiguous and in-scope
10:37justin_smithnp
10:37zotyeah, that was leftover from being absurdly pedantic, trying to understand
10:37CookedGryphonzot, if you're doing a lot of this try eastwood linter
10:37zoti thought the string would be obvious too, but i now see why, as it's generated in a threaded macro
10:38CookedGryphonit will give you a much better message for what you have done wrong, and more importantly it will pick up on some instances where a type hint actually isn't doing any good
10:38zotCookedGryphon: tnx, will check it out
10:56CookedGryphonin core.async, what's the best way to "drain" a channel
10:56CookedGryphonas part of my shutdown process, I want to close a number of channels, but make sure they've processed everything that's queued up first
10:56CookedGryphonso take everything that doesn't park, then close and drop out
11:00dysfunis there a drop-in replacement for update-in that accepts numeric indices?
11:01Glenjamin,(update-in {0 1} [0] inc)
11:02clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
11:02Glenjamin&(update-in {0 1} [0] inc)
11:02lazybot⇒ {0 2}
11:02dysfunsorry, i meant so that i can use it with vectors
11:02dysfuni have a nested data structure with both vectors and maps
11:02dysfuni can figure out how to implement it fairly easily, but it seems like someone must have done it already
11:04Glenjamin&(update-in [1 2 3] [1] inc)
11:04lazybot⇒ [1 3 3]
11:04dysfunoh. why doesn't the documentation say that then?
11:04Glenjamin(doc update-in)
11:04clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
11:04Glenjamin&(doc update-in)
11:04dysfunheh
11:04lazybot⇒ "([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created."
11:05Glenjamin&(associative? [])
11:05lazybot⇒ true
11:05Glenjaminit sort-of does :)
11:05dysfunoh, right. i took that to mean 'looks like a map'
11:10csd_How can I convert an BigInteger to a byte array?
11:17andyf__csd_: BigInteger?s toByteArray method looks like it should do the trick: http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html#toByteArray()
11:17andyf__Might want to ensure the number is positive if you don?t want to deal with negative 2?s complement representation
11:18EvanR-workany idea how to get java docs and possibly java source code to work in fireplace? or just in any easy way besides intellij?
11:18csd_andyf__: thank you
11:19stuartsierraEvanR-work: clojure.java.javadoc/javadoc ?
11:20EvanR-worktruly boss
11:22EvanR-workwhat about source code?
11:23stuartsierraEvanR-work: dunno. Theoretically possible if the source JARs are in a Maven repo, not sure if anyone's written it in an IDE-independent way.
11:27EvanR-workthe key combo for jump to source works for clojure names but not java, "source not found" so maybe i didnt download the source jars
11:28EvanR-workah i see "local maven repo"
11:30andyf__When extending a protocol to a class, is there a way to name 'array of primitive double' in the extend form other than (Class/forName "[D") ?
11:31Glenjaminit's something like "doubles" iirc
11:31mdrogalisHas anyone here used something like http-kit or Netty in a very high performance situation? In terms of number of requests/responses per second.
11:31andyf__Glenjamin: That works for metadata type tags, like ^doubles, but not for extend
11:31Glenjaminah
11:31Glenjamin:(
11:32andyf__probably because doubles is also the name of a function, and extend doesn't have special case code for recognizing such a name.
11:34llasramandyf__: I don't believe so; the Class/forName is what I do FWWIW
11:35justin_smithmdrogalis: doesn't http-kit use netty under the hood?
11:36llasramjustin_smith: nope -- just nio
11:36mdrogalisjustin_smith: Nope
11:36mdrogalisIn any case, I'm just trying to get a feel for how people are making these things top out in terms of performance.
11:36llasramIt includes netty in the project file in the dev profile, which has injected confusion, but I believe just for benchmarking
11:37mdrogalisI hear benchmarks like hundreds of thousands reqs/s, but I don't know how to achieve that.
11:37justin_smithllasram: mdrogalis: it has netty as a dep in its project.clj
11:37andyf__llasram: Thanks. Looks like a tools.analyzer enhancement request coming up not to warn about those.
11:38llasramjustin_smith: set... aaand match
11:38llasramjustin_smith: (see previous message)
11:40justin_smithllasram: ahh, you're right, it is only used in the tests
11:41justin_smithmdrogalis: you get benchmarks like that by serving static data out of memory for a contrived benchmark, with no calculation or allocation of objects :)
11:43mdrogalisjustin_smith: Ha, makes sense :)
11:43mdrogalisjustin_smith: Yeah, I see https://github.com/ptaoussanis/clojure-web-server-benchmarks
11:44mdrogalisIt's just returning the request as the response.
11:44mdrogalisStill, closing in on 500k requests/s is nuts.
11:45justin_smithyes, it proves that the server itself won't likely be your bottleneck
11:46justin_smiththe hard part is how to actually do any work and still get decent throughput
11:47EvanR-workin this benchmark game, they at least serve a static file http://snapframework.com/blog/2010/11/17/snap-0.3-benchmarks
11:47mdrogalisjustin_smith: Fact
11:47EvanR-workall you can derive from it is that rails is really bad
11:47justin_smithEvanR-work: which you load into memory once, and after that you are in the same position as the handler that sends the request back unchanged
11:48justin_smithEvanR-work: yeah, one of those cases where the server actually does end up being a bottleneck
11:48EvanR-workyes
11:49EvanR-workthe fact that the OS is having your common files in memory for you means the web server better not be getting in the way ;)
11:49EvanR-workthats an automatic speed boost
11:50EvanR-workwould be nice if given a benchmark you could at least get one nugget of useful information out, about something
11:52csd_andyf__: one more question. do you know how I can convert the data in java.util.Base64$Encoder to string? The encodeToString method doesn't work; nor does trying to construct a String as I saw some sample Java code do.
11:54andyf__csd_: Not off hand, and not obvious to me from a quick perusal, but maybe someone else can shed some light. Is there a .toString() method?
11:55csd_According to the docs, there is an .encodeToString method but when I try to use it, java complains that it can't find it.
11:59TimMcLink to doc?
12:00csd_https://docs.oracle.com/javase/8/docs/api/java/util/Base64.Encoder.html
12:01TimMcYou don't want that method anyhow. "by using the encoded byte array and the ISO-8859-1 charset"
12:01stuartsierracharset shouldn't matter for a string of ASCII Base64 characters
12:04stuartsierra(.encodeToString (java.util.Base64/getEncoder) (byte-array [1 2 3 4]))
12:05stuartsierraYou can't construct java.util.Base64$Encoder directly.
12:05EvanR-worktheres no brain-dead base64 encode decode snaz ?
12:05TimMcOh, it's encoding to base64, right. :-)
12:06csd_stuartsierra: I see, I had been using .encode and then trying to convert its result.
12:07csd_What would someone end up using just .encode for?
12:07csd_stuartsierra: I see, I had been using .encode and then trying to convert its result.
12:07csd_What would someone end up using just .encode for?
12:08stuartsierraMaybe they want bytes, and returning a string would be an unnecessary conversion to UTF-16.
12:08csd_I couldn't even figure out how to extract the bytes out
12:10EvanR-work,(.getBytes "abcd")
12:10clojurebot#<byte[] [B@14f34bd8>
12:11EvanR-workwhen dealing with byte arrays, anything to do with strings is going to involve encoding and decoding, perhaps needlessly
12:11csd_How would you use that in practice? Just IO?
12:11EvanR-workuse what
12:11csd_the result of (.getBytes "abcd")
12:12csd_I haven't done much with byte arrays
12:12EvanR-workyes some apis expect you to provide a byte array or give you a byte array
12:13EvanR-workif its text data and you need to process it like text, you basically have no choice but to convert to/from a string
12:14EvanR-workbase64 however encodes a byte array as text that does not need unicode so it could in principle stay as a byte array
12:14csd_I find the java interop stuff to be much trickier & more frustrating than pure clojure
12:15EvanR-worka byte array is a nice type to have in general, it just happens that means java here instead of pure clojure
12:17EvanR-workok i managed to download most of my java source jars with maven, and i managed to browse the code manually with vim (without extracting the jars), and i see a way to use ctags with it by unpacking the sources myself
12:17EvanR-workand thats all im willing to do for now ;)
12:20dweavewhat is the canonical way to query the state of some running process. Say I have a compojure app that needs to look at some ref in another namespace
12:20dweavei’m probably not thinking about it in the correct clojure way
12:21dweavebut in OO this would just mean having some stateful object
12:21Chousukejust deref it?
12:21Chousukethen you can look at it all you want
12:21weavejesterdweave: I'm not sure what you mean by "query the state of some running process"
12:21EvanR-workand control K already freakin does (javadoc x) and i didnt even realize
12:21ssiderisdweave: but do you really need state?
12:21EvanR-worker shift K
12:22dweavesay i have some realtime app that is stateful. like a real time poll or something
12:22phillordCinfojBaj3
12:22dweaveI need to (deref current-top-category)
12:22dweaveor something like that
12:22ssiderisphillord: password? ;-)
12:22dweavehow to i expose current-top-category
12:22phillordbugger
12:23ssiderisdweave: just by having it be public in its namespace
12:23ssiderisin other words, just def it
12:23dweaveok
12:23EvanR-workdweave: a "stateful" app which continuous polls (without doing anything with it unless someone also polls) seems kind of weird
12:23dweavewell it’s just an example
12:23dweavepeople could be voting
12:24ssiderisdweave: but chances are, in many cases where you think you need state, you actually don't
12:24EvanR-worka running process that is serving requests right, this "query its state" is just another kind of request ?
12:24dweaveEvanR-work what do u suggest then
12:24EvanR-worki thought you already had this set up
12:24dweavei think ur taking query literally?
12:24dweavei just want to inspect a variable
12:25dweaveno i don’t have that set up
12:25EvanR-worki thought you meant you have a demon or server running
12:25EvanR-workor thread
12:25dweavemy actual use case is more complex
12:25Chousuketo inspect a variable, you just do it :P
12:25dweaveand i’m investigating
12:25Chousukethere's nothing to it
12:25Chousukegranted, you don't want to store all your mutable state in separate refs or atoms.
12:25arrdemstep 1 - inject an nREPL instance into your app, 2 - boot the app, 3 - connect to the repl, 4 - hack in production
12:26EvanR-workfor sharing a mutable variable between threads, you can use an atom. but it probably makes more sense to put it all in one atom
12:26ssiderisdweave: if you absolutely need state, make the variable a public atom, and deref it from any namespace
12:26Chousukein general, the less mutable state you have, the better.
12:26dweaveagreed
12:27dweaveare there any real applications where there is NO mutable state?
12:27EvanR-workyep
12:27dweavelike what
12:27dweavea calculator?
12:27AWizzArdI would say “no”.
12:27dweavei think interaction implies state
12:27AWizzArdHickey himself says that Clojure is not the silver bullet, but instead a useful set of tools.
12:27dweaveright
12:27EvanR-workyou implement abstractions on top of something underneath, and the computer has to mutate its registers at some point. you dont have to expose this to yourself or clients of your code
12:28Chousukedweave: not necessarily; if all interactions are independent of others.
12:28EvanR-workinteraction doesnt imply stateful ness or memory
12:28TimMcdweave: In the ideal word, you'd have a big core of logic using immutable data and then a thin wrapper around it that handles any mutation and other side-effects.
12:28AWizzArdWe need to differentiate between mathematical/theoretical possibilities and real-world applications.
12:28EvanR-workthe model you are trying to implement might be stateful, either rightfully so or not, and then you just use it
12:28Chousukedweave: like web services or something
12:29AWizzArdA big Clojure application without a single atom/agent/ref is hard to imagine. Without any mutable Java objects, such as UI elements or such.
12:29dweaveTimMc ur talking about the idea of “passing in the state of the world” as a function param right
12:29Chousukeyou make requests and the output of the request doesn't depend on anything but the request parameters, then any state that you have is incidental, not required.
12:29Chousuke+if
12:30EvanR-workdweave: thats not the right idea
12:30AWizzArdHickey didn’t provide mutable data structures in Clojure because he believes they are not needed. The opposit is the case. But: making mutation explicit was the goal, and this was reached.
12:31TimMcAWizzArd: He did provide them. Refs, vars, atoms...
12:31AWizzArdYes.
12:31AWizzArdAnd that was very good.
12:31AWizzArdI’m arguing that they are used in the real world.
12:31dweaveEvanR-work not sure what u mean
12:31TimMcNamespaces... :-p
12:31arrdemTimMc: hehe
12:32TimMcanything you can call setAccessible on...
12:35EvanR-workdweave: dividing everything into "mutable variables and side effects" and "not" is missing a great many points, and is based on thinking from the former perspective as a default situation
12:37dweavehmm I’ll prob just build this out and see what happens
12:39justin_smithAWizzArd: there is actually a formal proof that anything you can calculate with mutable state can also be calculated with immutable state + recursion
12:40justin_smith*immutable values
12:40justin_smithand, more importantly, the immutable version scales with designs more cleanly
12:41justin_smithmutability is still an option where performance demands it
12:41EvanR-workin fact your runtime environment is almost certainly using it ;)
12:42justin_smithEvanR-work: right, the important part is that we can reason about things as if they were truly immutable
12:42justin_smithwithin some reasonable constraints of the abstraction boundary, of course
12:42EvanR-worki refudiate abstraction boundaries as much as possible
12:43justin_smithquoting Sarah Palin? I'll have to bow out of this one :)
12:44EvanR-worksomebody had to invent words at some point ;)
12:44EvanR-workpeople probably got shit back then too
12:44AWizzArdjustin_smith: as I said above, on the one hand there is what is mathematical possible, and on the other hand there are real programs.
12:45justin_smithAWizzArd: right, and real programs scale more cleanly with immutable values
12:45justin_smithand they are free to use mutation where performance demands it, regardless of the language you are using there is a way to do that
12:48dweavejustin_smith in any of those models that use mutable values there still has to be some impure part of the system that performs side effects no?
12:48dweaveisn’t that what haskell IO monad does
12:49dweaveu can only keep part(s) of your code pure
12:49justin_smithdweave: like I said, you can define immutability within some reasonable boundary of the abstraction
12:49dweaveah
12:50dweaveso in this case that abstraction is refs, atoms / identities
12:50dweave?
12:50justin_smithit's also possible to manipulate the value of any "immutable" data structure via reflection. The point is you don't have to, and if you do things sensibly you have an abstraction that makes reasoning about code much easier.
12:50justin_smithdweave: the abstraction is immutable datastructures
12:51justin_smithrefs, atoms, vars etc. are closer to the fuzzy border
12:51EvanR-workin a functional program, you will have cpu registers being regularly clobbered, memory being overwritten when not being used, runtime objects having fields memoized, it doesnt mean your should structure your application this way
12:52justin_smithexactly. Your function calls are all gotos in the CPU, that doesn't mean you need to use goto
12:52justin_smithwell, goto plus some stack and register juggling, of course
12:55EvanR-workif a webapp responds to requests differently depending on the current snapshot of a database, it does mean the web apps code must necessarily be an imperative program
12:55EvanR-workdoes.. not mean!
12:57EvanR-workthe basic alternative is a possibly recursive function, but all kinds of new ideas are coming out all the time with even better alternatives that still present a functional interface but are more natural to describe what youre trying to model
12:58EvanR-workthe book is not closed on this science yet
13:11mfikesAre macros expanded in both the then and else branches of an if? I want to understand why (if true (defrecord A [a] ) (defrecord A [b c])) fails in Clojure and appears to take the 2nd definition in ClojureScript.
13:13rweirmacros are always expanded
13:15TimMcmfikes: Probably because CLojure and Clojurescript have different implementations around defrecord and therefore respond differently when you call defrecord twice.
13:16TimMcmfikes: Both branches of the if are expanded and compiled because the compiler can't know which branches will be taken? :-)
13:16TimMcs/?/./
13:16mfikesYes. Compile-time. Right.
13:17kenrestivowhat's the most straightforward way to have a high-priority thread?
13:18mfikesClojureScript appears to actually be a little strange with that expression. It makes it so (A. 1 2) is well formed but it returns #cljs.user.A{:a 1}, as if the first definition is really in play.
13:18rweirwhat does the thread do
13:18kenrestivoui stuff
13:18kenrestivoswing, specifically
13:19rweirthis feels kinda XY-y
13:20kenrestivoin more detail, i have an async/thread that is updating the ui (using seesaw invoke-now). it's too slow. trying to find options to get performance without having to rip out core.async (or seesaw) completely
13:21kenrestivothe actual ui update is very simple, but the latency between when somethign gets stuffed into that channel and when the ui updates is ridicuolous
13:21justin_smithkenrestivo: I assume you already tried moving all non-gui work out of the swing thread?
13:21mi6x3m-altkenrestivo: can you explain to me (in a PM perhaps) the scenario
13:21justin_smithahh, so it's not that the GUI is stalling, it's an issue of latency between the command and the result
13:21kenrestivothere's nothing going on in the swing thread except alts!!, waiting for something to come in, and displaying it.
13:22mi6x3m-altkenrestivo: why do you even mention swing then?
13:23justin_smithkenrestivo: I doubt that prioritizing the swing thread would speed that up much, if at all. Have you profiled?
13:23kenrestivoi've run visualvm. maybe i should spend more quality time with it.
13:24kenrestivorweir: what to you mean XY?
13:25TimMc~chainsaw
13:25clojurebotexcusez-moi
13:31aperiodickenrestivo: XY problem: http://mywiki.wooledge.org/XyProblem
13:32kenrestivoyeah, in this case the Y is "let's use clojure on a raspberry pi"
13:34EvanR-workY is make a thread higher priority
13:34EvanR-workaccording to that link
13:35aperiodichahaha
13:35kenrestivothat too
13:35EvanR-workthat XY problem is composable. X could be the Y in another instance of XY ;)
13:36kenrestivothere are many levels of Y here. the digging has gone deep
13:36EvanR-workXY problems are arrows in a category where objects are X/Ys ;)
13:36kenrestivorecursive XY
13:36aperiodicyeah, I dunno if you're gonna be able to eliminate that latency... I've found cljs in node to be way more performant if you want to target the raspberry pi w/clojure, though you have to do a little more fiddling to get the same development experience
13:37kenrestivoit's a bit too late, but i did see some posts on running cljs on node and it seems that'd be better for this project.
13:37kryftHmm, does clj-time 0.9.0 work for others? I get an IllegalArgumentException just from adding it to my project dependencies
13:37kryftI used clj-time 0.9.0 and clojure 1.6.0
13:37kenrestivoso i'm left with trying to desperately flail to get what i've got to work, somehow. not a great position to be in. thanks for the help tho.
13:38EvanR-workkryft: got 0.8.0 here, works
13:39kryftEvanR-work: Ok, that works. Wonder what's wrong with 0.9.0.
13:39justin_smithkryft: sometimes after changing a dependency it's neccessary to run lein clean manually
13:39kryftjustin_smith: I tried that, but still got the exception
13:39justin_smithOK
13:39kryft(With 0.9.0; 0.8.0 works)
13:44TimMckenrestivo: How do you even get Java running on a raspberry pi? I tried and lein version took about a minute to complete.
13:45kenrestivotakes 10 minutes to launch. with the embedded oracle jvm for arm-hf it runs. a uberjar takes about a minute to launch.
13:45kenrestivoit was not a smart idea, i think i can accept that at this point.
13:45justin_smithin core.async, if a (go (while true (f (<! c))) block gets to the point where c is closed, will it go into a busy loop repeatedly operating on nil, or will it get shut down?
13:45exaptickenrestivo: this might be relevant -- i keep wanting to get started with cljs to target all the great js integration available nowadays http://swannodette.github.io/2014/12/29/nodejs-of-my-dreams/
13:46kenrestivoyep, node + cljs seems the way to go.
13:46exapticbiggest bummer for me looking at cljs from clj is the lack of numeric tower =\
13:46kenrestivoi may try it for another project.
13:52bacon1989Interesting how most projects these days are web projects
13:52bacon1989I wouldn't be surprised if clojurescript started getting even better support than clojure :p
13:53justin_smithbacon1989: it's such a ubiquitous platform
13:57bacon1989I think it would be neat if a clojure derivative came out that did native compilation
13:57bacon1989with a good ffi
13:57algalwhat about https://github.com/pixie-lang/pixie ?
13:58bacon1989algal: been looking at racket
13:58bacon1989but yeah, I saw that on reddit a few weeks ago, and was interested
14:00algalthe choice of RPython is interesting. Hadn't heard of it before.
14:00bacon1989isn't that what PyPy uses?
14:01algal"I implemented Pixie in RPython, which is a subset of Python that can be compiled to C with the PyPy translation tool-chain." from https://medium.com/indie-programming-languages/indie-languages-interview-pixie-and-timothy-baldridge-cadbc36418dc
14:02bacon1989but yeah, i've been using clojurescript, and ran into some performance issues. Nothing major, I could change some things to more native javascript
14:02bacon1989but it's still a bummer
14:02bacon1989maybe if I update the clojurescript build
14:02bacon1989to something more recent
14:04mi6x3m-altis it better to put a let outside or in a testing ?
14:04mi6x3m-alt(let (testing or the other way around ?
14:05stuartsierrami6x3m-alt: In clojure.test ? `testing` is just documentation, doesn't matter where you put it.
14:05mi6x3m-altstuartsierra: no convetion also?
14:05mi6x3m-altstuartsierra: I'd rather put it next to the assertions
14:06mi6x3m-altafter the let
14:06stuartsierrami6x3m-alt: You can put it anywhere, like I said. You can also put documentation strings directly in `is` assertions.
14:07mi6x3m-altstuartsierra: ok, let me reformulate. given 1 functions to-foo which converts a string to foo and a boolean to foo
14:07mi6x3m-altI have 2 deftests
14:07mi6x3m-altto-foo-from-str and to-foo-from-boolean
14:07mi6x3m-altis it better to have 2 deftests or 1 with testings?
14:08stuartsierra"better" is subjective. I tend to use more, smaller deftests. Then you can invoke them individually from the REPL.
14:08exapticdepends how you want to organize things i suppose
14:08mi6x3m-altstuartsierra: yeah thought so too
14:08exapticsame
14:08mi6x3m-altwill stick to the current style with 2 deftests
14:08stuartsierraI almost never use `testing`.
14:08mi6x3m-altalthough they both need some context created with let =/
14:09stuartsierrami6x3m-alt: Then factor that context out into a function and call it in each test.
14:11mfikesIs there a way for Clojure code to conditionally implement one of two different definitions of a protocol at runtime? (There is a new CLJS REPL IJavaScriptEnv protocol definition: The -setup method has a new arity. In concrete terms, can one codebase dynamically implement either protocol?)
14:12mi6x3m-altmfikes: mmhmm, read on reify
14:12mi6x3m-altit handles protocols
14:12mi6x3m-altbut doesn't sound like a good idea
14:14dnolen_mfikes: there is only 1 arity now, realized it wasn't worth it to have 2
14:14dnolen_fikusz: 0.0-2665 has the change
14:14dnolen_mfikes: oops that was for you ^
14:15mfikesdnolen_: Ahh. So my question is now academic :)
14:15dnolen_mfikes: yeah all REPLs just have to take opts
14:16dnolen_mfikes: and no to your question. I actually realized it was issue when I tried to load AOTed code that implemented only one of the arities
14:18mfikesdnolen_: Ahh. OK. I even tried reify in non-AOTed code and, it was a no-go.
14:18dnolen_mfikes: huh interesting, it seemed OK at the REPL, but I might have been imagining that
14:19dnolen_mfikes: still looking into updating Weasel or doing an iOS native one?
14:19mfikesdnolen_: Yes and yes. :)
14:19dnolen_mfikes: nice :)
14:25mfikesdnolen_: For reference, here is a gist showing the attempt to conditionally reify the old interface and the associated exception: https://gist.github.com/mfikes/06bad1d73057405bd50e
14:37jjttjjdnolen_: hey I know this is extremely low priority but just wondering if there's anything else I need to do for my patch here: http://dev.clojure.org/jira/browse/CLJS-936 I'm now on the official contributers list
14:38dnolen_jjttjj: nothing to do, thanks for the bump applying now
14:39jjttjjdnolen_: awesome, thanks!
14:43irctchey guys! I wrote a function that finds where numbers go from increasing to decreasing in a collection, but its kinda hard to read. Is there a better way to do this? http://pastebin.com/dqb0fST2
14:44dnolen_jjttjj: it is done, your plus another patch brings us to 100 contributors to CLJS - not bad!
14:45irctcdnolen_: woah thanks for everything you do for clojurescript
14:45justin_smithirctc: instead of first + reduce why not use reduced?
14:45mfikesWow. 100 contributors. Nice.
14:46irctcjustin_smith: hmm ill look into reduced
14:46justin_smithirctc: (reduced x) will return x from reduce
14:46justin_smithit's pretty simple
14:47irctcjustin_smith: oh I see
14:48amalloyjustin_smith: how does reduced help irctc with that function?
14:49amalloyit looks like the reduce is building up a 3-tuple, the first item of which is a list that gets larger
14:50amalloythe real improvement, if i'm reading this right, would be to not use reduce at all, but instead write a recursive function using lazy-seq to produce results on demand
14:52irctcamalloy: yeah a lazy sequence of critical points sounds like what I want. I'll try rewriting it with lazy-seq
14:52irctcamalloy: justin_smith Thanks a bunch!
14:54[blake|How, in hiccup, do I get a tag that has no value? I.e., if I want to set a class, I do <<:class "whatever">> but for something like readonly? I can't just put in <<:readonly>> because it's in a map!
14:55amalloy[blake|: i think the canonical thing for these toggle-style attributes is to use <a readonly="readonly">, <input checked="checked"> ...
14:56amalloythe shorthand of <a readonly> is a legacy thing, i *think*
14:56amalloyincidentally, irctc, the asymmetry between <= and > makes me think you don't do quite what the docstring says
14:56amalloybecause increasing and decreasing should be perfectly symmetrical
14:57[blake|irc2c?
14:57[blake|OH. Sorry, you're talking to someone else, and I thought you were using one of those "hep" Internet abbreviations.
14:59kenrestivohep?
14:59amalloykenrestivo: an adjective to describe hepcats
15:00[blake|kenrestivo: "Hep", yeah, happening, with it, now...yeah, amalloy has it.
15:00amalloyi thought it was quite apropos here, because it's old-fashioned slang to show how out of touch [blake| is with modern internet slang
15:01[blake|I'm an "L7".
15:20TimMcThat's crazy, daddy-o.
15:20[blake|Damn beatniks.
15:22moquistIt's hilarious that "hep" is the new "hip", since "hip" used to be the new "hep".
15:24TimMcAlex and I have been reading the Autobiography of Malcolm X and it's fun to hear him describe way he talked in the 1930s.
15:25moquisthttp://en.wikipedia.org/wiki/Hip_%28slang%29#Development <-- in case anyone is curious. Some great lyrics there from Harry "The Hipster" Gibson, circa 1947.
15:25[blake|Wait, has "hep" become the new "hip"? That means my irony is fail! (Of course, if you're ironic long enough, you come around to being sincere again. It's groovy.)
15:27TimMc#groovy is thataway ->
15:31TimMcThat article doesn't give a consistent explanation of hip vs. hep and their etymology.
15:50[blake|Wikipedia, man. It's heavy.
15:50SagiCZ1i am using the regular JDK that comes from Oracle.. is there anything I could do to make the GC deterministic?
15:52[blake|SagiCZ1: JRockit? http://www.oracle.com/technetwork/middleware/jrockit/overview/index-101826.html
15:52SagiCZ1[blake|: yeah i was wondering if there was some magic option for the regular jdk that could achieve at least something similar
15:53amalloySagiCZ1: what is your actual goal? a deterministic GC sounds like an XY problem
15:53[blake|SagiCZ1: My guess would be no. Usually GC determinism is a Big Deal. Even a Can't Be Done.
15:54SagiCZ1amalloy: maybe the gc is not an issue at all.. i just need to send periodic heartbeats over usb very often at a stable period.. currently i am trying to get it down to 5 ms, but every fifth or so message gets held up in java for 20 ms.. i have no idea why so i wondered if it could be gc
15:55amalloyyou're trying to write a device driver in java or something?
15:55amalloyi mean, yes that probably is gc, and no you probably can't do anything about it
15:55SagiCZ1amalloy: is the gc triggered even when the heap is not even close to getting full?
15:55SagiCZ1why
15:56amalloy*shrug* the GC works in mysterious ways
15:56SagiCZ1:)
15:57[blake|Some GCs I've worked with could be tweaked.
15:57SagiCZ1btw it is something that probably should be implemeneted as a driver but I wondered if it could be avoided since I don't know how to make drivers
15:57TimMcOCaml.
15:58justin_smithSagiCZ1: it is possible to make a gc that is more deterministic (though lower throughput) - basically you sacrifice your average time for minimizing worst-case time
15:58justin_smithI don't think java really does that though
15:58SagiCZ1the strange thing is, that VisualVM shows no GC activity.. i think it might be getting held up by some other mechanism
15:59justin_smithcould be the OS
15:59SagiCZ1yeah
15:59justin_smithcould be caching
15:59SagiCZ1or some buffer
15:59justin_smiththat is, cache line fill time
16:02SagiCZ1i think java can achieve something very close to real time, i just dont know how yet
16:03[blake|SagiCZ1: OTOH, device drivers aren't that hard. Just whip out your C compiler and go!
16:04SagiCZ1[blake|: the problem is that the potential user could be very reluctant to install drivers vs just running an executable jar with my app.. and bugs in drivers equal BSOD
16:04cflemingmfikes: I'm interested to hear about your Weasel/iOS REPL plans
16:05[blake|SagiCZ1: Well, sure, it's not for the faint-hearted. =P
16:06SagiCZ1i think drivers can achieve better speed because they have higher priority in the system scheduler..
16:06tbaldridgeSagiCZ1: or if C scares you write that bit in Python, at least then you get the deterministic behavior of a reference counting GC.
16:06[blake|Yeah, although you can't necessarily count on the 5ms thing there, either, right? Not on Windows, anyway.
16:07SagiCZ1[blake|: dont usb mice get some pretty stunning refresh rate? not sure about the numbers though
16:07SagiCZ1tbaldridge: python scares me more than c!
16:07tbaldridgeSagiCZ1: 5ms is actually a ton of time. tons of games run at 120 fps, which is about 8ms. And think of all the time spent rendering a single frame on a pc
16:08SagiCZ1tbaldridge: yeah.. i would actually be pretty happy about some stable 20 ms.. i think it has to be achievable within java
16:08tbaldridgeyou are most likely creating more garbage than you think, and that's triggering a GC pause
16:08tbaldridgesure, theres about 200 gc tuning switches for the JVM, one of them should due the trick ;-)
16:09SagiCZ1tbaldridge: yeah that was my first guess
16:09EvanR-workwhats the "best" clojure web server / app thing
16:09tbaldridgeEvanR-work: define "best"
16:10EvanR-worksimple, reliable, free
16:10EvanR-workpick three
16:10jackhillHi, is there a comparison of clojure with kawa and ABCL? i.e. why should I choose clojure over Scheme or Common Lisp?
16:10hiredmanwhy?
16:10clojurebothiredman: because you can't handle the truth!
16:10hiredmanclojurebot: jerk
16:10clojurebotyou cut me deep, man.
16:11hiredmanclojurebot: rationale?
16:11clojurebotrationale is http://clojure.org/rationale
16:11EvanR-workclojurebot: my wife left me
16:11clojurebotIt's greek to me.
16:11augustlwhat are good ways to deploy a java -jar file for a clojure webapp on an ubuntu server? :)
16:11jackhillhiredman: thanks
16:11tbaldridgeEvanR-work: well it depends. Something like ring, is certainly simple, but also limited in some aspects. Other platforms like http-kit or pedestal have more features and flexability, but are prehaps a bit more complex.
16:11tbaldridgejackhill: have you seen "Are we there yet?"
16:12tbaldridgejackhill: also a good rationale to clojure: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey
16:12EvanR-worktbaldridge: so something like sinatra, it lets you handle the response, and customize aspects of the response if necessary, but sane defaults
16:13jackhilltbaldridge: I have not seen "Are we there yet?" Thanks!
16:14tbaldridgeEvanR-work: I've been told ring is pretty close to sinatra.
16:14tbaldridgeor at least close to a Clojure version of sinatra
16:14stuartsierraIncluding copying its flaws.
16:14tbaldridge:-D
16:15EvanR-workdid it copy rack? no? then its good
16:15justin_smithaugustl: it can be as simple as scp the jar to the server, stop any process with an extant PID file (removing said file) then launch your jar, creating a PID file
16:15stuartsierrajackhill: some of the earliest presentations by Rich Hickey cover differences from other Lisps.
16:15justin_smithaugustl: of course there are various wrappers for making an arbitrary program a "service" under ubuntu
16:15stuartsierrajackhill: Search for "Clojure for Lisp Programmers" maybe
16:15augustljustin_smith: sounds like I should look into how to create my own services
16:15jackhillstuartsierra: will do :)
16:16justin_smithaugustl: it's pretty straightforward - in that case you would upload, then restart the service (pointing it to the latest jar of course)
16:16augustljustin_smith: sounds good, thanks for the pointer :)
16:16stuartsierrajackhill: The big difference is ABCL and Kawa are trying to emulate their respective platforms on top of the JVM, so there's a bit of a mismatch with things like types and interop. Clojure is "native" to the JVM.
16:17EvanR-work"Ring is a Clojure web applications library inspired by ... rack."
16:17EvanR-work:\
16:17tbaldridgeEvanR-work: so like I said, depends how you define "best". By my standards, pedestal is the best. But your standards may differ.
16:17stuartsierraaugustl: JSVC (Apache Commons Daemon) may be useful
16:19jackhillstuartsierra: In fact, I started looking around at languages becasue I was interested in Java interop, so that's good to keep in mind.
16:19EvanR-workpedestal looks cool
16:21mi6x3m-altjackhill: you've come to clojure, look no more!
16:22jackhill:) Data immutability is also very attractive
16:23mi6x3m-altyes, it's an important achievement of humanity
16:27mfikescfleming: I was thinking of a simple JavaScriptCore REPL that works much like the Node.js REPL (standalone, TCP comm, loading dependency JS files off disk). That would make it easy to fire up a REPL when you want to suss out something with JavaScriptCore. But, figuring out the alternative comm channel: USB / iOS WebKit debugging might a more fruitful avenue of pursuit.
16:28cflemingmfikes: Ok, sounds interesting. I'm slowly investigating the debugging in the background, and hoping to get to it in the next couple of weeks
16:28cflemingmfikes: I'll let you know when you can be a guinea pig :-)
16:29mfikescfleming: That'd be cool to work on :)
16:30mfikescfleming: I suppose the USB debug protocol might lead to more capability if it affords you the opportunity to do things like set JavaScript breakpoints, etc.
16:35cflemingmfikes: definitely. Plus that allows code to be swapped while the VM is paused, so when you're paused at a breakpoint your REPL will still work, local state will be saved and then you'll be able to continue with the new code
16:35cflemingmfikes: It'll potentially be nicer than debugging Java at that point.
16:43mfikescfleming: OK. I'll read up on that protocol so I know more about it.
16:43SagiCZ1tbaldridge: ok, it was just my code, java is fully capable of being pretty accurate under 5 ms.. i just need some timer that wont acumulate the error and i am good to go
16:46doritostainsI'm using cider 0.9.0alpha with cider-nprepl 0.9.0-snapshot and emacs seems to start a server fine but the repl buffer doesn't have a prompt. Anyone having a similar problem? This just started happening today. I just updated my packages and prelude
16:55postpunkjustindoritostains: I had a similar problem yesterday, I just fixed it by downgrading to 0.8.2
16:55AeroNotixdoritostains: welcome to CIDER where everything breaks and nobody cares.
16:55AeroNotixUse older version, 0.8 is known-good.
16:56AeroNotixI tentatively have upgraded to the latest CIDER{-nrepl} and I seeing no problems. However, I suspect that it's a ticking time bomb and it's waiting until I'm knee deep in a deadline straddling bugfix to break.
16:57llasramAeroNotix: If you care, the project seems to be very opening PRs, and has a growing test suite
16:57llasrams,opening,open to,
16:57llasramThe transition to the middleware-based implementation was made more painful by the lack of a pre-existing suite of tests
16:58AeroNotixIt really was
16:58llasramBut I think things are looking much rosier going forward
16:58amalloyllasram: "very opening PRs" - such doge
16:58llasramamalloy: yes yes :-p -- I have a bad habit of changing my planned sentences faster than I can type
16:59rhg135good to know im not the only one
17:07AeroNotixllasram: yeah, the middleware transition was terrible. I wish it didn't need to happen so swiftly.
17:07AeroNotixAlso, I remember the 0.6 was so amazing I was comparing its quality to SLIME.
17:07AeroNotixso it kind of set me up to really dislike the quality in later releases.
17:07AeroNotixAnd FWIW, I opened issues with all bugs I encountered and discussed those which other people had made before me.
17:10coventry`I'm having trouble getting started with some java interop. I think it's just clojure rustiness. Any suggestions for how to get these clojure instructions working? https://www.refheap.com/95732
17:11SagiCZ1coventry`: did you accidentely post something else?
17:11mi6x3m-altcoventry`: (OpCode/e_op_code_NOP)
17:11SagiCZ1no sorry im blind
17:11mi6x3m-altcoventry`: if you want to call it that is
17:11amalloycoventry`: your clojure looks fine
17:11mi6x3m-altotherwise the message is correct
17:11mi6x3m-altand the static field is missing
17:11amalloyi'd say your javadocs don't match the version of the library you have
17:13coventry`Hmm, I'm pulling the types for the AT_Block call straight out of the source code which I think I just cloned: https://github.com/BurstProject/burstcoin/blob/master/src/java/nxt/at/AT_Block.java#L22
17:14coventry`mi6x3m-alt: e_op_code_NOP is a data field: https://github.com/BurstProject/burstcoin/blob/master/src/java/nxt/at/OpCode.java#L13
17:15mi6x3m-altcoventry`: not public
17:15amalloyoh, true indeed mi6x3m-alt
17:15amalloyall of those members are not public
17:16mi6x3m-altyou can force them through reflection but the inter-op is not helping you there
17:16csd_Is there an easy way to xor 1 byte into each byte of a hexadecimal number?
17:16justin_smithcsd_: the size of the number matters more than the printed representation, but yes
17:17justin_smithsize of the number's datatype that is
17:17csd_its BigInteger sized
17:17justin_smiththat's trickier, but I would do it in a reduce
17:17coventry`mi6x3m-alt: Thanks... As a public class, I should be able to access AT_Block's constructor, though, right?
17:18mi6x3m-altcsd_: create a BigInteger from the byte by shifting and adding
17:18csd_someone in #java recommended BitSet but I don't see how I would use it
17:18mi6x3m-altcoventry`: no, it's not public
17:18csd_I feel like I'm using the wrong language for doing byte operations
17:19mi6x3m-altcsd_: take your byte x
17:19justin_smithcsd_: so for every byte of the BigInteger (until you run out of bytes in the number) you want to xor each one with a specific byte
17:19mi6x3m-altyour goal is to create a big int each byte of which is x
17:20justin_smithcsd_: you can't just construct a BigInteger to xor against by repeating the byte, because BigIntegers have arbitrary size
17:20mi6x3m-altwell he can if he knows the size of the other number
17:21csd_Initially i have a string representation of a hex number that I want to operate on. I don't care if it's biginteger that contains it
17:21justin_smithcsd_: do you know the max size? that would make it much easier
17:21kenrestivomy woes appear to be due to my swing thread exiting... on the target, but not when running in nrepl in development. i see an @(promise) in my future
17:22csd_34 bytes
17:23csd_although i'd like to be able to generalize to larger if needed
17:24hiredman /win 15
17:28TEttinger\lose 1
17:28coventry`mi6x3m-alt, amalloy: Thanks, mystery solved.
17:28arrdem(inc TEttinger)
17:28lazybot⇒ 37
17:28kevinfishI'm having trouble understanding http://clojurescriptkoans.com/#functions/9 Can someone help?
17:31mi6x3m-altcsd_: can you determine the number of bits of the number
17:31csd_mi6x3m-alt: I'm attempting http://cryptopals.com/sets/1/challenges/3/
17:36justin_smithcsd_: seeing the actual problem, your best bet is to take two chars at a time from that string, turn them into a byte, and then track the frequencies of the unique bytes you get
17:36justin_smith(and compare those frequencies to the frequencies of letters used in english, etc.)
17:36csd_justin_smith: yes i did that. but i want to take the one-byte key and XOR it on the entire string
17:37justin_smithcsd_: why? just xor each byte (each pair of chars in the string)
17:37justin_smithso work along the string, xor each pair of chars as hex byte, and output as char
17:37justin_smithno need to create one big number, and then xor each of its bytes
17:38csd_I suppose you're right. I just was looking for a function i could apply using `map`
17:38justin_smithcsd_: bit-xor
17:38csd_except that doesnt work on bigint
17:39justin_smithcsd_: why would you need a bigint at any point here?
17:39justin_smithjust map across each pair of chars, turning each pair into a number, then xor it
17:39csd_ok
17:40justin_smithkevinfish: since that's a koan, I'll ask: what function would take \x -> x*x as an argument and return 25?
17:40csd_thanks justin
17:41kevinfishjustin_smith: #(5)?
17:41justin_smithkevinfish: I that's close, but it is not a function
17:41justin_smithremember it has to take an arg
17:41justin_smiththat arg being (fn [x] (* x x))
17:42justin_smithand then it has to do something with that argument
17:42kevinfishso something like: #(% 5)?
17:42justin_smithkevinfish: I think that is precisely the answer
17:42kevinfishlol, ok. bizarro :)
17:43justin_smithyes, it's a contrived example
17:43justin_smithbut hopefully it made some kind of point about first class functions
17:43kevinfishyes, braintwister. Thanks.
17:44andyfllasram: Regarding my question about extend-protocol earlier, Bronsa reminded me of this ticket:
17:44jjttjjkevinfish: i think maybe it's expecting something more like (fn [f] (f 5)) ?
17:44justin_smithjjttjj: that's what #(% 5) is
17:44justin_smithand #(% 5) is accepted as the correct answer
17:45kevinfishjjttjj: that would have been more of a noob way to do it, yes.
17:45andyfllasram: http://dev.clojure.org/jira/browse/CLJ-1308
17:45justin_smithin fact ##(quote #(% 5))
17:45lazybot⇒ (fn* [p1__45305#] (p1__45305# 5))
17:45justin_smithit expands to that, modulo some weird naming
17:48jjttjjoh woops I missed that, just saw the #(5)
17:49nontrivialleafquestion: is this an appropriate location to ask newbie questions about the language?
17:50amalloyyes
17:50SagiCZ1nontrivialleaf: definetely.. or at least i do it all the time
17:51nontrivialleafhah! this form freezes my repl. It must be running infinitely, but I'm very unsure as to what the issue is: (for [x (iterate dec 100) :when (> x 0)] x)
17:51gfredericksyou probably want :while
17:52gfredericksinstead of :when
17:52gfrederickswith :when you're filtering the infinite sequence
17:52zirkonitgood day, gents
17:52nontrivialleafoh
17:52gfrederickswhich takes forever understandably
17:52nontrivialleafyes that makes things work
17:52nontrivialleafthank you ^_^
17:53gfredericksnp
17:53amalloynontrivialleaf: see also (range 100 0 -1)
17:58gfredericks,(nth (iterate shuffle (range 100 0 -1)) 1000)
17:58clojurebot[48 58 68 6 2 ...]
17:59gfredericksclojurebot: iterate shuffle is your friend
17:59clojurebot'Sea, mhuise.
17:59nontrivialleafI'm confused on which functions/macros return lazy seqs
17:59nontrivialleafi know I can search docs
17:59coventry`Is there a way to execute clojure code in the context of a package, to simplify access to its package-private fields and methods?
17:59SagiCZ1nontrivialleaf: it is usuallyi n the doc
17:59amalloynontrivialleaf: most of them
17:59SagiCZ1nontrivialleaf: the rule of the thumb is that if the algorithm CAN return lazy seq, it will
18:00nontrivialleafhmm
18:00SagiCZ1,(type (take 5 (range 10)))
18:00clojurebotclojure.lang.LazySeq
18:00SagiCZ1 ,(type (shuffle (range 10)))
18:00clojurebotclojure.lang.PersistentVector
18:00nontrivialleaf,(println "testing")
18:00clojurebottesting\n
18:00nontrivialleafnice
18:08nontrivialleafjust to be clear: in this example (nth (iterate shuffle (range 100 0 -1)) 1000), iterate returns a lazy seq to nth, whereas in (type (shuffle (range 10))), shuffle actually evaluates
18:08nontrivialleafcorrect?
18:19alandipertnontrivialleaf, iterate returns a lazy sequence that nth will consume eagerly. shuffle is eager too, because it returns a vector
18:19gfredericksnontrivialleaf: also to be clear (iterate shuffle ...) is totally useless
18:19gfredericksbecause it shuffles more than once
18:20amalloygfredericks: what if i know how my shuffle algorithm works, and i know i'll get the cards i want on the tenth shuffle?
18:20amalloy(because the RNG is bad too)
18:21gfredericksamalloy: if you know what cards you want then just make those cards directly
18:22nontrivialleafah your missing a key point, it has to *look* random so he can trick his friends into playing
18:22gfredericksand clojure's RNG isn't seedable anyhow so it's all wild west
18:22nontrivialleaf*you're
18:26justin_smithgfredericks: well, the jvm rng is available
18:28gfredericksjustin_smith: eh?
18:28gfredericksyou mean just using a j.u.R directly?
18:29justin_smithgfredericks: there is a seedable rng that clojure doesn't use, it is available via interop
18:29justin_smithright
18:29gfredericksyeah the "clojure doesn't use" part is all I meant
18:29justin_smithsomeone should make a seedable rand-nth / shuffle
18:29gfredericksI did
18:30gfrederickshttps://github.com/gfredericks/four/blob/master/src/four/stateful.clj
18:30gfredericksalso I made a jira ticket and a patch
18:30justin_smithoh, of course you did
18:30gfredericksgo vote on it http://dev.clojure.org/jira/browse/CLJ-1452
18:31amalloygfredericks: alex changed priority from minor to critical? that surprises me
18:33gfredericksI know that was an amusing jump
18:34gfredericksI'm sure it's based on some internal interpretation of "critical"
18:34amalloyhahahaha
18:34amalloy"he is criticizing the dang random numbers, can't the guy ever take a break, why's he so critical"
18:34gfrederickslol
18:35Kristiengfredericks: I almost got my shor implementation working
18:35gfredericksKristien: that sounds exciting
18:36mearnshi'd like to see that Kristien
18:36machtyclojure noob here: i believe i have a grasp on how clojure minimizes the copying/duplication of immutable data between operations, but i'm wondering if any of the same tricks that apply to sequences can also apply to objects?
18:36machtyby objects i mean maps
18:36nontrivialleafi think map is a seq
18:36hiredmannope
18:37amalloymachty: for large maps, yes this is done
18:37rhg135PersistentHashMap.java is open source
18:37amalloyrhg135: open but not very legible
18:38rhg135legible may be subjective, amalloy
19:09gtrakmachty: maybe this isn't the place to ask, but you curious about clojure for ember's sake? I recognize you from the react slide-deck. Been futzing with immutable.js in an ember codebase for a bit already.
19:32aaelonyI enjoy using the repl to load and explore an unfamiliar clojure library. However I've never done this with a library that uses Stuart Sierra's Component library. Are there guidelines or recommendations on stepping into details of nested components and their OO-like start methods?
19:45thearthuraaelony: I don't think so, other than call the start
19:47aaelonythearthur: I'd like to see intermediate results of things that are called from start, but finding it somewhat opaque to discover the correct types of the arguments to pass in to subsequent functions. Also, I'm a little unclear if/why/whether alter-var-root is needed to poke around from the repl...
19:53thearthuraaelony: I agree ;-) suppose it's kind of a lifestyle choice :-/
19:53thearthursorry if thats not really useful
19:54aaelonythearthur: well, if anyone has stories of refactoring a component lib, I'm interested in hearing about it...
21:08fairuz,(-> {:name "Foo" :age 12} ((fn [x] (info x))))
21:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: info in this context, compiling:(NO_SOURCE_PATH:0:0)>
21:09fairuzHow can I simplify this?
21:09fairuzI want to put an anonymous fn inside a -> chain
21:10msassakfairuz (#(do-something 123))
21:10nullptrfairuz: (-> {:name "Foo" :age 12} info)
21:10thearthur,(let [info count] (-> {:name "Foo" :age 12} info)))
21:10clojurebot2
21:10amalloythere's no great way to do it, fairuz. yours is the simplest workaround, if we presume that your actual lambda isn't just a wrapper around info
21:11fairuznullptr: info is just a dummy function, it can be a several lines of code
21:11gfredericksfairuz: (-> {:name "Foo" :age 12} (as-> x (info x)))
21:11gfrederickscan be nicer sometimes
21:11fairuzamalloy: Ok, just wondering if there's any tricks around :)
21:11thearthurthen amalloy is right. using as-> can sometimes make it look a little better
21:15amalloy,(let [{:as x} nil, {:as y} []] [x y])
21:15clojurebot[nil []]
21:15amalloy,(let [{:as x} nil, {:as y} [], {:as z} ()] [x y z])
21:15clojurebot[nil [] {}]
21:16amalloykinda interesting that only seqs get converted to a map; nil and [] stay the same
21:16gfredericks,(let [{x 0} [42]] x)
21:16clojurebot42
21:16gfrederickshuh.
21:17amalloyah, right, that's why
21:17amalloybecause vectors already have keys
21:17gfredericksyeah I realized a second later that explained your thing too
21:17gfredericksI'm not convinced this vectors-as-maps thing is worth it
21:18gfredericksI guess if you're really really really using a vector then it's kind of map-like
21:18amalloygfredericks: you mean vectors shouldn't destructure like maps with integer keys, or get shouldn't work on them?
21:18gfredericksso maybe the real thing is that I don't normally use vectors as vectors
21:18gfredericksamalloy: I meant get, assoc, dissoc, IFn
21:19fairuzamalloy: thearthur: gfredericks: msassak: nullptr: thanks for the response. :)
21:19amalloywell, dissoc already doesn't
21:20gfredericks,(dissoc [1 2 3] 2)
21:20clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.IPersistentMap>
21:20gfredericksw00h00!
21:20gfredericksthat's kind of good I guess
21:20amalloygfredericks: you want them to preserve their indexed-access features, but with different function names than maps have?
21:21amalloybecause being able to assoc on a vector is pretty important; if you take that away you need to add it somewhere else with a new name
21:21gfredericksamalloy: just being indexed doesn't make them maplike -- e.g., perhaps the new whatchamacallum vectors will allow prepending as well
21:22gfrederickswhich amounts to a giant keyshift
21:22gfredericksnow that I think about that I'm having a hard time imagining those things replacing clojure's current vectors
21:23amalloygfredericks: are you talking about zach's small vectors or something else? i don't follow the mailing lists anymore
21:27gfredericksamalloy: no the bagwell things
21:28gfrederickshttps://github.com/clojure/core.rrb-vector
21:28amalloyare those actually on track for replacement?
21:28gfredericksjust something I heard rich speculate wrt clojure 2.0
21:28gfredericksa while ago
21:29amalloymmm. it seems to me like they'd be fine; who cares if (v' 10) used to be (v 5)?
21:29gfredericksI guess if assoc continues to work on the exact same keyset
21:30gfrederickse.g., you probably wouldn't want (assoc v -1 x) to do something
21:30amalloyi don't really want (assoc v (count v) x) to do anything either, but we can't always get what we want :P
21:30gfredericksso as long as you treat them like maps they keep being maplike
21:31gfredericksand only use that one magical assoc-point; yeah I agree that one is weird and could go away
21:31gfredericksyou kind of have to know you're doing it so you may as well use conj
21:34amalloythe only use case i can think of for the magical assoc point is someone wrote this cool function like (fn [x ...] (reduce (fn [acc y] (assoc acc ...)) x ...))
21:35amalloyand you really really want to use it for a vector, so you arrange to give it pairs like [0 x] [1 y] ...
21:35amalloywhich all seems rather far-fetched
22:16vermaif I want to append an item to a seq (list or a vec), I gotta do (concat lst [item]) ?
22:18lasergoatif you need it to go on the end and you don't know what it is, then yeah
22:18amalloyverma: http://stackoverflow.com/q/5734435/625403
22:18lasergoatmy general advice is to know which one you have
22:19lasergoat(meaning a vec or list)
22:20amalloyindeed, that's my advice in that SO question too
22:20vermaamalloy: thanks, lasergoat: its argument to a function, so its most likely a list, I could always vec it and then go from there
22:20vermaarguments*
22:20kenrestivothe nightmare continues. doing some binary search, it seems my swing/seesaw stuff broke horribly once i cut over to using the components system to start it up
22:20verma(fn [a & rest] ...)
22:21lasergoatverma: rest is definitely a vector
22:21vermalasergoat: oh? :/
22:21kenrestivoreading seesaw docs, it seems to imply that all datastructures used in the ui need to be updated on the ui thread. that can't happen, i've got atoms and agents and state modified through async channels.
22:21amalloylasergoat: whaaaaaat
22:21amalloythat is one million percent untrue
22:22kenrestivoi wonder now if i'm the only freak trying to use swing/seesaw as a write-only thing? i.e. there are no incoming ui events. it's used only for display.
22:22amalloykenrestivo: your async channels need to use SwingUtilities/invokeLater or whatever
22:22kenrestivoi am doing that.
22:22lasergoat*not. definitely *not* a vector
22:22justin_smithkenrestivo: if you are only displaying, and not allowing any twiddling from the user, wouldn't pushing updates to an html page be much easier?
22:23amalloy&(apply (fn [& rest] (class rest)) [1])
22:23lazybot⇒ clojure.lang.PersistentVector$ChunkedSeq
22:23kenrestivojustin_smith: i thought of that. writing a little c daemon that just takes updates in and writes to a window with GTK
22:23amalloyokay, just checking. it's indeed always a seq there
22:23lasergoat,((fn [a & rest] (vector? rest)) 1 2 3)
22:23clojurebotfalse
22:23kenrestivocould even launch it with conch and spew it events on stdin
22:24lasergoatamalloy: i thought i'd said not and when you said it was untrue i ran back to my repl to prove and came to see that i'd screwed up
22:24amalloywell, i guess you can actually make it a vector if you are an evil madman
22:24amalloywith like (apply f (reify IPersistentVector ... ISeq ...))
22:25amalloybut best not to have any evil madmen aroun
22:25kenrestivoEVIL VECTOR MADMEN running round instead of an (s) on their chest it says (vec)
22:26kenrestivoof course, the real name of the evil vector madmen, when not in costume, is "victor"
22:26lasergoatverma: in all seriousness, you generally don't need to worry about perf on & args, unless you do some crazy (apply) to it, so i'd just say (vec) like you were planning to
22:27vermalasergoat: I actually want to do an apply to it, not sure if its crazy, writing a macro which turns node.js style functions into nice clojure-y looking functions (js/fs.exstsSync) -> (fs/exists-sync?)
22:28lasergoatby crazy apply i meant with some giant data array
22:28vermalasergoat: no definitely not, will always be as manageable and sane as a function argument list should/need to be.
22:29vermalasergoat, amalloy : thanks for your help
22:29kenrestivo(apply + (range))
22:29lasergoatif you have like, a normal number of arguments, you should be able to do whatever you want
22:29amalloyi want to fly to the moon. can we arrange that? i only have a slightly higher number of arguments than normal
22:29lasergoati know fns are java callables, but if i have a java function that takes, say, a Callable<int>, can i still pass in my fn? i haven't tried it, but it strikes me that it wouldn't work?
22:30amalloylasergoat: there's no such thing as a Callable<int>
22:30justin_smithlasergoat: that's a generic right?
22:30amalloydo you mean Callable<Integer>?
22:30lasergoatsorry, yes
22:30amalloythen yes, your function works fine
22:30lasergoatjustin_smith: yeah
22:30justin_smithgenerics are a fiction of javac
22:30amalloygenerics are a fiction of javac
22:30justin_smithso you can use them just fine
22:30justin_smithwoah! jynx amalloy
22:30amalloyjustin_smith: jerk
22:30justin_smithhaha
22:31lasergoathaha
22:31justin_smithI can't believe we got the exact phrasing
22:31amalloyit's a popular phrasing
22:31justin_smith:P
22:31kenrestivoit's a fail-safe channel with redundancy
22:31lasergoatoh, so the underlying bytecode doesn't care, it's just a rule the java compiler enforces between pieces of java code?
22:31lasergoatinteresting, thanks
22:32justin_smithamalloy: I just googled the exact phrase - got two hits on the #clojure log and that's it
22:32justin_smithhaha
22:32amalloyjustin_smith: "fiction of javac" first used in this channel by the man himself, rhickey
22:32amalloythe real logs show it being said 6 times
22:33amalloyrhickey, cemerick, technomancy, stuartsierra (referring to checked exceptions), you, me
22:34amalloyi thought i'd said it before this myself
22:34amalloyweird that i apparently haven't
22:34kenrestivoband name: "fiction of javac"
22:35vermanot sure what it means
22:37justin_smithverma: generics don't exist in any form in the bytecode, they are a constraint enforced by javac, and clojure does not use javac
22:37justin_smithsame deal with checked exceptions: javac enforces them, they have no representation in the bytecode
22:37vermaoh, I see
22:37lasergoatwhich sort of makes sense, now that i think about it
22:38lasergoati think in .NET generics are byte-code level things, though
22:40justin_smithlasergoat: I think that's easier to do that way when you plan on generics from the beginning, I don't think that was the case with java
22:40justin_smithand java has a high priority on backward compatibility
22:40lasergoatjustin_smith: right
22:41lasergoatjustin_smith: .net didn't have them at first either, but they're much quicker to break things, and they have second-move advantage
22:41lasergoat*mover
23:25luxbockare side-effectful transducers kosher? I tried Googling about them but couldn't find anything
23:34amalloyluxbock: look up the source for the transducer for `take`
23:45lasergoattake has like internal state, but i'm guessing the questions is whether you should update databases or launch rockets with transducers
23:47lasergoati asked a similar question on #clojurescript, and while the answer was "generally no", after playing with them for a while, i decided that having side effects in my transducer was exactly as bad as having them anywhere else
23:47lasergoatin other words: bad, but not something special about transducers