2017-06-25
| 01:44 | jeaye | I'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:45 | jeaye | In short, I'm type checking a fn definition by validating that each call in its body matches a supported overload. |
| 03:01 | amalloy | jeaye: does that actually work? if nothing else, valid-callo looks wrong to me |
| 03:05 | amalloy | and 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:08 | amalloy | anyway, 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:24 | xrash | what is the idiomatic way of executing a sequence of functions until one of them returns "not nil"? |
| 03:28 | dysfun | some ? |
| 03:28 | dysfun | or some-fn if you want a fn back |
| 05:24 | lxsameer | hey folks |
| 05:24 | dysfun | hiya |
| 05:24 | lxsameer | how can i track a dependency conflict ? |
| 05:24 | dysfun | lein deps :tree |
| 05:24 | TEttinger | use the power of frustration |
| 05:25 | TEttinger | if you don't have a red lantern ring, then lein deps :tree may be a better choice |
| 05:26 | lxsameer | :)) thanks guys |
| 06:24 | dysfun | :/ carmine is unhappy |
| 07:44 | lxsameer | guys, how should i use fast-resource or resource in order to serve static files in pedestal ? |
| 07:59 | dysfun | clojure.spec is confusing me greatly: https://gist.github.com/jjl/ae57ac46f681a2a0c146856ddc4e7646 |
| 07:59 | dysfun | how can it not be invalid if there is something required and the collection is empty? |
| 08:00 | osfameron | I always read :req-un as a French shark |
| 08:01 | dysfun | it's a french require one |
| 15:52 | jeaye | amalloy: It "worked" in the tests I gave it. ;) |
| 15:52 | amalloy | solution: write better tests |
| 15:53 | jeaye | No, this is just in the repl. |
| 15:53 | jeaye | As I said, I'm just toying around with core.logic and I don't understand it very well yet. |
| 15:54 | jeaye | Thanks 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:57 | amalloy | well, 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:57 | amalloy | but 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:24 | Seylerius | Funny-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:25 | Seylerius | ☹ |
| 21:26 | mercwithamouth | so 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:32 | mercwithamouth | oh..scratch that...as small as it is it's just a simple pattern. cool beans |
| 22:01 | matthavener | mercwithamouth: sometimes you'll find that "hasn't been touched in a year" is a very good thing :D |
| 22:07 | TEttinger | Seylerius: there's still things that do that |
| 22:08 | Seylerius | TEttinger: Do tell |
| 22:08 | TEttinger | graal is in theory capable of it, and java 9 is supposed to have a graal-based AOT compiler for java |
| 22:08 | TEttinger | graal I have little faith in. java 9 even less |
| 22:09 | TEttinger | it claims it's delivered, but graal doesn't even run on windows. http://openjdk.java.net/jeps/295 |
| 22:10 | TEttinger | only supports linux x64, heh |
| 22:10 | TEttinger | write once, run once |
| 22:11 | TEttinger | AOT 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:11 | TEttinger | may not use lambdas or invokedynamic or... much |
| 22:12 | TEttinger | there's the simple option of bundling a JRE with your jar. |
| 22:13 | TEttinger | packr does this for windows, linux, and mac, and I had it workin at one point with Clojure |
| 22:13 | TEttinger | the whole system for packr changed recently, it may be more compatible with uberjars |
| 22:13 | TEttinger | well, less than a year ago maybe |
| 22:17 | TEttinger | jtransc I haven't checked on in a while |
| 22:18 | TEttinger | https://github.com/jtransc/jtransc |
| 22:18 | TEttinger | looks like it gets better and better, but no clojure support yet |
| 22:21 | Seylerius | TEttinger: It's not JVM availability I'm concerned about so much as startup time. |
| 22:21 | TEttinger | nothing will help there |
| 22:21 | TEttinger | an SSD willl |
| 22:21 | Seylerius | Heh |
| 22:22 | TEttinger | really though. a solid-state drive will cause most startup time to shrink in general |
| 22:23 | TEttinger | I wonder if you could fit some minimal VM in a ramdisk |
| 22:34 | random_numbers | TEttinger: Yeah. Debian standard is small enough. |
| 23:42 | jirb | anybody know why (def ^:const WEEKEND #{DayOfWeek/SATURDAY DayOfWeek/SUNDAY}) is giving me an exception on compile? |
| 23:42 | jirb | "Can't embed object in code, maybe print-dup not defined: SATURDAY" |
| 23:43 | jirb | it's fine without the const tag |
| 23:44 | justin_smith | sounds like it can't create reloadable bytecode with that value directly embedded |
| 23:44 | justin_smith | "const" isn't just about whether something would change, it asks for a specific kind of optimization iirc |
| 23:45 | justin_smith | https://stackoverflow.com/a/9165999 |
| 23:50 | justin_smith | so 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:50 | jirb | ahh |
| 23:51 | jirb | yeah, i'd been looking at that SO but didn't know enough for it to be really meaningful |
| 23:53 | jirb | so i guess i'm wondering what the bounds are of what it can/can't put into bytecode, and possibly why |
| 23:53 | jirb | looks like it has no trouble with lists or maps containing objects |
| 23:54 | jirb | or sets containing longs |
| 23:54 | jirb | or sets of strings |
| 23:54 | justin_smith | jirb: note that the error message mentions print-dup, which is a multimethod clojure uses for data that should be readable |
| 23:55 | justin_smith | and that multimethod is extended to clojure datatypes plus strings and regexes etc. |
| 23:55 | justin_smith | you could try to defmethod print-dup for that data type and see what happens? |
| 23:56 | jirb | nice, good call |