#clojure logs

2015-11-04

02:54jonathanjare there i18n libraries for clojure that anyone can recommend?
02:59ju5tu5anyone who has done cluster computing using clojure please post back
03:13vijaykiranju5tu5: what's your question ?
04:01owlbirdhow to use profiles while deploying a war file.
04:01owlbirdlein with-profile dev ring server - OK
04:02owlbirdlein with-profile beta ring uberwar, and then deploy the target/xxx.war to tomcat, config is NULL
04:26tdammershuh, nasty surprise
04:26tdammerstagging an object with metadata can change its type, apparently
04:27vijaykirantdammers: huh ... do you have handy example ?
04:27tdammersnothing concise
04:28tdammerswhat I have here is a library I wrote that uses deftypes and protocols
04:28tdammersin a nutshell, it's a parser and an AST, and every possible AST node type has its own deftype
04:28tdammersbut now I want to tag those nodes with the original source position, so I thought I'd use metadata for that
04:29lezacyhello, there are any plans to add clojure to sdkman ???
04:30tdammerson closer inspection, it doesn't seem to change the type, it blows up with a ClassCastException: TextNode cannot be cast to clojure.lang.IObj
05:23Leonidashow can I specify --no-sign to leiningen?
05:23Leonidaslein vcs tag --no-sign
05:23Leonidaserror: unknown option `no-sign0.14.5-SNAPSHOT'
05:26jonathanjis anyone using yada in a serious fashion?
05:27Leonidasoh, updating to 2.5.3 made that work.
05:28vijaykiranLeonidas: which version of lein are you using ?
05:28vijaykiranLeonidas: ah - just saw that upgrade fixed :)
05:35marshzordoes anyone have any good articles or resources on how to organize clojure namespaces? I have a single page reagent application and it's just one huge 'core' namespace, I'd like to refactor it to be more organized...
05:44kungimarshzor: So whats keeping you from refactoring it?
05:44kungiJust found https://github.com/venantius/ultra ... This looks really nice
05:45marshzorkungi: nothing, just looking for something to read about how and why to organize namespaces, common pitfalls, best practices, etc
05:48kungimarshzor: Hmm I don't know of any such tutorial.
05:48marshzorokay well ty anyway kungi
05:54vijaykiranmarshzor: start with the "single-responsibility" guideline
05:56marshzorty vijaykiran
06:48sameerynhodoes any one used AVOUT before ?
07:11mpenetthe DailyMail used to, but not anymore (outstanding bugs & inactivity if I recall)
08:55stainwhat is the best way in Clojure to receive from a Java parse() method that takes a callback interface? I am looking to make a lazy sequence or something (transducers?) as I only need to process the stream once.
08:55stain(interface: https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/system/StreamRDF.html sent to https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFDataMgr.html#parse-org.apache.jena.riot.system.StreamRDF-java.lang.String- )
08:56stainit sounds like a queue.. or would the clojure.core.async be more appropriate?
09:03MonalisaHi... I just came across this so I have no clue about Clojure. But Id like to know... what kind of apps is it used for?, is it compiled or interpreted?, can I use it without any knowledge of Java?, any role in web development?
09:03Monalisathank you
09:03stainI would need to start the read() in a new thread as it would be blocking to do all the parsing (and thus all the callback calls)
09:04stainMonalisa: anything you like, but used particularly for web applications (even frontend with ClojureScript)
09:05stainMonalisa: on the JVM Clojure methods are compiled to JVM bytecode in the background. However you can also run it interpreted.. as it happens on the REPL shell (try lein repl)
09:05Monalisaso its both, compiled (Clojure) and interpreted (ClojureScript), a little like VB?
09:05stainyou can force compilation if you need to make class files to use back from Java code
09:06stainClojureScript is also compiled, but to Javascript
09:06stainso you won't have access to Java objects (e.g. java.lang.String) from ClojureScript
09:06MonalisaOK, I understand. Thank you very much.
09:07stainbut you should not normally need to worry too much about compilation or not :)
09:08stainif you write a clever algorithm in Clojure, it will likely run just as fast (or even faster) than the Java equivalent - as Clojure-style of functional programming can mean much less object allocations than in Java-style OO programming
09:09mpenetwell "faster" is very unusual
09:09stainbut most people using Clojure I think are either doing: a) Some modern web app, interfacing to say CouchDB. Clojure libraries for web are refreshingly simple to use. b) Data analysis, using various libraries for clojure and Java in unison to make some kind of report or derived data
09:10snowellNot to mention clojure code is roughly 1/10 the size of equivalent Java code
09:10Monalisayes... I'm in Web Development and I came across Light Table. I read it supports Clojure but I literally have no clue about it so I was curious about the language and its applications... this is very useful, thanks again.
09:11stainmpenet: yeah, it's tricky to get it into faster as the Java compiler is so good.. you would have to pump your algorithm full of type hints and use basic types.
09:11mpenetEven then, I can't think of a single example. Unless you mean with lazyness, but it doesn't count in my book.
09:12mpenetsame about allocs, but that said clojure performance is very decent
09:13stainwhy doesn't lazyness count? That is (until Java 8) quite awkward to do in Java
09:13mpenetbecause you can't compare something that does a computation vs something that doesn't
09:14mpenetand say it's more performant
09:14mpenetimho
09:14stain:)
09:17qsystrue, you can't compare apples with oranges, but the final result is: if I do the same in idiomatic Java - hu, does it exist? - or in idiomatic clojure, performance in clojure is pretty much similar or better in clojure.
09:18stainthanks, qsys, that was my point.. that if you just go about your business as things happen in that language, then you don't need to be too concerned about Clojure performance
09:18stain(startup time is still bad though!)
09:36jonathanji found https://github.com/danielsz/system but it seems like i have to manually run (reset) to have it reload my code?
09:36jonathanjwhile ring-server will reload code as it changes, which is a lot smoother
09:39jonathanjseems like that feature is only available when using system and boot... why?
09:41visofhi guys
09:42jonathanjwhy would i use boot over lein?
10:01marshzorcan anyone recommend a clojure linter?
10:02Bronsathere's eastwood
10:02marshzorthat's the only one I've found so far, I'll give it a shot I guess
10:26ambrosebsBronsa: should this just be [a] ? https://gist.github.com/frenchy64/1894dc532577833931f5
10:26ambrosebsseeing as it's a :const node
10:44Bronsaambrosebs: I need to look into this, tbh I don't think the semantics of :val are clear
10:44ucbis there any way to report which test is being run via lein test? (these are clojure.test tests)
10:45justin_smithucb: it will report on failure, but you can always add printlns
10:45ucbI was hoping I could have a scrolling list of tests being run
10:45justin_smithif you use "testing" this can add more context around a group of is calls
10:46ucbmostly because I have some tests that might hang indefinitely (I know, it's bad) and I'd like to know when they do
10:46ambrosebsBronsa: I have pretty much no idea what "quote" means in various contexts. Seems to just come and go randomly.
10:46justin_smithyeah, you would need printlns for that
10:46ucbso the solution is to add a println at the beginning of the test?
10:46justin_smithor a fixture that prints before running each test I guess
10:47Bronsaambrosebs:
10:47ucbyeah, but I can't really print anything meaningful there, can I?
10:47Bronsaambrosebs: the issue is that it's not really clear when something should be a :quote->:const vs when it should just be a :const
10:47justin_smithucb: no, since it is passed the function and not the var, and the function doesn't really give a readable result when printed
10:48ambrosebsBronsa: ok
10:48BronsaCompiler.java only has ConstExpr but that has its own issues aswell
10:48justin_smithucb: I could see making a "print,test,print" macro
10:48BronsaATM I don't think anything in :const is strictly wrong as much as it's inconsistent
10:49Bronsai.e. in some occasions we get a :quote+:const with no 'quote in :val and sometimes we get :const with 'quote in val
10:51ambrosebsBronsa: ok, the new :const behaviour makes more sense
10:52Bronsayeah well, the *old* :const behaviour was wrong :)
10:53ambrosebsBronsa: right. It did break my recursive type inference tho.
10:53ambrosebs['a] suddenly is of type (HVec [(List* 'quote 'a)])
10:53ambrosebs:)
10:54BronsaIIRC the old behaviour would just blindly drop *all* quotes no matter how nested
10:54Bronsaso '['['a]] would -> [[a]]
10:54Bronsaor something like that
10:55Bronsawhich is fine if all the elements inside a const are anything but symbols and lists
10:55ambrosebsor sprinkle in a :quote or something.
10:55ambrosebsbut I think you're right.
10:55Bronsabut if they are either symbols or lists, then evaluation changes
10:56Bronsaambrosebs: pattern matching AST nodes is hard :) lots of potential ways to represent the same node
10:57jjttjjanyone familiar with incanter 1.9, specifically incanter-zoo? having trouble with the zoo function returning only one row: https://www.refheap.com/111377
10:57Bronsatools.analyzer tries to be as self-consistent as possible in the way nodes are repsented but sometimes it's impossible
10:57ambrosebshttps://www.irccloud.com/pastebin/fzettnFC/
10:58Bronsaambrosebs: yeah
10:59Bronsaambrosebs: I guess what contributes to the confusion is the use of []. if we were comparing '('a) with ''(a) then suddently the difference would make more sense
11:29ambrosebsBronsa: is the type of a :quote node just the type of aits :expr?
11:29ambrosebsso far that's worked
11:30ucbjustin_smith: right, gotcha, thanks.
11:55gfredericksI have a test.check API design conundrum
11:55gfredericksI want to add a generator for doubles; and it should probably be configurable in a few ways
11:55justin_smitha conundrum!
11:55gfrederickswhich implies you could call (gen/double {...opts...})
11:56gfredericksbut if you want default behavior, users would expect to be able to use `gen-double` the same way they use `gen/int`, but making it a function means they have to use `(gen/double)` instead
11:57gfrederickscould also have two different generators so you can have both APIs, but that also feels weird
11:58gfrederickswhat would you, dearest IRC user, expect to find?
12:02justin_smithgfredericks: clearly this would be easier in ruby where access and invocation are blurred
12:03justin_smithgfredericks: it's difficult, for uniformity everything would have to become an invocation (or maybe deref?), but I see a clear advantage of things that are more static
12:03gfredericks2yeah I thought of that. let's all switch to ruby real quick
12:03justin_smithheh
12:04justin_smithhow many options will gen/double accept? enough so that you couldn't reify each option as its own variant?
12:04Bronsaambrosebs: yeah
12:04gfredericks2yeah, you want to control at least min, max, infinities, NaN
12:05justin_smithgfredericks: which means you define gen/double00 gen/double01 ... gen/double15
12:05TMAgfredericks2: I would go with gen/double that is used the same as gen/int and provide the optionful variant as gen/double*
12:06gfredericksTMA: yeah I was just thinking of that exact naming convention
12:06gfredericksand the gen/double docstring would mention gen/double*
12:07gfredericksokay I think this isn't terrible
12:07justin_smithgfredericks: definitely do not do it via a global or thread-bound var that controls the behavior of gen/double
12:08gfredericksjustin_smith: the evilest thing I thought of was an object that's both a generator and a function that returns a generator
12:08justin_smithoh, wow
12:09gfredericksthat might require low-level changes actually; generators are currently defrecords, andy ou can't override a defrecord's IFn behavior
12:10TMAif it would be posible to use (def my-gen-double (gen/double* ...) and then use my-gen-double it would be a great bonus
12:10justin_smithgfredericks: I'm totally going to make a webcomic with a character named andy ou and bad kerning
12:10gfredericksTMA: that's how things normally work
12:11gfredericksjustin_smith: is that two characters?
12:11gfredericksor the comic text would have pervasive bad kerning?
12:11justin_smithgfredericks: with bad kerning you can never tell
12:11justin_smithwhether it's two characters in question, or just one
12:11gfredericksperfect
12:12gfredericksso my next conundrum is about generating large integers in a portable way
12:13justin_smithclj / cljs ?
12:13gfredericksthe problem statement is that all test.check's normal integer functions only generate things in the range -200 -> +200, which is good for certain uses but horrendous in others
12:13gfredericksyeah
12:13gfredericksso it'd be nice to have a way to generate integers and get big stuff too
12:13gfredericksI feel like in clj that means generating longs and BigInts
12:13gfredericksso you could e.g. get 300 digit numbers sometimes
12:13gfredericksbut in cljs the best you can do is -2^53 - +2^53
12:14gfredericksgive or take
12:14gfredericksI guess another option to be a bit more equitable is to have the clj version only generate Longs
12:14gfredericksand then have a special clj-only generator that gets Even Bigger
12:14justin_smithgfredericks: intuitively it makes sense to me that you would have more distinctions between integral types than the host platform does
12:14gfredericksgen/large-int being the portable version, and gen/really-large-int being clj-only
12:14justin_smithrather than fewer
12:15gfredericksyou could even extend gen/really-large-int to cljs via goog.math.Integer
12:17gfredericksokay well I think this is looking promising
12:18gfredericksonly other thing I have to do is bite the bullet and create gen/let
13:52kungiIs there a linter for clojure which finds unused functions in my codebase?
13:56justin_smithkungi: I think you can ask eastwood to warn about unused functions
13:58justin_smithkungi: actually no, looks like eastwood does not currently check for that - maybe it could be easily added though, given the kind of data eastwood already collects
13:59kungijustin_smith: thank you
14:00justin_smithit will warn for unused namespaces though... (by default that warning is off)
14:21pndpoHello!
14:37jonathanjdoes anyone have personal experience using boot and why one would choose it over lein?
15:17WorldsEndlessBasic question: how can I produce a SINGLE map from a (for) that produces keys and values? I keep getting a {{:map "of"}{:more "maps"}}
15:19ucbWorldsEndless: assuming your for looks like (for [a-map some-maps] ...) you could just (apply merge some-maps)
15:19ucbor even (reduce merge some-maps)
15:19ucbthat'll give you a map with all the k/vs from the maps
15:19ucbkeep in mind you'll get k/v pairs overwritten if they clash
15:24WorldsEndlessIn my case the for is looping over a vector of javascript objects, extracting the keword and value from them
15:24amalloyyou cannot possibly produce a map from a for comprehension: it always produces a sequence. rather, you take the sequence it produces and then make a map from that
15:25gfredericksalso see plumbing.core/for-map
15:25WorldsEndlessamalloy: Right. I've been trying variations of "into", "merge", "reduce" but can't seem to get the dual results to be bare
15:26WorldsEndlessSeems like I need to destructure the product of (for) somehow
15:27WorldsEndlessRight now it's just this:
15:27WorldsEndless(for [i form-seq] (if (not-empty (.-name i)) {(keyword (.-name i)) (.-value i)}))
15:27WorldsEndlessWhich gives me a map of maps
15:27WorldsEndlessRather, a sequence of maps
15:28justin_smith,(into {} (for [[k v] [[:a 0] [:b 1]]] [k (* v v)]))
15:28clojurebot{:a 0, :b 1}
15:28justin_smithhaha, bad numbers to use in that example
15:28justin_smith,(into {} (for [[k v] [[:a 10] [:b 11]]] [k (* v v)]))
15:28clojurebot{:a 100, :b 121}
15:28WorldsEndlessI'm going to have to stare at that for a second...
15:29justin_smithWorldsEndless: into takes [k v] vectors and makes a map
15:29justin_smith,(into {} [[:a 0] [:b 1]]) ; so just return a vector with two elements at each step
15:29clojurebot{:a 0, :b 1}
15:31justin_smithwell into with a map does - you can use into with other types too
15:32WorldsEndlessI use into with for a lot; but something must have been wrong in my syntax previously. Wrapping the pairs in a vector, it's working now
15:33WorldsEndlessThanks, justin_smith
15:35gfredericksgenerating a double in an elegant way takes a lot of concentration
16:10hiredman
16:36patchworkI am getting a StackOverflowError when using enlive to parse html... and I have a try/catch around it but it doesn't seem to catch it
16:36patchworkIs there something special about stack overflows that make them uncatchable?
16:36justin_smithare you catching Exception or Error?
16:36justin_smithbecause Error is not a subclass of Exception
16:36patchwork??? Oh man
16:36patchworkI'm sure there is a good reason for that....
16:37lumaerrors are not meant to be caught
16:37mavbozoerror means can't continue, exception means can or might continue. i think i read that somewhere from a clojure book
16:38luma"An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions."
16:38patchworkBy the way, stackoverflow.com has ruined all searches for issues with actual stack overflows
16:38justin_smithlol
16:39patchworkSo, really this is a parse error in the html and I want to just continue if it fails... will I have problems with that?
16:39patchworkLikely it is a bug in enlive if it can produce stack overflow errors
16:42patchworkAh, I see I cannot even catch a StackOverflowError
16:52noncom|3i need to make a button that would download a html file generated by reagent as a doc file, how can i do this? is this possible to somehow do this from a web page?
16:53noncom|3ideally i have a piece of page that is generated by reagent. i would like to call the function that generates the piece, have reagent render the html, and download the text file, assigning a custom name to it, like "report.doc"
16:54justin_smithnoncom|3: yeah, you can absolutely make a button that does that with some cljs - if you look up examples for "generating a file for download" or similar I think there are examples out there
16:54noncom|3okay, sounds good
16:54justin_smithI did it with my app via some interop
17:16justin_smithhaha, clojure.lang.Util.sneakyThrow
17:21cflemingOk, JDK6 is making me crazy.
17:22cflemingI can't compile my Clojure code under JDK6, because I get the "Insufficient permissions to access window server" error.
17:22cflemingSetting java.awt.headless=true doesn't help.
17:22cflemingSo now I have this ridiculous frankenbuild where I have to shell out to JDK7 to compile my Clojure.
17:23justin_smithbecause you need to support jdk6?
17:23cflemingNow when I'm trying to run under JDK6, I need the jsr166y jar for the reducers ns.
17:23cflemingjustin_smith: Yeah, it's still the best option for IntelliJ on the Max
17:23cflemingMac
17:24cflemingUnfortunately, although the jsr166 page says the jar is usable with JDK6, jsr166y/ForkJoinPool has a major.minor of 51.0 (JDK 7)
17:26cflemingWhich makes no sense, since IIRC ForkJoin came in JDK 7
17:27Glenjamin,(-> 1 (+ 1) (doto prn) (+ 1)) ; anyone know of a nice shorthand equivalent to this, but which works with ->> ?
17:27clojureboteval service is offline
17:33rhg135~clojurebot
17:33clojurebotclojurebot will become skynet
17:33rhg135I see
17:36noncom|3Glenjamin: equivalent to doto in such a situation?
17:44justin_smith,(->> 1 (+ 1) (#(doto % prn)) (+ 1))
17:44clojureboteval service is offline
17:44justin_smith:P
17:44justin_smithGlenjamin: I don't know if that is "nice", but at least it's correct in behavior
17:47noncom|3justin_smith: what would be the best reagent function to render html to a string?
17:48noncom|3render-to-string?
17:48justin_smithI'm not sure actually - but that sounds promising
17:48noncom|3:D
18:24SchrostfutzHow do I append two strings to each other?
18:24justin_smithSchrostfutz: str
18:24justin_smiththis won't change either string, it will create a new one
18:25Schrostfutzjustin_smith: thanks
19:41xeqiis there a protocol I can use in c.j.jdbc to define how to act like a db-spec? Wanting to use something like https://github.com/weavejester/duct-hikaricp-component without forcing other system pieces to reach into the :spec key
19:47gfredericksanybody think there's a way to reverse the bits in a 52-bit JS integer in less than 52 steps?
19:49TEttingergfredericks: maybe. http://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel
19:50gfredericksoh geez
19:50gfredericksthat'd be hella weird to try to adapt to 52 bits
19:50gfredericks~52 is not a power of 2
19:50clojurebotYou don't have to tell me twice.
19:50TEttingeryou're not the only one doing hella weird low-level code
19:51amalloygfredericks: i don't think it's that hard to adapt for not being a power of 2. just round down every time you divide by 2, and leave the middle bit in the middle
19:52justin_smithmiddle bit?
19:52justin_smithah, in a nibble, right
19:52gfredericksamalloy: man I dunno there's gonna be some complimications
19:53amalloycomplimications left as an exercise for the reader
19:53arrdemthat's called cheating amalloy
19:53gfredericks~complimications |left| as an exercise for the reader
19:53clojurebotOk.
19:53arrdemWould someone with better elisp-foo than me please review https://github.com/gstamp/align-cljlet/pull/10 ?
19:53arrdemhacked that out b/c it's been driving me up the wall, but my elisp is uh poor at best.
19:53gfredericks~protip is <reply> Don't complimicate -- simplificafy.
19:53clojurebotOk.
19:56TEttingergfredericks: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators
19:57TEttingeranything bitwise uses 32 bits only in js
19:57gfredericksyeah
19:57gfrederickscould do it in two steps if there was a 32 reverser though
19:57TEttingersure
19:58gfredericksbitwise ops on signed ints are enough of a headache; why not do bitwise ops on integers embedded in doubles WHY NOT IT WILL BE GREAT
19:58gfredericksI think they're also signed
19:59TEttingerthey are
20:17TEttingergfredericks: got it
20:17TEttinger,(let [b 15] (unchecked-byte (bit-shift-right (unchecked-multiply-int (bit-or (bit-and (unchecked-multiply-int b 0x0802) 0x22110) (bit-and (unchecked-multiply-int b 0x8020) 0x88440)) 0x10101) 16)))
20:17clojureboteval service is offline
20:18TEttingerman...
20:18TEttingerb = ((b * 0x0802LU & 0x22110LU) | (b * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16;
20:18TEttingerthis only uses 32-bit operations
20:18TEttingerthat works on one byte
20:21gfrederickswhat's going on here
20:21gfredericksis this supposed to be a 52-bit reverser that works in cljs?
20:21gfredericksor an 8-bit?
20:22TEttingerbyte reverser in 7 ops, uses only 32 bit operations
20:22TEttingerhm
20:23TEttingerbut then you'd need to get each byte in palce
20:23TEttingerplace
20:26TEttingerI don't even know how you'd access the higher 20 bits
20:43Niac,(+ 152 8 3 3 2 2 4)
20:43clojureboteval service is offline
20:43Niac,(+ 152 8 3 3 2 2 4)
20:43clojureboteval service is offline
20:43arrdem,1
20:43clojureboteval service is offline
20:43arrdemwhat are you good for clojurebot
20:44rhg135~this
20:44clojurebotthis has been another episode of gfredericks in wonderland
20:45rhg135how fitting xD
20:45arrdemheh
20:53gfredericksTEttinger: the high bits you get via division
20:54arrdemgfredericks: the fuck
20:54gfredericksarrdem: hiya
20:55amalloygfredericks gets high via bit division
20:55arrdemheh
20:56arrdemoh got it so the bit shift ops will do silly things, but div still works
20:56gfredericksain't that the truth
20:56gfredericksarrdem: right
20:56gfredericksI sure hope it does
20:56arrdemhah
20:57gfredericks~you |never can tell| with javascript
20:57clojurebotYou don't have to tell me twice.
20:58rhg135~you
20:59clojurebotyou are http://images2.fanpop.com/images/photos/3000000/Arrowed-teen-girl-squad-3099521-570-420.jpg
21:00rhg135I'm done
21:00gfredericks~this
21:00clojurebotthis is very easy to do with loop
21:00gfredericks~this
21:00clojurebotthis is not allegro
21:00rhg135~bots
21:00clojurebotbots are annoying, except for clojurebot
21:01rhg135so clojurebot killed lazybot
21:02arrdema vile deed
21:27puredangergfredericks: HA HA HA IN MY OWN PERSONAL MAVEN HELL
21:28TEttingerpuredanger: I know the feeling
21:28puredangergfredericks: I am still working on yer test.check build. it's a whole ball of dependency nastiness in the various maven and hudson bits
21:28TEttingeris it encoding stuff that's causing trouble, by any chance?
21:28puredangernah, this is old old problems
21:29puredangerwith maven 3 and hudson compatibility
21:29gfredericksoh man oh man
21:30puredangertest.check uses cljc, which requires latest clojure-maven-plugin, which has dependencies that require maven 3, which the minor version of hudson we're using did not (yet) support well
21:30puredangereverything builds fine for me locally, it's just in the ci box that there are problems
21:30puredangerI will likely have to update hudson which probably no one has done in years
21:31arrdem0_0
22:22gfredericksomg I think I did it
22:23gfredericksI wrote a generator for doubles in test.check, got it to generate this list (https://www.refheap.com/111386), and it generated the exact same set of numbers in cljs
22:27gfredericksit's harder than it sounds because of the extra particular way I'm generating them, using lots of stupid Math/Double methods that aren't available in JS
22:45TimMcYou got doubles math to be consistent between JVM and JS?
22:45owlbirdwhich jdbc library is better? I got clojure.jdbc, clojure.java.jdbc
22:50gfredericksTimMc: right; I mean it shouldn't be too surprising since presumably they're targeting the same spec; but doing something non-trivial in the face of the different APIs is a mess
22:50gfredericksowlbird: I've never heard of clojure.jdbc
22:52TimMcgfredericks: I'm impressed anyway.
22:53gfredericksthings from the jvm I had to implement raw: Long/reverse, Math/getExponent, and Math/scalb
22:54gfredericksnow to measure how embarrassingly slow the cljs version is
22:56gfredericksonly 9x slower; that's fine I guess
23:12gfredericksokay so my double generator has four options: :infinite?, :NaN?, :min, and :max
23:12gfredericksby default infinities and NaNs are on
23:13gfredericksdoes it make sense to say if you supply a :max, the positive infinity gets disabled, and similar for min/negative?
23:13gfredericksbut the NaN stays on?
23:46TEttingerholy crap gfredericks
23:46TEttingerthe stuff you're doing for tests is amazing
23:47TEttingergfredericks: I think unless the min is greater than 0.0 or the max is less than 0.0, then NaN should be possible
23:47TEttingerbut I think you can only generate NaN by dividing 0.0 by 0.0, or requesting it specifically
23:47TEttingerand if you can specifically request NaN, then you don't have a max or min
23:49rhg135Is NaN even a good idea, for the next language I implement
23:50gfredericksI've never associated NaN with 0.0
23:50gfredericksI think you can get it a variety of ways
23:50gfrederickse.g.
23:50gfredericks,(+ Double/POSITIVE_INFINITY Double/NEGATIVE_INFINITY)
23:50clojureboteval service is offline
23:50gfredericks&(+ Double/POSITIVE_INFINITY Double/NEGATIVE_INFINITY)
23:51gfredericksyou'll have to take my word for it
23:52amalloythere are indeed a few ways
23:53amalloyrhg135: if you support IEEE floating point you have no choice, and if you don't support it then i don't see a reason to include nan
23:54gfredericksI'm of the strong opinion that floating point should be syntactically second class in all new languages going forward
23:55gfredericksI'll shout loudly at anybody who says otherwise
23:55rhg135Hmm, it's an alternative to throwing, and I don't think anyone should use any language I make, so no amalloy
23:57gfrederickswelp there went my whole day https://twitter.com/gfredericks_/status/662131518098309120
23:58rhg135But, gfredericks, few men can say that