#clojure logs

2014-07-18

00:04BorisKourtHi, I have been following this Stasis guide: http://cjohansen.no/building-static-sites-in-clojure-with-stasis and am almost at the end with everything running smoothly. Unfortunately I hit a snag with Optimus exporting:
00:04BorisKourtException in thread "main" java.lang.IllegalArgumentException: Parameter declaration missing, compiling:(cjohansen_no/web.clj:13:43)
00:04BorisKourtThis is in the ns statement
00:05BorisKourtIt appeared when I added [optimus.export] into the :require
00:23BorisKourtGot messed up thinking that it was in the NS as the line number pointed to the end of that. It was a defn instead of dfn.
00:23BorisKourterr def*
03:53hhenkelGood morning all. Anyone able to tell me what I'm missing here: https://www.refheap.com/88320
03:54hhenkelI would expect to get a String as well in the "TRACE given-bean"
03:58hhenkelSorry, I meant "TRACE type given-bean:"
04:00mthvedthhenkel: looks like you’re mapping onto a String?
04:00mthvedta string is a seq of chars
04:04hhenkelmthvedt: Ah yes, absolutely....request is a list and I'm trying to map every item (which holds different values) to the function
04:07hhenkelmthvedt: I'm currently not getting it how to map two values of every item...I'm makeing a coffee break, will be back in about 20 min.
04:12mthvedthhenkel: not sure what you’re trying to do, but it looks like you want to make a closure, and map that to one seq
04:13mthvedtsomething like (map #(get-read-request mbean %) seq-of-attributes)
04:40hhenkelmthvedt: The break helped...I figured it out. It is totally unnecessary to use map there in my code.... :(
04:40mthvedtcoffee solves everything
05:18wombawombahow do I thread a list? I tried (apply (-> "a b c d") [.toUpperCase (.replace "A" "X")]) but it doesn't seem to work
05:22hyPiRionwombawomba: (-> "a b c d" .toUpperCase (.replace "A" "X"))
05:22bsteuber,(-> "a b c d" .toUpperCase (.replace "A" "X"))
05:22clojurebot"X B C D"
05:23hyPiRionIf you want to thread an arbitrary list, you have to use thrush.
05:23hyPiRion$google fogus trush
05:23lazybot[fogus: Thrush in Clojure – Redux] http://blog.fogus.me/2010/09/28/thrush-in-clojure-redux/
05:24wombawombayeah the problem is that I want to do this in a function that takes the list
05:25hyPiRionthe -> macro is a macro, so it cannot be applied or reduced -- it's not a function
05:25bsteuberwombawomba: you'll need a macro for this, since -> is a macro too
05:26wombawombaright
05:27bsteuber(defmacro thread-abcd [actions] `(-> "a b c d" ~@actions))
05:27wombawombaperhaps there's a way to achieve the same effect without using ->?
05:27pyrtsa,(reduce #(%2 %1) "a b c d" [#(.toUpperCase %) #(.replace % "A" "X")])
05:27clojurebot"X B C D"
05:27pyrtsawombawomba: ^
05:27wombawombayeah, I'll just do that then :)
05:28wombawombaI guess that's what the thrush thing does too
05:28wombawombathanks
05:28bsteuberyes but then you need to use functions and not just .toUpperCase
05:28pyrtsaYep, that's thrush written out.
05:28wombawombaright. I think I can avoid using methods
05:51AeroNotixis there a library for common lisp which implements core.clj?
06:06sandbagsI am trying to use the Java library Twitter4J. I found it on Maven as {:group-id "org.twitter4j" :artefact-id "twitter4j" :version "4.0.2"} and have [org.twitter4j/twitter4j "4.0.2"] as a depedenency in project.clj but lein deps is saying it can't retrieve org/twitter4j/twitter4j/4.0.2/twitter4j-4.0.2.pom from central
06:06sandbagsany hints as to where i went wrong?
06:07stevenfxsandbags: I seem to be having issues with downloading any deps at the moment including clojure itself
06:07sandbagsstevenfx: same error? or something different?
06:08sandbagshrmm clojars.org isn't actually loading for me ... maybe a coincidence
06:08stevenfxI just created a test project and this is what I get https://www.refheap.com/88284
06:08sandbagsnot sure how clojars could affect my error anyway since the pom is coming from maven
06:08stevenfxpossible
06:09stevenfxyeah I think lien checks central first
06:09stevenfxnot sure
06:09sandbagsyour error looks much the same as mine
06:10stevenfxBut oddly I can download the file with my browser
06:10sandbagsnot sure why it's not working for me though... mine is on maven
06:10stevenfxsandbags: what system you on?
06:10sandbagssystem?
06:10stevenfxOS
06:10sandbagsOSX
06:10sandbags10.9.3
06:10stevenfxyeah same here
06:11stevenfxmaybe there some issue with jvm, Im looking for a fix so I can continue working
06:13sandbagsthis doesn't feel like a jvm issue to me
06:13sandbagsi'd be suspecting some of the plumbing that is used for dependency resolution is b0rked
06:13sandbagsodd if you can download the file by hand
06:14sandbagsclojars not loading is a bit of a smell
06:14stevenfxyeah I see the same now, clojars is blank
06:14stevenfxbut central is still fine so it should still work?
06:15sandbagsone would hope but that's a big assumption that clojars isn't a central part of the whole resolution process
06:24sandbagsso the question is, who is responsible for clojars.org? I'm sure that info is on the clojars website :)
06:25stevenfxsandbags: technomancy and ato i think?
06:25stevenfxhttps://github.com/ato/clojars-web/wiki/Contact
06:25stevenfxNot sure if its still like that
06:27stevenfxI think central gets searched first http://goo.gl/DI4tlx
06:27sandbagsodd that it fails for me as the POM i need is on central
06:30stevenfxwhats your dep again? Let me add it to my test project
06:30sandbags[org.twitter4j/twitter4j "4.0.2"]
06:33sandbagsi'm not 100% sure that's right, i'm not very au fait with Maven
06:33sandbagsbut my other attempts failed in a different way telling me the dependency couldn't be found, rather than couldn't be downloaded
06:34stevenfxNope, same issue wont work https://www.refheap.com/88328
06:34stevenfxNo you are correct http://search.maven.org/#artifactdetails|org.twitter4j|twitter4j|4.0.2|pom
06:35sandbagsokay that's useful to know... took a bit of guesswork on my part
06:35stevenfxLet me check on another system to see if the issue is the same brb
06:41stevenfxsandbags: Same issue on my linux laptop
06:42stevenfxtechnomancy: You there?
06:44sandbagsunlikely now, he's in US
06:44stevenfxyeah, was worth a try :)
06:49stevenfxI added a issue to https://github.com/ato/clojars-web/issues/231
06:49stevenfxNot sure if it should have gone somewhere else?
06:51jelfsDisclaimer - I have very little idea what I'm doing
06:51stevenfxsandbags: see if this page loads - https://clojars.org/org.clojure/clojure
06:51jelfsI have some code accessing mongdb via monger ...
06:51jelfsand some tests that exercise this code
06:51stevenfxThe main webpage does not load but that loads for me
06:51jelfsI had an idea that I might benefit from a data access protocol
06:52jelfsso I could swap out the monger with some in memory atom to speed up tests
06:52jelfsIs this insane or sensible?
06:53sandbagsstevenfx: yes that loads for me as well
06:53jelfsIf sensible do I have a single defrecord that implements the protocol and decides what method to use
06:53jelfsor do I have two implementations of the protocol and somehow decide which one to use at runtime
06:53jelfsis reify an appropriate solution?
06:54hyPiRionIs there any parsec port in Clojure?
06:55ssiderisis instaparse a good candidate?
06:58hyPiRionssideris: Oh, it was just out of curiosity.
07:01hyPiRionBut no, not for streaming parsers, which I am working on now.
07:03ssideris oh ok, didn't know that parsec was streaming
07:10sandbagsi'm trying to work out what on earth i should download if i want to install this lib myself
07:10sandbagsbut the POM file is just an XML document, it's not the code
07:10sandbagshrmm... i have a feeling i've been here before
07:11stevenfxsandbags: there is two ways
07:11sandbagsand you can't depend on POM's in project.clj
07:11sandbagsyes... i think i've been here before, you can only add artefacts
07:11sandbags(or whatever the word is that isn't a POM)
07:11sandbagsyes
07:11sandbagsi can successfully require twitter4j-core
07:12sandbagsof course i have no idea which of these artefacts i actually need :)
07:13stevenfxyeah that seems to be a pain
07:13stevenfxI feel like I just arrived in the stone age :b
07:14sandbagsbundler and rubygems have their warts, but it feels a lot less of a pain than this :)
07:14sandbagson the other hand we could just be amazed that such a Heath-Robinson machine works at all when it works :-)
07:14stevenfxbut I think we might be the only two with this issue?
07:15stevenfxbecause no one else has complained yet
07:15sandbagsi no longer have an issue per se
07:15stevenfxlol I still have issues getting deps from maven central or clojars :)
07:16sandbagsif i could just remember next time that you can't depend on a POM i will be in good shape
07:16stevenfxbut I have a fresh lein install with no cached deps
07:17stevenfxmaybe thats why no one has realized?
07:17sandbagsi feel your pain
07:17sandbagscould be
07:17stevenfxoh well, maybe its time for coffee and a break :D
07:17sandbagsit's not unusual for bootstrap cases to be less well tested
07:18stevenfxtrue
07:19stevenfxIl bug one of the maintainers to check if its just me when they come online
07:19stevenfxif I am online still :)
07:19sandbagsif you gist your steps, if i'm around later and you aren't i'll bring it up
07:20hhenkelHi all, any hint what the problem is: https://www.refheap.com/88333 ?
07:20stevenfxThanks sandbags, let me do that after my break
07:22agarmanhhenkel: looks like trying to use a function as a number
07:23hhenkelagarman: yes that is what I understand from the exception but I don't understand why at the moment.
07:23hhenkelIs there something wrong with the doall ?
07:24hhenkelserver-config is a lazySeq
07:24agarmanhhenkel: without seeing the pos?, I can't really say
07:25agarmanhhenkel: there's no call to pos? in the snippet here, but that's what's failing
07:26agarmanhhenkel: nvm, dorun has pos? call, I'm looking there...a moment
07:26agarmanyeah, you're calling the wrong version of doall
07:26hhenkelagarman: I don't have any pos? in my code.
07:27hhenkelFrom the stack trace the error is within the snippet.
07:27hhenkelThat would explain things....so how to call a "different" version?
07:27agarmanif doall has two arguments, the first is a number, second a collection
07:29hhenkelBut the exception is that the function could not be casted to a number or am O wrong?
07:29agarmanhhenkel: are you trying to schedule requests for each server config?
07:30hhenkelyes I do
07:30agarmanthen do you mean to do (doall (#(map schedule-requests % data-channel atat-pool) server-config))?
07:31hhenkelBut that will happen later on, I'm allready failing to call my function "schedule-requests"
07:36hhenkelagarman: That looks "better" though I get a different error now.
07:37hhenkelagarman: I now see an error "java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.core.async.impl.channels.ManyToManyChannel"
07:38hhenkelagarman: I guess I need a (repeat data-channel) ?
07:38hhenkelAnd also for the atat-pool thing. It looks like it is working with that now.
07:43agarmanhhenkel: good :-)
07:50hhenkelagarman: Are you familar with async? I'm seeing an "IllegalArgumentException" but there is no stacktrace so I'm not sure where it happens
07:51hhenkelHere is the error
07:51hhenkelhttps://www.refheap.com/88335
07:52hhenkelThe part after "TRACE response" is what I'd like to put into the channel.
07:58agarmanhhenkel: can't really help w/o more context, all I can tell is that somewhere there's code trying to take! or <! from an arraylist
07:59hhenkelagarman: hmm, I guess the response gives me a java.arraylist and I need to cast it to somethin clojure like
08:02hhenkelagarman: Casting with (into [] (...)) seems to help
08:06luxbockcould anyone here explain what the => macro in Prismatic's schema does? I don't understand the documentation
08:06hhenkelagarman: Hmm I've been glad too soon. Seems like I need to figure out what datatype I can put on the channel first.
08:10hhenkelagarman: Okay, figured out that I just copied stuff from "old" code where I was handling https reponse data. There is no need to do a !< at all...
08:49stevenfx_would look good with a clojure icon :) http://vorillaz.github.io/devicons/
08:51CookedGr1phondoes anyone know if I can include aliases with a leiningen plugin?
09:14hyPiRionCookedGr1phon: you can with middleware, I think. But couldn't you provide the functionality within the plugin task you define?
09:16CookedGr1phonhyPiRion: yeah, but it feels clunkier calling set-profile and executing subtasks when I could express it in an alias in a way that the user could look at it and change the steps/profile they want to execute with
09:16CookedGr1phoni want to set the profile and do three subtasks
09:16CookedGr1phonI've done that now anyway
09:51mosesThis question has to come up a lot, but Om, Reagent or Quiescent?
09:51mosesAnyone with experience in all three care to offer an opinion?
10:33boxedanyone know of a pprint version that can handle output that is largeish.. like ~200k?
10:33hcumberdalehi
10:33stuartsierraboxed: dunno, but brandonbloom has a pprint that's supposed to be faster than core's.
10:34hcumberdale(apply (fn [_ w _ wo] {:w w :wo wo}) [true '((a b) (c)) false '((d) (e f))]) << is there a better way
10:34hcumberdaletrying to split a structure by some fn with group-by, want to dismiss the "true" "false" and directly get the two resulting structures
10:35arrdem$google github bbloom fipp
10:35lazybot[brandonbloom/fipp · GitHub] https://github.com/brandonbloom/fipp
10:35stuartsierrahcumberdale: vals ?
10:36boxedstuartsierra: hmmm… java.lang.ClassNotFoundException: jsr166y.ForkJoinPool :(
10:37hcumberdalethx stuartsierra !!
10:37stuartsierraboxed: Sounds like you're trying to use Clojure reducers on JDK 1.6
10:37boxedwell crap
10:38boxedthanks
10:38stuartsierraYou can add a dependency on jsr166y (http://search.maven.org/#artifactdetails%7Corg.codehaus.jsr166-mirror%7Cjsr166y%7C1.7.0%7Cjar) or get a JDK 1.7
10:39boxedstuartsierra: cool, thanks
10:39stuartsierraOn a related note, it would be awesome to teach a bot how to query search.maven.org and Clojars.
10:40arrdemyeah, that'd be nice. maybe if I ever get around to building a clojurebot clone that doesn't ignore me and has a grimoire command that'll happen.
10:41boxedstuartsierra: that worked and is pretty damn fast, thanks again
10:41stuartsierrahttp://search.maven.org/#api
10:41boxedarrdem: well I’m currently working on making the cheatsheet usable from other code :P
10:42arrdemboxed: 's legit. I'm gonna try and spend some quality time with Grimoire later today if I can get this hello world demo working.
10:43arrdemgotta figure out a way to modularize examples so that I can take example PRs without having to re-apply the patches by hand every time I blow the whole site away.
10:44Glenjaminare they not one file per example at the mo?
10:45arrdemGlenjamin: nope, it's one file with an include prefix for every version.
10:45arrdemsadly.
10:45arrdemit needs to be one file per example
10:45arrdemhttps://raw.githubusercontent.com/arrdem/grimoire/master/_includes/1.4.0/clojure.core/DASH__GT/examples.md
10:45arrdemcase in point
10:45Glenjamini see
10:46boxedwhat’s the plan? to have a non-versioned filename and if there’s a specific version file use that instead?
10:47Glenjamincan you use yaml frontmatter perhaps?
10:47Glenjamini dunno how flexible jekyll is, but being able to tag files as version X+ would be neat
10:48arrdemjekyll's not that flexible.
10:48arrdemI suspect this is gonna be the thing that forces me to build a "real" static site gen from one of the Clojure frameworks.
10:48arrdembut we'll see.
10:50arrdemI really don't want to go to a db backed site, both for performance and for ease of contribution/management.
10:52_alejandroIs it possible to use project.clj to force a jdk version? e.g. fail if JDK < 1.7 ?
10:52Glenjaminyeah, i think github pages + PRs is a solid model
10:52Glenjaminespecially as the number of people who can merge PRs goes up
10:53arrdemRight. Besides, GH/PRs provides "auth" at zero cost/effort to me :P
10:53boxedyea, the key is to have a lot of committers
11:00deathknightGot my feet wet with clj-amazon...realized I must learn the way of the macro *_*
11:01winkIf you stare into the macro, the macro stares back at you.
11:01arrdemof macros and basilisks?
11:02deathknighthah!
11:02deathknightgiven enough time, a macro will compile itself
11:02arrdemI don't think that's how deterministic pattern engines work :P
11:03deathknightgiven enough time!
11:41gfredericksdoes the JVM not have any mechanism for globally setting an uncaught exception handler?
11:42arrdemdoes the JVM have a mechanism for entering arbitrary code execution at global scope?
11:42gfredericksthe jvm has scope?
11:43arrdemI apologize I'm snarking. No. There shouldn't be such a thing. All exception handling is installed on a per-code block basis in an exception handler table that's part of each individual method.
11:44bbloomarrdem: um no
11:44bbloomgfredericks: yes
11:44arrdembbloom: rly?
11:45stevenfxdevicons that’s trending on HN will add a clojure icon :) http://goo.gl/LcSKxG
11:45bbloomhttp://docs.oracle.com/javase/7/docs/api/java/lang/Thread.UncaughtExceptionHandler.html
11:46gfredericksbbloom: that's per thread
11:46arrdem(inc bbloom)
11:46lazybot⇒ 37
11:46bbloomgfredericks: read the "see also"
11:46bbloomyou can also do it per thread group
11:46bbloomand thread groups form a hierarchy
11:47bbloomyou can also set the "default" handler which will affect threads that don't override the handler
11:49stevenfxwell its time to go home, have a good weekend everyone
11:54gfredericksbbloom: oh I missed that static method -- cool, thanks!
12:12CookedGr1phonI'm running clojure on android, trying to get it up and running on the newer ART runtime
12:12CookedGr1phonand I have been successful... if I remove all uses of the locking macro
12:13CookedGr1phonI'm tempted to put it down to an ART runtime bug, but if anyone has any insights I'd appreciate it
12:13boxedfucking midje “no such namespace” bullshit >_<
12:31boxedarrdem: 250k for the EDN with all the metadata etc… compresses to 47k
12:32andyfboxed: I am an atheist, but IMO the serenity prayer contains useful advice (see e.g. Wikipedia)
12:32boxed:P
12:33boxedthe vast majority is the meta info like the doc string etc
12:34sritchiednolen_: hmm, running into an odd thing - I’ve got a dropdown component that’s successfully triggering a state update via om/update! (actually, passing its value through a channel to an upper component that does the update!),
12:34sritchiebut the update doesn’t trigger a re-render
12:35sritchieso the dropdown component’s value doesn’t change, even though the state is indeed changed
12:35dnolen_sritchie: my experience is that 90% of the time there's a mistake somewhere in case like this
12:35sritchie:) I believe it
12:36dnolen_sritchie: otherwise you need to show me a minimal example that has nothing to do w/ your project
12:36sritchieyup, understood… let me see if I can isolate it
12:37seangrovednolen_: Some cljs webgl art https://www.dropbox.com/s/vgw61ivobkx597f/glint_webgl_abstract_art.mp4
12:37elbenIs there a way to *not* include the clojurescript deps when using hickory (https://github.com/davidsantiago/hickory)? The project.clj has clojurescript listed in the main :dependencies
12:37sritchiethis is the thing I was doing yestsreday that I worried would screw up the re-rendering
12:37sritchiehttps://gist.github.com/sritchie/1d202fc672ddf905cd13
12:37seangrovednolen_: It's been pretty fun combining cljs and webgl so far
12:37sritchie“static” and “dynamic” are cursors
12:37sritchieand this is what’s changing in the global state: :selection (-> dynamic :entries (get (:id e)))
12:37dnolen_seangrove: pretty :)
12:37arrdemelben: lein's documentation specifies how to write dependency exclusions.
12:38sritchieI’ll keep playing with it
12:38elbenarrdem: oh that’s right, thank you for pointint that out
12:38sritchiednolen_: ah! the higher level re-render does get triggered. I’ll figure this one out, on track now
12:42munderwoHi all. Im trying a really simple split string with question mark form and its not working. see https://www.refheap.com/88343 for what Im trying to do and what Im getting.
12:42munderwoAny help? I can split on other things but obviously the ? is a special character?
12:43justin_smithmunderwo: ^ matches the beginning of a line
12:44munderwo*facepalm*
12:44nbeloglazovmunderwo: also you don't need to use 2 slashes: "\?"
12:44munderwothanks justin_smith I know it would be something easy.. damn regex's that I never learnt...
12:44boxedandyf: without the metadata: 46k uncompressed :P
12:45justin_smith,(clojure.string/split "/2010-04-01/Accounts/ACe248350937deb36e8f5e19c882d1679b/Messages.json?PageSize=50&Page=5" #"\?") munderwo
12:45clojurebot["/2010-04-01/Accounts/ACe248350937deb36e8f5e19c882d1679b/Messages.json" "PageSize=50&Page=5"]
12:45munderwonice thanks!
12:45justin_smithyou were also escaping the '?' wrong, with an extra \
12:46justin_smithmunderwo: also, there are classes available that do proper URL deconstruction
12:46arohner_munderwo: you can probably also use something like https://github.com/cemerick/url
12:47munderwoOh cool. I found a different one, but that one looks better. In this case I just need the url part, but probably later on construction and deconstruction will be helpful. Also in this case I dont have the host or protocol part so I thought that might be difficult. Thanks!
12:48justin_smithmunderwo: in my experience when I don't have the host or protocol part that is because I am serving the request, and ring breaks up the parts for me (and my routing library makes sure it gets sent to the right code)
12:49munderwoYeah, this in particular is a client for a third-party api. So I only have what they give me :)
12:54sritchiednolen_: yeah, was a stupid misnamed key
12:54dnolen_sritchie: k cool
13:22arrdemBronsa: t.e.jvm.transform/get-class has to do classloading, right?
13:27Bronsaarrdem: well it returns a Class instance so it does load it
13:27arrdemmmk. That's what I thought.
13:28arrdemthere's reordering weirdness happening here... classes are being generated out of order and it's not good.
13:29Bronsaarrdem: tej or oxcart?
13:29arrdemoxcart. your code is working fine.
13:29Bronsaphew
14:24augustlin "components", what exactly is map->Database in the new-database function in the readme? https://github.com/stuartsierra/component
14:24augustlI don't understand how to implement the component/system-map since it operates on these magic map->Database thingies
14:25gfredericksum
14:25stuartsierramap->Database is a constructor function generated automatically by `(defrecord Database …)`
14:26augustlah, I haven't used records all that much, thanks
14:26augustl(map->Database {:host host :port port}) will be the same as (Database. host port) then I guess
14:26stuartsierrayes
14:27stuartsierraWith the map->Record form you can omit some of the keys and they will get nil values.
14:28augustlfor me, it would have been useful if the first component/system-map call in the README had something like (ExampleComponent. x y) instead of (new-scheduler)
14:30stuartsierraNoted. My use cases almost always have custom constructor functions.
14:31stuartsierraMaybe I'll add something like "Keys in the system map are usually keywords. Values in the system map are *instances* of components, usually records or maps."
14:34augustlit was really just the map->RecordName that confused me, wasn't aware it existed :)
14:37gfredericksit doesn't get a lot of publicity outside of component
14:44PigDudekorma seems to not support composing queries at all
14:45PigDudeat a superficial level it does, but the API doesn't allow you to work with a naked (where CONDS), etc.
14:45PigDudeplease somebody tell me i'm wrong about this ...
14:45amalloyPigDude: korma is famous for being easy right up until it's impossible
14:45cbpthat is what happens when your api is all macros
14:46PigDudeamalloy: :( i was going to use plain jdbc but the guy i'm working with pushed really hard for korma backend
14:46amalloywho is this guy? push him in the back end
14:46PigDudethe docs example (-> (select* users) (where {:first "john" :last "doe"})) is deceptive because the (where) is getting (and needs) two args
14:46technomancynow you get bonus i-told-you-so points
14:46PigDudeamalloy: somebody smarter than me? :)
14:47PigDudeok, thanks guys
14:47cbpwhen a lib's api is just macros it just mostly spells trouble
14:47PigDudei had misgivings about korma first time i used it and looked at its code
14:47arrdemmacros |are| misgivings
14:47PigDudehaha
14:47PigDudeyea, it really makes the api clumsy
14:47PigDudemakes me miss django orm :P
14:48PigDudeor sqlalchemy. i'm not going full orm but are there projects like this in clojure?
14:48PigDudethat will allow you to compose queries this way
14:48cbpI use strings
14:48amalloyPigDude: that's not really deceptive: it's blatantly clear that where gets two args there
14:49PigDudeamalloy: that's why i asked here, maybe i am wrong, but docs say "You can also call the (where) and (having) predicates like any normal function, allowing you to compose your predicate clauses as if they were standard Clojure code." and i cannot achieve this usage
14:50PigDudei'm pretty sure this line is misleading
14:51bbloomi've just given up on trying to "compose" sql
14:51bbloom$google yesql
14:51lazybot[krisajenkins/yesql · GitHub] https://github.com/krisajenkins/yesql
14:52arrdemnot yasql?
14:52bbloomcopy/paste reuse tends to work just fine for sql :-/
14:52bbloomthat, or you can build your .sql file from a .sql.cat script
14:53bbloomweeee cat<<! heredocs
14:54PigDudebbloom: :\
14:54PigDudebbloom: i've worked on large projects that take the sql-as-string approach and it has certain limitations
14:54PigDudebbloom: and in my experience, more defects
14:55PigDudebbloom: it would work fine for this application though
14:55bbloomPigDude: that's the beauty of the catscript & yesql (or similar) approach: you can visually inspect the generated sql, which is static at program start
14:55cbpman that sounds like a pretty bad idea to me
14:55bbloomand you can commit the generated code to see if your generator breaks it
14:55cbpsql is hard to read therefore let's stuff it in randomly named files all over the place
14:55PigDudeneat, will have to take a look
14:55arrdemcbp: /resources/sql/*?
14:55bbloomi've seen LOTS of rails apps w/ serious security flaws b/c a tiny change in one place causes a where clause or join to disappear or something like that
14:56bbloomi much rather have manually written sql per use case, then do custom generation where i actually need abstraction
14:56bbloomif your table scheme is static (and it is 99% of the time) your queries should be static too
14:56cbparrdem: that's not that much better than /
14:56bbloomschema*
14:57arrdemcbp: sure, but you're also not mashing it into src/
14:57PigDudebbloom: shouldn't conflate ActiveRecord with all db/schema/query abstraction
14:57PigDudebbloom: sqlalchemy is very low-level, for isntance
14:57cbpnow your sql queries probably have to follow some directory structure and some naming conventions and ugh what a pita
14:57bbloomPigDude: i've used sqlalchemy before as well, it's much nicer than active record and also much nicer than arel (the internals of active record which copied sqlalchemy)
14:58bbloombut as far as i can tell, if you're not going to pull a full Linq, you might as well not even try
14:58cbpIf syntax highlighting is so important surely you can just use IDEA
14:58PigDudebbloom: i'll tell that to all the projects using sqlalchemy :)
14:58bbloomPigDude: there are plenty of good use cases for query abstraction
14:58bbloomPigDude: and you could do far worse than sqlalchemy
14:58PigDudebbloom: at my last job we were using it on small facility servers, i don't know how easy it would be to use linq in such a context
14:59bbloomand you can do far better: https://en.wikipedia.org/wiki/Language_Integrated_Query
14:59PigDudehehe you mean FORCE.COM? :)
14:59bbloomPigDude: don't get me started on SOQL
14:59PigDudeaka SOQL
14:59bbloomwhat a disaster
14:59PigDudehehe
14:59PigDudeyea
15:00bbloomsqlalchemy also has quite a few subprojects
15:00bbloomthe query generation is fine, but the schema generation is just as bad an idea as activerecord
15:00bbloomalthough scheme reflection is not terrible
15:01bblooms/scheme/schema again
15:01bbloomargh
15:02amalloybbloom: just add an autocorrect rule for scheme->schema. it will prove entertaining in future discussions anyway
15:02PigDudebbloom: hehe i gave a presentation last week on clojurescript and closure tools, so much ambiguity
15:25jcromartieI can't get lein cljsbuild to compile the simplest possible cljs file
15:26cbpan empty file?
15:26augustlwhen creating jar files for folks to self-host, I suppose having a plain old properties file in the same dir as the jar is a sane way of providing configurability?
15:35jcromartiewell just a js/alert
15:35jcromartieit might be my project's insane deps
15:35jcromartiebut I just get a massive stack trace from the clojurescript compiler… I'm trying to make a minimal test case
15:35jcromartieI'm adding cljs to my existing app
15:35jcromartiewhich is quite large
15:37cbpcljs gives pretty massive stack traces
15:37bryanmaassPigDude: is that talk avaliable online anywhere?
15:40jcromartie(ns app.core)
15:40jcromartie(js/alert "loaded")
15:40jcromartiethat's my file
15:41jcromartieI don't even feel bad pasting it here
15:41jcromartienow, the stack trace...
15:41jcromartiehttps://gist.github.com/jcromartie/6153611f4ef070b51738
15:41jcromartie:)
15:42cbpshouldn't the path be src/cljs/app/core.cljs?
15:44cbpmm actually i guess it might not say the whole path
15:59stuartsierraThat's not a Clojure stack trace. That's not even a Java stack trace. It's something generated by a library trying to make the Java stack trace "pretty."
15:59stuartsierraAnd probably losing information on the way.
15:59amalloyjcromartie: are you sure that's the source file you're compiling? the stacktrace for that suggests your ns form has an empty :use-macros clause in it or something
16:00stuartsierra~seen talios
16:00clojurebottalios was last seen joining #clojure, 888 minutes ago
16:00amalloy$seen talios
16:00lazybottalios was last seen quitting 14 hours and 1 minute ago.
16:01stuartsierrathanks amalloy
16:01amalloycause math is hard
16:08stuartsierraFun with class loaders http://dev.clojure.org/jira/browse/CLASSPATH-6
16:09mdrogalisFun. Sure. D:
16:10mdrogalisHaha.
16:16stuartsierraOr, ways in which `java -jar` is not the same as `java -cp` for $800, please, Alex.
16:16amalloystuartsierra: this is sorta a symptom of pretending that all classloaders use the classpath, right? that is, the real, general mechanism is this opaque "i need the class or resource named X, please find it", but we've built stuff assuming that it's based on a list of resource paths to look in?
16:16stuartsierraamalloy: yes
16:21amalloystuartsierra: i'm curious, since you tested this ticket: does loading the resources by name with c.j.io/resource work? or are they totally unobtainable?
16:23stuartsierraamalloy: interesting question, trying it ...
16:24amalloyi'd guess that they are in fact loadable by name
16:25stuartsierraamalloy: Yes, loading resources still works.
16:27PigDudebryanmaass: only slides http://oinksoft.com/closure-tools/sgdg-jul14/
16:31mikerodstuartsierra: I like this line "There is no obvious API for getting the Class-Path property of the manifest file without opening and reading the contents of the JAR file."
16:31mikerodWhy must Java make the ClassLoader API so hard to deal with.
16:31stuartsierraThis particular case looks like it might be an oversight.
16:31mikerodit always comes back to opening jars and digging things out yourself. :(
16:32stuartsierraObviously, internally there's some code that reads the manifest.
16:32stuartsierraIn OpenJDK I can find it in sun.misc.URLClassPath.
16:32mikerodah
16:33stuartsierraBut the Launcher class doesn't use that when you call .getURLs.
16:35augustlin "components", does it make sense to create a bunch of threads when creating the component, and start them in Lifecycle/start? /cc stuartsierra
16:35alandipertjcromartie, that's the error you get when clojure 1.6 and 1.5 are in play and you're trying to cljs with a version using 1.6
16:36stuartsierraaugustl: sure
16:36augustlI suppose creating a Thread object doesn't have any special overhead
16:36stuartsierraOr create & start the threads in Lifecycle/start, not much difference.
16:37augustlthe reason I want to split it up is that I want the threads in shutdown, so I can kill them. That way the start method only starts, it's not responsible for also returning that collection of thread objects as well
16:37augustls/shutdown/stop
16:37stuartsierra`start` still has to return the component containing all the thread instances.
16:39augustlah, right
16:40martinklepschcan I alias a function in a way that preserves metadata and it's signature?
16:41amalloymartinklepsch: you can, and ztellman/potemkin contains such a feature. i'd advise against doing it without a strong reason, but i no longer think it's as unspeakably evil as i used to
16:41ztellmanamalloy: good, goooooood, give into the namespace aliasing
16:42aperiodicamalloy: do you mind explaining what changed your mind?
16:43martinklepschamalloy: the reason is that a library maps very directly to methods of annother API and not having the function gives the impression it's not implemented
16:43martinklepschamalloy: more here: https://github.com/clojurewerkz/elastisch/issues/96
16:43stuartsierra(refer 'clojure.set :rename {'union 'u})
16:43alandiperti used to think everything ztellman did was evil until started using it all
16:44martinklepsch(I'm not sure either if it's the best way to go, so feel free to enlight me with your opinions :)
16:44amalloyone of ztellman's READMEs somewhere arguing that you shouldn't have to make your public api mirror your internal structure. so you have the real internal structure for use within your library, and some set of hand-curated external api namespaces to make using it possible without knowing the internal structure
16:44ztellmanalandipert: thanks for providing the anchor quote for my three part series: "Fall and Decline of the Clojure Emprie"
16:45bacon1989,(def x (atom nil))(not= @x nil)
16:45clojurebot#'sandbox/x
16:45ztellmanthat would be https://github.com/ztellman/potemkin#import-vars
16:45bacon1989,(println (not= @x nil))
16:45clojurebotfalse\n
16:45bacon1989?
16:46bacon1989man, i'm getting different results, maybe it's something else
16:46amalloyztellman: it was actually the factual api server. i wouldn't be caught dead reading potemkin's readme
16:46ztellmanamalloy: I'll get right on open sourcing that
16:47stuartsierramartinklepsch: If it's just for local use, `refer` does what you need.
16:47ZekkaHey: I'm a Haskell programmer who's using Clojure for a work project and finding it kind of hard to debug -- do any of you have suggestions for how I ought to be doing it?
16:48ZekkaI'm mostly upset because it seems like the bulk of the errors I get occur at runtime and don't get to the heart of the issue -- because of the lack of type constraints they occur as soon as a problem actually happens, not i.e. at the entry point to the part of the code where the problem first happens
16:48Zekka(so if I accidentally pass a widget to a function expecting a string, for instance, but which stores it instead of operating on it immediately, it'll gleefully store it and then fail when operating on it instead of failing at the point of storing it)
16:49gfredericksZekka: there's a spectrum of tactics
16:49stuartsierraZekka: assertions and pre/post conditions are generally your friend in these cases.
16:49ZekkaI know Clojure has optional type-annotations but when I'm using libraries that don't use them or encourage you to use them it seems to me like there's not a reasonable way of going about it
16:49martinklepschstuartsierra: basically I want to define a fun-b in the same namespace that looks exactly like fun-a including (doc fun-b) etc
16:50martinklepschstuartsierra: sure that refer is the way to go still? reading the documentation I'm not sure how I'd accomplish that
16:50Zekkastuartsierra: Do you have any docs you can recommend?
16:51stuartsierramartinklepsch: No, refer won't do that. I wouldn't do that either.
16:51Zekka(actually, in general I wish I was better at debugging code in dynamic languages: it's really hard!)
16:52arrdem$google fogus :pre :post
16:52lazybot[fogus: Clojure's :pre and :post] http://blog.fogus.me/2009/12/21/clojures-pre-and-post/
16:52martinklepschstuartsierra: so in respect to that issue (https://github.com/clojurewerkz/elastisch/issues/96) could you give me any advice what you think would be a good idea to do? just leave it as is? /cc amalloy
16:52ZekkaThanks!
16:53augustlstuartsierra: btw, just wanted to say nice job on actually managing to sell dependency injection as a _good_ thing at euroclojure :)
16:53gfredericksunrelated: I am uncomfortable using lazy seqs in such a way that realizing one extra element is catastrophic
16:54stuartsierramartinklepsch: I don't understand the issue, sorry.
16:54stuartsierraaugustl: thanks!
16:54Zekkaarrdem: Would an idiomatic usage be to define an i.e. takes-widget function that adds an 'is really a widget' precondition to the function's argument?
16:54augustlstuartsierra: ended up doing something similar at current client which is a Groovy shop - spring-context stand-alone in a small Gradle based app does the same job
16:55Zekka(in general, is using higher-order functions to wrap existing functions with assertions the 'correct' approach?)
16:55arrdemZekka: I do that sort of thing all the time. Write a static type sig, and pre/post validate it.
16:55amalloyZekka: clojure doesn't really have optional type annotations. typehints are optimization tips for the compiler, not safety constraints
16:55arrdemZekka: introspecting fns to say "is this really the kind of fn I expect" doesn't really work tho unless you're willing to manually manage metadata
16:56Zekkaarrdem: It's less introspecting and more writing higher-order functions that add the pre/post tags as in the example
16:56ZekkaDo you usually put the pre/post tags directly onto your functions or do you add them using separate higher-order functions to keep them general?
16:57amalloymartinklepsch: i don't understand what question you're asking either
16:57ZekkaI can pastebin an example if it's not clear what I'm getting at.
16:58Zekkaactually, not sure how to write an exaxmple that's clearer than what I already said
16:59arrdemI mean... you seem to be asking if it's idiomatic to write {:pre [(is-my-complex-type? foo)]}..
16:59Zekkaarrdem: That's not quite it
17:00mikerodZekka: I like Prismatic schema a lot
17:00ZekkaThe article you linked defines a function that takes an existing function and wraps it to add those checks, which it didn't have before
17:00mikerod$google prismatic schema
17:00lazybot[Prismatic/schema · GitHub] https://github.com/Prismatic/schema
17:00celwellI have a clojure web app on Amazon Beanstalk, and I"m using Amazon RDS for a mysql db I'm connectin to. Does clojure have an equivalent of phpMyAdmin that I can use to manage the database efficiently, or am I stuck with the command line?
17:01alandipertcelwell, you could just use phpMyAdmin, no?
17:01ZekkaIs it ordinary style to write functions of that kind so that you can write code that's 'polymorphic over functions that meet this group of assertions'
17:01Zekkapolymorphic over 'functions that meet this group of assertions'*
17:02systemfaultcelwell: Not sure why you couldn’t use mysqlworkbench or phpmyadmin.
17:02martinklepschamalloy: hah, ok. Let me try again: there is an API the elasticsearch clojurewerkz library implements. This API contains the various query types for querying elasticsearch. Two query types are almost identical ("term" & "terms" query) and implemented in one function, therefore they don't show up in the codox documentation and someone could falsely assume that the "terms" query is not implemented. That's what I did. Is
17:02martinklepsch there any way to get it into the API docs without duplicating code or do you think it should just not be in there then?
17:02martinklepschamalloy: (I'm sorry for the very long text)
17:02celwellalandipert: then I would have to create another beanstalk instance, right? (or are you saying run phpmyadmin locally but connect remotely to aws?)
17:02augustlany suggestions on how to fix this code so the component start adds a list of all the created threads to the component? https://gist.github.com/augustl/3e9ecb8fc813b72ec402
17:02ZekkaMore generally I'm trying to ask if there are other ways to express that kind of polymorphism which are preferred, or whether that polymorphism typically comes about
17:02amalloyi would just do what everyone else in that issue thread is saying: define another function that calls it
17:02amalloyif you want to instead alias it and copy the metadata, then go ahead i guess, but i don't see the value in it
17:03alandipertcelwell, ah, right - i see what you mean now. no, not aware of JVM resident phpmyadmin options in or out of clj
17:03augustlthinking of looking into ways of using zeromq that doesn't involve all this manual thread creation, but perhaps just a single executor that I can return and kill in stop
17:03Zekkamikerod: This looks interesting!
17:03stuartsierraaugustl: (doall (for [n (range 4) (doto (Thread. …))))
17:03augustlstuartsierra: ah, doall, thanks :)
17:04stuartsierraaugustl: I gave up on ZeroMQ for this reason.
17:04ZekkaOnce I make sure there aren't glaring bugs in my current program I'll see if I can integrate this
17:04augustlstuartsierra: it's nice for rpc though :)
17:04alandipertZekka, you can group implementations around a single function ("precondition") with multimethods, or you can group types by capability with protocols (similar to typeclasses)
17:05augustlapparently there are ways to create a single poller thread that dispatches to a thread pool
17:05alandipertZekka, what you're asking for sounds like perl subset types or maybe dependent types, is that what you're looking for?
17:05Zekkaalandipert: Do Clojure's contracts work for protocol and multimethods?
17:05mikerodZekka: I have found the Prismatic schema to be easy to throw on top of my existing structure. I like how it allows you to "minimally" specific constraints for fn. Also, the schema representation is built-in good and uniform documentation.
17:05alandipertZekka, implementations of either can have conditions, yes
17:05alandipertZekka, what isn't possible is type-level conditions on either
17:06Zekkaalandipert: Not really: it's more that I'm trying to use pre/postconditions to approximate what I usually get from types in a pure language
17:06ZekkaI'm trying to make specific statements about behavior but those statements aren't the sort of thing that would necessarily require dependent types to make
17:06technomancyI wonder how horrible it would be to write something that doseqs over the current namespace's ns-publics and wraps everything that isn't metadata opted-out with a "this function should never take/return nil" pre/post
17:06technomancykinda tempted
17:07Zekkai.e. you don't need dependent types in a pure language to say 'and this feature of the environment isn't changed', but you probably need pre/post conditions to check that in a dynamic language with side effects
17:07stuartsierraAha! Re earlier discussion of CLASSPATH-6, URLClassLoader reads JAR manifest files lazily, as needed, to load resources.
17:07ZekkaSo I'm trying to see if I can express polymorphism constrained by pre/postcondition groups
17:07stuartsierraSo it would be tricky to get a list of *all* the URLs it might eventually read.
17:07Zekkaalandipert: Sorry if I'm not too clear for what it's worth
17:07alandipertZekka, for modeling domain objects you may consider defrecord, which would allow your domain maps to participate in protocols
17:08alandipertZekka, well, afaict nobody understands eachother in this arena :-)
17:08alandipertZekka, i would just encourage you to explore the various clojure approaches to polymorpism and get a feel, one will stick out at the end to you i bet
17:08ZekkaAlright
17:09ZekkaRight now I'm a little cross because I told my boss 'I hear Clojure is pretty reliable and stable and more concise than Java for this application' etc. and so far I'm a little frustrated
17:09augustlis there a function like this around? Take varargs of lists and vals, return a single flattened list (x [1 2 3] "b" [1] 2) -> [1 2 3 "b" 1 2]
17:09Zekkahopefully I'll either get so frustrated I can motivate a rewrite or I'll get used to it and stop complaining
17:10Zekka(For what it's worth Java is actually very bad in the regard I'm describing: it has static types but you can't use them at all for reasoning about behavior the way I'm describing: at least Clojure apparently has cheap assertions)
17:10augustlZekka: I haven't followed the discussion, but have you seen core.typed?
17:10Zekkaaugustl: No, I haven't
17:10JaoodZekka: but haskell
17:10augustlSchema is also a nice alternative to preconditions
17:10augustlZekka: ^^
17:11ZekkaI'm thinking I might introduce schema
17:11technomancyif you're used to programming with a type system, it's normal for getting adjusted to clojure to take a while.
17:11mikerodPrismatic schema really dominates pre/post conditions from what I've seen. Once I have that in place, I haven't really seem too many issues with delayed errors due to invalid data (and types) passed around
17:12Zekkaaugustl: Right now my major priorities are 'stop annoying bugs that I could ordinarily use the type system to deal with (as much as is possible)' and 'don't screw up my ability to work with library code that doesn't know or care about types'
17:12ZekkaCan you evaluate core.typed and schema in those dimensions? (Schema looks very good in them from a distance.)
17:12mikerodThe advantages are just reusable structures to express your conditions, well-structured error messages, automatically adds some doc strings to schema.macros/defn, etc
17:12technomancythere's more you need to keep in your head since you don't have the compiler backing you up, it also forces you to design simpler data models *because* you have to keep more in your head
17:13mikerodZekka: I'd imagine core.typed is a bit more invasive since you need to use it extensively to gain benefits out of the static type checking.
17:13ZekkaI don't really expect to be able to catch type-related bugs statically: it'd be nice but I don't expect it
17:13Zekkamikerod: I feel like assertions is more appropriate for a usecase like this
17:13Zekkaone of the libraries we use (Seesaw) really loves coercion and other sticky things that are probably hard to express with a sensibly anal type system
17:14mikerodZekka: schema can have assertions turned on.
17:14mikerodif that's what you are getting at
17:14Zekkabut assertions/pre/postconditions probably wouldn't break anything
17:14Zekkamikerod: I got the impression that schema mostly used assertions/pre/postconditions while core.typed performed some kind of deeper static analysis
17:15mikerodschema is an opt-in runtime-checked assertions
17:15Zekkaalthough that might be partially based just on my preconceived, half-baked notions of what it means when someone says "we're giving you a type system"
17:15mikerodcore.typed is static analysis for type-correctness
17:15Zekkamikerod: That's about what I figured
17:15mikerodso with schema, you can annotate a single fn
17:16mikerodwithout considering anything else
17:16arrdemI suspect that schema or a hand rolled equivalent is what you want..
17:16arrdemcore.typed can be really hard to work with and relatively limited.
17:16Zekkaarrdem: I'm thinking the same
17:16mikerodMy impression for core.typed is you really need to "buy in" and annotate a lot, so that there can be meaningful static analysis done between the interaction points between fn's.
17:16arrdemI've caught real errors with core.typed..
17:16arrdembut it can be a real pain
17:17arrdemyeah I'm with mikerod here.
17:17ZekkaUnless I can make a ton of random library maintainers also commit to core.typed I don't think I can probably make it work here
17:17arrdemI built a typechecked CPU simulator with core.typed but there was a _lot_ of buy-in involved.
17:17arrdemand that for was a sub-1k LOC project
17:17ZekkaWhat's the advantage of working in Clojure with core.typed over a language designed around typesafety from the start?
17:17mikerodarrdem: I have been interested in core.typed, but I haven't been in position to go to the lengths it would require to switch to it
17:18Zekka(like, I don't know, Scala -- disclaimer being that I haven't worked in Scala)
17:18mikerodZekka: I think that is a good question. I do not know the answer. :P
17:18mikerodIt's a Lisp on the JVM! - that's why
17:18arrdemZekka: I think that's an open research question :P
17:18mikerod(joking)
17:18martinklepschamalloy: sounds fair. thank you for guiding me :)
17:18arrdembut seriously.
17:19technomancyZekka: the canonical answer is that the JVM's use of subclassing is incompatible with hindley-milner, and type systems that aren't HM are kind of a pain in the neck.
17:19mikerodThe idea of an add-on type system is very interesting to me. I'm definitely torn on these things.
17:19technomancy"canonical"
17:19mikerodlike add-on type system vs built-in and based around like Haskell
17:19Zekkatechnomancy: What do people say when other people say "that's fine, don't allow subclassing"?
17:19ZekkaBecause that's the sort of thing I would say.
17:20technomancymeaning "what people tell me when I complain that none of the JVM-hosted languages have good inference"
17:20Zekka(maybe it's just because I find inheritance very confusing most of the time when I encounter it)
17:20technomancyZekka: because that means "don't use all these libs that are half the point of being on the JVM in the first place"
17:20Zekka(the basics are fairly simple but I feel like I run into a lot of semantic potholes)
17:20technomancy"don't create subclasses yourself" isn't enough
17:20mikerodI think subclasses are evil
17:21caterni think classes are evil
17:21amalloyZekka: i would say core.typed is a really cool effort, but i wouldn't use it as a newcomer to clojure. better to drink the kool-aid of the new language until you can program in it and *then* decide whether you want an add-on like core.typed. don't try to make clojure like haskell until you're comfortable with clojure already (and for my part, i try not to make haskell like clojure)
17:21mikerod:)
17:21caternI think OO is evil
17:22technomancyyeah, what amalloy said. force yourself to use nothing but maps for like a month to get rid of your typed habits before making a judgment =)
17:22Zekkaamalloy: Generally I'd agree: it's mostly the case here that I'm actually accountable to someone for the code I produce here
17:22Zekkameaning that if while experimenting I produce crappy code I'll have billed them for crappy code, which isn't ethical
17:22amalloywell. decide whether you're learning or building. if you can't do both productively, pick one
17:23amalloylike, learning is great, but if you're making tons of compromises on the learning in order to build something you think is billable, what you're learning is counterproductive
17:23technomancybeing able to throw away learning code is a wonderful luxury =)
17:23ZekkaI'm actually guilty of a misdecision much earlier: we weren't originally going to use Clojure, but when I suggested it folks agreed because they didn't think there would be very much of it
17:24Zekkacurrently about 10% of our project is Clojure now because many of the things we planned to do in Java were much quicker in Clojure and paring away the interface to be small/simple to work with involved adding much more responsibility to the Clojure code
17:24amalloyit sounds like you decided to bill someone for a project you write while clojure, without knowing whether you could build anything in it; it's a bit unfair to call it unethical *now* when someone suggests you prioritize learning it
17:25ZekkaIt's a quantity we could probably rewrite but I have a feeling that in this case, good clojure > bad clojure > Java
17:25amalloy*while learning
17:25Zekkaamalloy: That's pretty accurate.
17:25dnolen_Zekka: bad Clojure is probably at least as bad if not worse than bad Java
17:25alandipertimo a new prog. language is nothing compared the learning typically involved for a domain, which few would argue is unethical to bill for
17:26dnolen_Clojure gives lots of shotguns pointed at all limbs
17:26jcromartiealandipert: so, what is the fix for the 1.5/1.6 cljs issue?
17:26jcromartiealandipert: sorry that was a long time ago, I was AFK
17:26Zekkadnolen_: I'd say from current experience it's pretty bad but not in the same ways
17:26alandipertjcromartie, downgrade cljs or upgrade/exclude whatever in your project is bringing in 1.5
17:26dnolen_Zekka: yeah
17:26ZekkaIt's harder to debug and harder to pick apart for overall structure because unlike Java it's not really very uniform
17:26amalloydnolen_: i'm now imagining television ads for "Crazy Rich's Limb and Shotgun Emporium"
17:26dnolen_amalloy: lol
17:26jcromartiealandipert: oh, that would probably be [org.clojure/clojure "1.5.1"] :)
17:27ZekkaOn the other hand it's quicker to refactor and I don't feel like I'm running into as many 'correct way/reasonable way' tradeoffs as I do when I work in Java
17:27Zekka(Java's verbosity and poor facilities for abstraction have made significant parts of the project much larger and much less flexible than they could have been, IMHO)
17:27jcromartieTHANKS LEININGEN
17:29nullptr(inc leiningen)
17:29lazybot⇒ 3
17:29amalloy3???????
17:29amalloy(inc leiningen)
17:29lazybot⇒ 4
17:29arrdem(inc leiningen)
17:29lazybot⇒ 5
17:29catern(inc leiningen)
17:29lazybot⇒ 6
17:29jcromartieI was being sarcastic
17:29jcromartie(dec leiningen)
17:29lazybot⇒ 5
17:29arrdem0_0
17:29amalloyjcromartie: you were probably being wrong too, for what it's worth
17:30jcromartiehah
17:30catern(inc technomancy)
17:30lazybot⇒ 123
17:30Zekkadnolen_: IMHO we're better off with the bad clojure than the bad java, and that's not me arguing from the 'Clojure is an allegedly better language' stance
17:30dnolen_Zekka: well good Clojure is a thing a beauty so you have something to work towards ;)
17:30jcromartieI would like to be able to "lein new" and get clojure 1.6.0
17:31nullptra lot of the most common mistakes are common across languages -- misunderstanding/misuse of "lazy" is one i see everywhere
17:31Zekka(I have trouble saying "Clojure is a better language" because it seems to depend very heavily on who is writing it: it's not like Haskell where it's really hard to screw things up beyond repair, even if you're inexperienced)
17:31alandipertcan't argue taste anyway
17:31amalloydnolen_: a clojure program is like a sculpture by michaelangelo: you start with ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), and gradually carve off the parts that aren't part of your program
17:32dnolen_amalloy: haha
17:32arrdemamalloy: but how do I get a (()()) from that...
17:32Zekka(in certain hands I bet the Clojure implementation's usually much better than the Java implementation, though)
17:32technomancythe only meaningful definition of "better language" is "tends to produce better programs" which is ridiculously context-dependent
17:32jcromartieoh it does now
17:32jcromartiebut just a bit late
17:33Zekkatechnomancy: I'm using it very informally here, in the sense of "would I tell a friend he should totally do his next project in it?"
17:33caternblub man
17:33caternclojure is better than java, no contest
17:33amalloyZekka: well, in haskell it's really hard to screw things up beyond repair as a newbie because it's really hard to do *anything*
17:33arrdem$karma blub
17:33lazybotblub has karma 0.
17:33caternlikewise, haskell is better than java, and go is better than java
17:33amalloyhow good programs in language X are will depend on the person writing them no matter what X is
17:34technomancysame as my gripe over people saying "a faster language"
17:34technomancylanguages aren't fast or slow, programs are
17:34mikerodJava is just the assembly language of the JVM
17:34Zekkaamalloy: I'd say one of its major design features is "you're not allowed to do the wrong thing"
17:34caternsays the person in the IRC channel of a slow language :)
17:35shanemhansenMy favorite quote ever from a phd student who was a haskeller "I love haskell because every time I try and do anything it's like a research project".
17:35amalloyclojure, haskell, java, php - they're all great at what they want to do. you just have to drown yourself in koolaid
17:35ZekkaAnd it accomplishes that by turning all the normal techniques for doing anything into wrong things
17:35Zekkashanemhansen: It's either a shame or a benefit
17:35ZekkaI mean on one hand you have really ingenious designs like lens, but you also have a lot of work-in-progress designs like monad transformers
17:36Zekkawhere there are still a lot of sharp edges and unpleasant bits
17:36ZekkaSo a lot of things you ordinarily take for granted are still areas of research, even though the research is pretty complete in a lot of cases
17:36Zekka(Monad transformers do 90% of what you wouuld like them to do, but they really suck at 10%)
17:36hiredmanphp even has goto now, so you can write a proper compiler targeting it
17:37arrdemoh dear...
17:37Zekkaalso sometimes the 'correct' design is actually super scary and requires you to squat over some research papers: i.e. Pipes and streaming IO
17:38Zekka(Pipes eliminates a lot of drawbacks of standard IO approaches, but the disadvantage is you'll drown in types)
17:38Zekka(it's not really about IO but about coroutines)
17:41ZekkaI might port some of my old Haskell code to Clojure, I've got some really dense projects that I bet would be a lot simpler
17:43technomancyZekka: people say that Java IDEs allow you to use more complicated class hierarchies than you normally would with an un-aided human intellect; I wonder if there is a parallel to good type systems.
17:43technomancyseems like a double-edged sword
17:43Zekkatechnomancy: I'd say that a lot of the time when I run into Haskell types, there's the unfortunate problem that they're very hard to understand, but also as small as they can be
17:43ZekkaI brought up monad transformers, which are conceptually pretty simple
17:43technomancylike, when you're writing C, you are forced into a sort of ruthless simplicity
17:44Zekkathe problem is that for the things they *don't* do, there's no way to express them
17:44ZekkaThere's a structure that's general enough to express the things they don't do, but it's really complicated
17:44ZekkaAnd as far as I know nobody knows a simpler one
17:45ZekkaSo I feel like it basically comes down to the problem that some things are just very hard to reason about -- if you're in a purely functional language then you have to think about those things, types or not, and if you're in an impure language you can ignore a lot of the rough edges
17:46Zekkaand I generally prefer being required to reason about those things than the alternative of letting them happen by magic
17:47arrdemdamnit where's gtrak when you need him..
17:47ZekkaOf course, a lot of what imperative languages already expose are among the simpler things that you can do in Haskell
17:47ZekkaThey basically have one monad that's pretty expressible in one monad transformer stack
17:48Zekkabut if you want to define a language that doesn't choke on corners when you want, I don't know, extensible flow control maybe, then things get a little rough
17:52Zekkatechnomancy: Here's what some of the problems look like: 'how can you turn pure things into effectful things, treating all effectful things as essentially the same kind of thing and allowing various kinds of effectfulness to be composed', 'how can you turn mutation, modification, and access into the same kind of thing such that composing accessors yields an accessor'
17:52ZekkaThey're not intrinsically about types but they make types pretty valuable
17:59akurilinquick question: has anybody figured out a good approach for multi-database access in Korma? As in, say I have an OLTP and an OLAP instance, right now korma's choice of target DB is determined through global state
18:05Jaoodakurilin: I hear the approach to korma is to not use it
18:08mr-foobaris there a protocol for Symbol ?
18:11technomancymr-foobar: symbols predate protocols
18:12amalloythey implement clojure.lang.Named, if that's any help
18:13mr-foobaramalloy: do you mean https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Named.java ?
18:46gfredericksmr-foobar: yes that's what he meant
18:47augustldoes it make sense to have a "component" (Stuart Sierra's stuff) that just starts doing some stuff when the app starts up, such as migrating a database, starting workers, etc?
18:48mr-foobargfredericks: i need a subset of symbols/namespaces apis. lang.Named won't do it.
18:49gfredericksmr-foobar: what's your higher level goal?
18:50gfredericksaugustl: ...sure? what aspect are you worried about?
18:50augustlgfredericks: no idea :)
18:50arrdemhappy weekend people. I'm gone.
18:50augustlare you telling me I get to choose/have to design my own system??
18:50lazybotaugustl: Definitely not.
18:50gfredericksaugustl: the thing I've found the most awkward is batch stuff
18:50cbprip arrdem
18:51arrdemr i p volvo
18:51augustlgfredericks: hmm, what kind of batch stuff for example?
18:51mr-foobargfredericks: state machine using a dispatch table.
18:52gfredericksaugustl: ETL, e.g.
18:52gfrederickserror handling in a batch context is different from a steady state context
18:54akurilinJaood: what do you mean?
19:01augustlakurilin: isn't there a lower level API where you can pass in the conn?
19:02augustlbeen a while since I did sql from clojure.. But I would also imagine that it's possible to have korma just return the sql statement objects you can pass to jdbc
19:06jcromartiephew
19:06jcromartienow that I have lein-cljsbuild and lein-ring humming along smoothly, this is quite nice
19:07jcromartiewith some middleware for edn back and forth
19:10mi6x3many out-of-the-box html formatter for clojure?
19:26Raynesmi6x3m: 'html formatter'
19:26jcromartieclojure.lang.ExceptionInfo: Could not locate cljs/core/async/macros__init.class or cljs/core/async/macros.clj on classpath
19:27jcromartiewhy not?
19:27jcromartienever mind
19:27jcromartieneeded to reload after project.clj change
19:27jcromartieI should really take 5 seconds before posting to IRC
19:28AWizzArdjcromartie: happens to the best
19:29jcromartiethis must be The Right Way™ to do web development… core.async on the client and server, EDN going back and forth… damn
19:29jcromartieI mean seriously
19:29AWizzArdjcromartie: btw, what are you doing with core.async?
19:30jcromartiewell since dnolen's client-side core.async demos made me cry, I just wanted to try it
19:30jcromartieI have a big Clojure web app, and so far it's very traditional: the server renders HTML and sometimes we throw some JS up that makes it fancy
19:30mi6x3mRaynes: what compojure used to do
19:31AWizzArdI would like to know if CSP is equivalent to FRP.
19:31jcromartieI've steered away from single page web apps in general because of JS callback hell
19:31mi6x3mjcromartie: wise :)
19:31jcromartiebut now that I've seen Om and core.async on the client in general, I feel like it's powerful enough to make the teetering tower of abstraction worth it
19:31mi6x3msingle page is doomed
19:32jcromartiemi6x3m: you think? that's not what I'm saying
19:32jcromartieI love URLs
19:32jcromartiedon't get me wrong
19:32clojurebotexcusez-moi
19:32mi6x3mI am saying it :)
19:32AWizzArdjcromartie: if you use Om you will probably need a slider widget too.
19:32mi6x3msingle page creates hell for everyone
19:32AWizzArdmi6x3m: why is that?
19:33jcromartieI might agree… it depends
19:33mi6x3mAWizzArd: take search engines for starters
19:33jcromartieit breaks a lot of good things about the web
19:33nullptrgood point -- everytime i use gmail i'm just like "ugh, why can't you be more like '98 hotmail?!"
19:33mi6x3mthen URL generation, JS managing etc.
19:33mi6x3mit's hard to analize content when the content is not static
19:34nullptrand seriously, google maps? mapquest was good enough.
19:35jcromartiethere are some great single page apps for sure
19:35jcromartieGoogle Maps is where it works nicely
19:36jcromartieI don't want to click on a city and wait for the load
19:36jcromartiebut for Wikipedia, it would probably be a huge mistake
19:37AWizzArdbut there is pushState
19:38AWizzArdWe have a single page app, but fully indexable by search engines.
19:38AWizzArdDirect links are supported, browser navigation
19:38AWizzArdIt’s pretty easy to do with CLJS+Om.
19:41AWizzArdIs CSP a superset of FRP? Are they both semantically equivalent?
19:42AWizzArdtbaldridge: maybe you know it? :)
19:59akurilinaugustl: Oh I see, hm yeah that's fair
19:59akurilinaugustl: good idea
21:39benkaydoes anyone have a hack to prevent cider from popping up an os x java applet when jacking in?
21:44amalloybenkay: see https://developer.apple.com/library/mac/documentation/java/Reference/Java_PropertiesRef/Articles/JavaSystemProperties.html - you can probably set apple.awt.UIElement or java.awt.headless
22:00mackindoes anyone know of any clojure startup jobs
22:08uvtcI've got a fairly large set of maps; what's the best way to find one of them based on the value of some particular key? Here's what I've got: <https://gist.github.com/uvtc/c1c4cbd6f57c85466e7e&gt;.
22:33ambrosebsuvtc: filter is lazy, both those methods look identical.
22:34uvtcambrosebs, Ah! Thanks for that observation! Didn't realize that (no pun intended). :)
22:34ambrosebs:)
22:42TimMcHaha, best project name: https://github.com/kimhyunkang/r5.rs
22:42TimMc(Scheme implemented in Rust.)
22:42uvtcHehehe
22:43uvtc.oO(would be nice to see a clojure.rs...)
22:44Frozenlock .oO(would be nice to see a clojure.clj...)
22:54TimMcsnrk