#clojure logs

2017-06-25

01:44jeayeI'm quite bad at core.logic, since I'm just learning it. Is there a better way to do this? https://gist.github.com/jeaye/bece34943b4508c789bde770ed168a56
01:45jeayeIn short, I'm type checking a fn definition by validating that each call in its body matches a supported overload.
03:01amalloyjeaye: does that actually work? if nothing else, valid-callo looks wrong to me
03:05amalloyand you're using everyg a lot, which...i mean, i'm not a core.logic expert, but if your core algorithm uses finite-domain stuff like everyg, i'm not sure what you're getting out of core.logic. it seems like your problem would be much more easily written in basic clojure with (every? valid? calls)
03:08amalloyanyway, the obvious error in vallid-callo is that core.logic goals do not perform side effects, so (let [...] goal1 goal2) is just the same as (let [...] goal2). to assert that two goals both match, you need to combine them in a core.logic grouping construct like l/fresh or l/all
03:24xrashwhat is the idiomatic way of executing a sequence of functions until one of them returns "not nil"?
03:28dysfunsome ?
03:28dysfunor some-fn if you want a fn back
05:24lxsameerhey folks
05:24dysfunhiya
05:24lxsameerhow can i track a dependency conflict ?
05:24dysfunlein deps :tree
05:24TEttingeruse the power of frustration
05:25TEttingerif you don't have a red lantern ring, then lein deps :tree may be a better choice
05:26lxsameer:)) thanks guys
06:24dysfun:/ carmine is unhappy
07:44lxsameerguys, how should i use fast-resource or resource in order to serve static files in pedestal ?
07:59dysfunclojure.spec is confusing me greatly: https://gist.github.com/jjl/ae57ac46f681a2a0c146856ddc4e7646
07:59dysfunhow can it not be invalid if there is something required and the collection is empty?
08:00osfameronI always read :req-un as a French shark
08:01dysfunit's a french require one
15:52jeayeamalloy: It "worked" in the tests I gave it. ;)
15:52amalloysolution: write better tests
15:53jeayeNo, this is just in the repl.
15:53jeayeAs I said, I'm just toying around with core.logic and I don't understand it very well yet.
15:54jeayeThanks for the feedback though; I _can_ very easily write this in normal Clojure, and I have. Trying to do it in core.logic is a much more challenging exercise.
15:57amalloywell, practice is always good. you might have more fun if you explored the basics of core.logic first; starting with finite-domain stuff means you miss the exciting stuff like functions that can, given a desired output, produce a list of all possible inputs that would lead to it
15:57amalloybut if this problem you're solving is the one that interests you, and you want to use it to practice core.logic, don't let me dissuade you
21:24SeyleriusFunny-but-sad: I just learned about GCJ (and its possibility of compiling JARs to native code), and then immediately thereafter learned that it's dead, and wasn't even fully alive to begin with.
21:25Seylerius
21:26mercwithamouthso i just stumbled across a book "Building Systems in Clojure and Clojurescript and they mention a library 'Redux'. Is this a library that people are still using? It doesn't seem to have been touched in a year
21:32mercwithamouthoh..scratch that...as small as it is it's just a simple pattern. cool beans
22:01matthavenermercwithamouth: sometimes you'll find that "hasn't been touched in a year" is a very good thing :D
22:07TEttingerSeylerius: there's still things that do that
22:08SeyleriusTEttinger: Do tell
22:08TEttingergraal is in theory capable of it, and java 9 is supposed to have a graal-based AOT compiler for java
22:08TEttingergraal I have little faith in. java 9 even less
22:09TEttingerit claims it's delivered, but graal doesn't even run on windows. http://openjdk.java.net/jeps/295
22:10TEttingeronly supports linux x64, heh
22:10TEttingerwrite once, run once
22:11TEttingerAOT initial release in JDK 9 is provided for experimental-only use and is restricted to Linux x64 systems running 64-bit Java with either Parallel or G1 GC.
22:11TEttingermay not use lambdas or invokedynamic or... much
22:12TEttingerthere's the simple option of bundling a JRE with your jar.
22:13TEttingerpackr does this for windows, linux, and mac, and I had it workin at one point with Clojure
22:13TEttingerthe whole system for packr changed recently, it may be more compatible with uberjars
22:13TEttingerwell, less than a year ago maybe
22:17TEttingerjtransc I haven't checked on in a while
22:18TEttingerhttps://github.com/jtransc/jtransc
22:18TEttingerlooks like it gets better and better, but no clojure support yet
22:21SeyleriusTEttinger: It's not JVM availability I'm concerned about so much as startup time.
22:21TEttingernothing will help there
22:21TEttingeran SSD willl
22:21SeyleriusHeh
22:22TEttingerreally though. a solid-state drive will cause most startup time to shrink in general
22:23TEttingerI wonder if you could fit some minimal VM in a ramdisk
22:34random_numbersTEttinger: Yeah. Debian standard is small enough.
23:42jirbanybody know why (def ^:const WEEKEND #{DayOfWeek/SATURDAY DayOfWeek/SUNDAY}) is giving me an exception on compile?
23:42jirb"Can't embed object in code, maybe print-dup not defined: SATURDAY"
23:43jirbit's fine without the const tag
23:44justin_smithsounds like it can't create reloadable bytecode with that value directly embedded
23:44justin_smith"const" isn't just about whether something would change, it asks for a specific kind of optimization iirc
23:45justin_smithhttps://stackoverflow.com/a/9165999
23:50justin_smithso to go into more detail about this problem, making something a const says that compiled code that uses it shouldn't look up the var but should instead have the value embedded in it's bytecode, and the compiler is saying it doesn't know how to put that value in bytecode
23:50jirbahh
23:51jirbyeah, i'd been looking at that SO but didn't know enough for it to be really meaningful
23:53jirbso i guess i'm wondering what the bounds are of what it can/can't put into bytecode, and possibly why
23:53jirblooks like it has no trouble with lists or maps containing objects
23:54jirbor sets containing longs
23:54jirbor sets of strings
23:54justin_smithjirb: note that the error message mentions print-dup, which is a multimethod clojure uses for data that should be readable
23:55justin_smithand that multimethod is extended to clojure datatypes plus strings and regexes etc.
23:55justin_smithyou could try to defmethod print-dup for that data type and see what happens?
23:56jirbnice, good call