#clojure logs

2016-01-12

01:45turbofailthere should really be a transducer version of group-by
01:45turbofailunless there is and i've missed it
02:18amalloyer, what would that do?
02:20turbofailit would return a reducing function that looks a lot like the one that's in group-by already, but with `conj' replaced by the argument reducing function
02:21turbofailit'd probably also have to be able to receive some kind of default value to use in place of []
02:22turbofaili use a similar function in my personal elisp library and it's super convenient, though it's slightly hampered by the fact that hash tables in elisp are mutable
02:26blti feel like there is a better way to do this... https://www.refheap.com/113557
02:29bltperhaps reduce
02:41WickedShellIs there a hint that can be passed to the compilier that tells it to strip the docstrings on AOT compilation? I've been looking but can't find anything similar to that
02:43turbofailblt: here's how i'd do it - http://sprunge.us/PQMi
02:43bltturbofail: hey, that's nicer!
02:45bltturbofail: gotta love destructuring
02:59turbofailamalloy: here's an example implementation and usage of what i had in mind
03:00turbofailit's a pretty powerful tool, i think. though on further inspection, i'm not sure how it would fit into the existing group-by function, because that "default" argument is pretty important
03:06amalloyturbofail: it looks like you said "here's an example" but didn't actually link to it?
05:03qsysWhat about core.async publisher and timeout? I have a core.async/pub, but would like to perform a 'default' action if nothing happens during xx milliseconds. (If something happens, timeout timer should reset.) I thought of using alt! somewhere, but can't figure out exactly where...
05:06qsysthe publisher being: (def messagepub (async/pub messageq first)) I'd need a message that's added to the messageq (core.async/chan) when nothing else is added during xx milliseconds
05:09qsysor do I need a timer which is reset everytime a message is received?
05:33qsys... or put (alt! messageq ([msg] (publish-message msg)) (timeout :timed-out)) on a channel before the publishing
06:00tomekd789Does anything happen on this channel, aside of people joining and leaving? The reason for asking is I'm looking for clojure "hot spots", or "vibrant societies", for general discussions.
06:16mpenetit's more active a bit later in the day
06:17mpenetbut yes, there is life
06:17mpenetas shown there: http://clojure-log.n01se.net/
06:19mpenetqsys: sounds like an alts! in a loop/recur with a receiving chan and a timeout chan is the way to go yes
06:23tomekd789@mpenet: thx
06:25SevereOverfl0wtomekd789: Make sure you check out the slack, really active there.
06:37tomekd789SevereOverfl0w: Can you expand 'slack'? Will be happy to join.
06:40scottjtomekd789: https://clojurians.slack.com/
06:40SevereOverfl0w^^ beat me to it
06:40aureliancan I access that via my IRC client?
06:41SevereOverfl0wI think so actually.. but the web client is really very neat imo.
06:41scottjaurelian: I think so, slack has an IRC gateway
06:42aurelianyeah, I know but it has to be activated by community admin or something
06:42aurelianis not enabled by default AFAIK
06:42aureliananyway... how do I get an invite to slack?
06:42mpenetit's accesible via a normal irc client yes
06:43aureliansweet
06:43mpenetI used to do just that
06:43scottjaurelian: auto inviter http://clojurians.net/
06:46tomekd789scottj: thanks!
06:53qsys@mpenet (12:19): thx... saying it 'loud' (on irc) made me realize it's rather obvious
06:57turbofailamalloy: doh. here's the link http://sprunge.us/SGXa
06:57aurelianso how do I get into that slack thing?
07:10tomekd789scottj: got there, tx again.
07:18tomekd789aurelian: start with the auto-inviter mentioned above by scottj, i.e. http://clojurians.net/
07:18tomekd789aurelian: then you'll be guided by hand
07:19aurelianah, okay for some reason I was accessing clojurians.slack.com
07:25aureliancool stuff, I'm in :)
07:55ustunozgurI recall seeing a lein plugin that adds the dependency to the dependencies list from the command line, kind of the equivalent of npm install foo --save.
07:55ustunozgurdoes anyone remember the name or the technique?
07:56ustunozgurfound it
07:56ustunozgurhttps://github.com/johnwalker/lein-plz
12:25justin_smithaurelian: http://clojurians.net/
12:25justin_smithoops, I was scrolled and did not realize it
12:34lokienHey, does someone here use cursive?
12:38TimMcystael: Did you figure out the Luminus thing from the other day?
12:39Kamuelalokien: I tried but settled on night code
12:40lokienKamuela: did you do that licence thing? my friend's having issues with that
12:40Kamuelalokien: nah just the trial
12:41lokienKamuela: damn, so we're screwed
12:41KamuelaContact support if there's an issue
12:42justin_smithlokien: cfleming is often here - he might be able to help
12:42kwladykalokien just register on cursive site, it is easy
12:42kwladykabut you have to wait for accept
12:43kwladykaKamuela ^
12:43lokienkwladyka: we've got the key, but every time we enter it, there is "invalid certificate" message
12:44kwladykalokien oh are you sure you copy whole key the beginning to the end?
12:45sdegutisIs there a shorter way to map an array of keys to their values in a map, than this? (map #(get m %) ks)
12:45lokienkwladyka: yeah, with ----begin licence---- and without
12:46kwladykalokien you can always write to cursive@cursive-ide.com with your problem
12:46justin_smithsdegutis: (map m ks)
12:46sdegutisOh!
12:46kwladykalokien he will answer
12:46sdegutisSweet! Thanks justin_smith :D
12:46lokienkwladyka: and we've tried to enter just this big chunk of code, didn't work also. I guess he'll just switch to linux
12:46lokienkwladyka: thanks for help
12:46sdegutisI forgot maps are functions of themselves.
12:47sdegutisMainly because it's /generally/ bad practice, in the event it's nil.
12:47justin_smith(map (or m {}) ks) ?
13:00sdegutisIn my case it's fine.
13:00sdegutisI definitely know m is some?.
13:04justin_smithfor extra safety you could check ifn? instead
13:04justin_smith,(ifn? {})
13:04clojurebottrue
13:04justin_smith,(ifn? "")
13:04clojurebotfalse
13:07sdegutisI imagine Compojure's source code is very high quality Common Lisp.
13:08sdegutisAnd if I ever finish my Lisp-like language, it will absolutely not have macros. All things that would be macros will be built into the compiler as internal AST transformation phases.
13:08j-pbwhy have s-expressions if you cant extend the compiler?
13:09sdegutisj-pb: because they're still the superior syntax
13:09sdegutisWriting Clojure in Emacs using Paredit is always really easy for me, much easier than other languages.
13:21sdegutisDoes core.match have something like {:keys [...]} ?
13:24sdegutisNever mind, using the work-around.
13:45sdegutisOh man.
13:46sdegutiscompojure.core/GET is a macro that doesn't return a syntax-quoted form.
13:47justin_smithsdegutis: eh, it calls a function that returns a syntax-quoted form, what's the difference?
13:47sdegutisTouche
13:47sdegutisI'm trying to piece apart what it does so I can reverse-engineer it in order to build up my own list of routes as data, which I can then turn into a Compojure router.
13:48sdegutisSo that I can do [:get "/" #'home/landing-page]
13:48justin_smithsdegutis: have you looked at bidi or polaris? those are two examples of routing libs that basically do that
13:49sdegutisAh.
13:49sdegutisYeah I was trying bidi out, but I don't understand why {foo bar} is equivalent to [[foo bar]] rather than [foo bar].
13:49sdegutisThat fact scared me away from it.
13:49justin_smith,(vec '{foo bar})
13:49clojurebot[[foo bar]]
13:50sdegutisOooh, right.
13:50sdegutisSo it's just like when you put {} through for and destructure with [k v]
13:50sdegutisThat makes more sense.
14:03jmonrealhello, does anyone know where can I find two sigma satellite irc channel or where to discuss this project?
14:06sdegutisjustin_smith: also my brain has the most impossible time parsing ["/" {"blog" {:get {"/index" (fn [req] {:status 200 :body "Index"})}}}]
14:06sdegutis(One of the examples on the main page.)
14:07sdegutisAnd separating it into different lines with their own indentations doesn't help one bit.
14:07justin_smithsdegutis: then make up your own way of arranging the data, and a function that turns it into the other one?
14:07justin_smithit's just data
14:07sdegutisBut I can't even *understand* the other one.
14:07sdegutisSo I can't transform anything into it.
14:07sdegutisIt literally seems like a bunch of nonsense data with no apparent structure.
14:08sdegutisThis is probably my 7th time reading the readme in two weeks, and I still just have no idea what's going on with this data.
14:08cfleming$mail lokien mail me at cursive@cursive-ide.com and I'll help you out with that.
14:09sdegutisHis BNF doesn't really help either. In fact I think it kind of proves my point, that this data format is practically opaque.
14:09cfleming,(+ 1 2)
14:09clojurebot3
14:09justin_smithcfleming: different bot
14:09justin_smithcfleming: lazybot does $mail, and is not around
14:09cflemingOk, just checking - is the mail bot...
14:09cflemingdarn
14:10cflemingOh well
14:10cflemingThey know where to find me, I guess
14:13sdegutisWow.
14:13sdegutisbidi is surprisingly difficult to use
14:13sdegutisand silk has very little traction, so it's going to die and be consumed by bidi
14:14sdegutisI have half a mind to fricken write my own router at this point. All the major options are unworkable.
14:16DomKMsdegutis: Lot's of people seem to be using Silk without issue. I won't let it die; I just don't have time to finish v1 right now.
14:17sdegutisDomKM: I don't mean any offense. It's just the nature of open source. Over time, projects get re-prioritized, and those which don't make money, directly or indirectly, are gradually abandoned, and its userbase is consumed by the next best thing.
14:18sdegutisDomKM: take weavejester's for example; it's probably the most inferior of all the routing libs, but it helps him get contract work, and it's got strong name recognition in the community, so it's become the de facto router
14:18DomKMIt's also the oldest
14:18sdegutisAnd he's going to continue to have time to update it as the Clojure ecostructure evolves, so it'll be around the longest.
14:18justin_smithyeah - to replace the first mover, you need to be at least 10x better, anything less is overcome by resistence to change
14:19sdegutisYep.
14:23sdegutisWhich also explains why people still use Java and C++.
14:23DomKMsdegutis: Either what I am working on will become profitable and some of that will be put toward growing Silk (because we use it), or what I am working on will fail and I will have a lot more time to work on OSS, which means I will be going back to Silk. Either way, I'll get back to it (I just hope it's under the former condition). So, yes, it is a
14:23DomKMprioritization issue but I expect the priorities to change, one way or the other.
14:23sdegutisDomKM: well, best of luck to you then sir :)
14:23DomKMThanks :)
14:23sdegutisDomKM: although I'm sure luck will play a small part in your success considering your talent ;)
14:24DomKMAnyway, sorry that Silk hasn't worked well for you thus far.
14:25princesowhy would be that postwalk isnt respecting the metadata of lists?
14:25princeso,(clojure.walk/postwalk (fn [x] (prn (meta x) x) x) '^:meta(list x))
14:25clojurebot#error {\n :cause "clojure.walk"\n :via\n [{:type java.lang.ClassNotFoundException\n :message "clojure.walk"\n :at [java.net.URLClassLoader$1 run "URLClassLoader.java" 366]}]\n :trace\n [[java.net.URLClassLoader$1 run "URLClassLoader.java" 366]\n [java.net.URLClassLoader$1 run "URLClassLoader.java" 355]\n [java.security.AccessController doPrivileged "AccessController.java" -2]\n [java.net.U...
14:26justin_smith,(require 'clojure.walk)
14:26clojurebotnil
14:26princesothe bot has a session for every user?
14:27princeso,(require 'clojure.walk)
14:27clojurebotnil
14:27princeso,(clojure.walk/postwalk (fn [x] (prn (meta x) x) x) '^:meta(list x))
14:27clojurebotnil list\nnil x\nnil (list x)\n(list x)
14:28justin_smithprinceso: no, there are no per-user sessions
14:28princeso,(clojure.walk/prewalk (fn [x] (prn (meta x) x) x) '^:meta(list x))
14:28clojurebot{:meta true} (list x)\nnil list\nnil x\n(list x)
14:28princesoprewalk works good
14:29sdegutisDomKM: like I said in the github issue a few years ago, it's not that silk isn't right for my needs, it's that I don't understand how to use it from a routing perspective, since the readme seems to focus on it from too abstract a standpoint, rather than how to use it in real life
14:29sdegutisDomKM: I looked at it again a few weeks ago to see if that was addressed, but I still couldn't really see how to use it as a router.
14:30sdegutisDomKM: the "Strings only match themselves." and "Keywords are wildcards." and "There are also built in patterns for common use cases." don't explain how this has to do with routes at all; it's very confusing
14:31justin_smithprinceso: the issue is in the source of clojure.walk/walk - if the item is a seq, it calls map, and map does not preserve metadata
14:31sdegutisDomKM: if those were addressed, I'd love to take another look at silk
14:31justin_smithprinceso: though it would be easy to make a version of clojure.walk/walk that preserves metadata of seqs
14:32DomKMsdegutis: What specific routing context? Backend with Ring (Compojure replacement)? Frontend (Secretary replacement)? Both? If frontend, do you want to route with the history API or with hashchange?
14:32sdegutisAs a Compojure replacement.
14:32sdegutisI think I see the issue here. Is there a programming thing called generality-syndrome?
14:33DomKMsdegutis: Gotcha. Okay, well Silk isn't specific to Ring, Compojure is.
14:33princesojustin_smith: that sounds interesting, i searched for a way to make a walk, with no look
14:33sdegutisLike, when you try to become so abstract that you're everything to everyone.. that thing
14:33justin_smithprinceso: (clojure.repl/source clojure.walk/walk)
14:33DomKMHah, I don't know if it's a syndrome but yeah, it's quite general.
14:34justin_smithprinceso: if you look at the source of postwalk, it's just a simple call to walk
14:34DomKMTo use Silk with Ring, you need to generate your own Ring responses (status, body, etc.). Compojure does that for you. Silk only handles the URL matching part, not what you do after. That's why I was asking what context you were trying to use it in.
14:34sdegutisDomKM: I don't even mind if it's not specific to Ring. As long as I can give it "/articles/:title/edit", match it to "/articles/foo/edit", and it gives me a positive match along with {:title "foo"}, that's good enough for me.
14:35sdegutisThat's what I'm looking for in the beginning of a readme for a router.
14:35sdegutisClout seems to do that mostly well enough, so I'm trying that now.
14:35DomKMIt does that, except you'd write ["articles" :title "edit"]
14:36princesojustin_smith: thx. let me watch closer ... i see prewalk calls walk even
14:37Bronsa`sdegutis: have you looked at bidi?
14:37justin_smithBronsa`: he said he was confused by it
14:38Bronsa`https://github.com/juxt/bidi#route-patterns
14:38Bronsa`it's pretty straightforward and does exactly what he's describing
14:39sdegutisDomKM: Hmm, I like that.
15:04SevereOverfl0wDomKM: Bidi is a pretty good example of how to talk about the generic router, but also mention ring, in my opinion.
15:25orzIf, in an interop situation where I'm grabbing an object from a java iterator, do I need to cast it explicitly still?
15:38sdegutisAlso, Compojure seems to do a lot of transformation stuff with various kinds of params.
15:47justin_smithorz: why would you cast it?
15:47justin_smithorz: also, instead of grabbing an object from an iterator, you can use iterator-seq
15:52orzIm trying to use an ImageWriter to control the quality of a saved jpeg image.
15:52justin_smithOK
15:52orzTo do that I need to call ImageIO.getImageWritersByFormatName("jpeg"); and take the first element from the iterator it returns
15:53orzAnd the java docs Im using tell me I have to cast it since the iterator it has dosen't use generics
15:53justin_smithorz: generics are fictional
15:53justin_smiththey don't exist
15:53justin_smithwe don't have casting because we don't have generics (since the vm doesn't have them either, this isn't a problem)
15:54orzSo I can just take the object and try calling the method I need from the subclass?
15:54justin_smithright
15:54justin_smithyou can use a type hint to avoid runtime reflection when calling the method, but that's not the same as a cast
15:55orzSo I could use something like (let [^ImageWriteParam iwp (.next iter)]) right?
15:55justin_smithright
15:55justin_smithwell, the name comes before the hint, but yeah
15:55justin_smithI think? maybe I misremember that.
15:56justin_smithnever mind, you have it right
15:56orzThe docs for iterator-seq say I can just use seq directly on an iterator. So does that mean I could just write "(let [iwp (first (seq iter))])"?
15:57justin_smithorz: or (first iter) - first calls seq on its arg
15:57justin_smith,(doc first)
15:57clojurebot"([coll]); Returns the first item in the collection. Calls seq on its argument. If coll is nil, returns nil."
15:57orzthat's even better. Thanks!
15:58justin_smithorz: so iterator-seq says for Iterable you don't need iterator-seq - TIL
15:59orzYeah but the way I get the iterator is from a static ImageIO method, so I thought I needed the iterator anyway
16:01justin_smithYeah in clojure it shouldn't matter where your Object came from, as long as it has the Interface or Class you need.
17:12sdegutisOh man.
17:12sdegutisCompojure -> Clout -> Instaparse.
17:12sdegutishttps://github.com/weavejester/clout/blob/master/project.clj#L7
17:14sdegutisCompojure indirectly uses Instaparse, heh!
17:30sdegutisIs it possible to discover an anonymous function's arglists? For example, from (fn [a b] ...), end up with '[[a b]]
17:31justin_smithI think you'd need some black magic for that
17:32sdegutisHmm.
17:32sdegutisTried looking into AFn.java to see if there could be some fields I could examine.. but nope
17:32justin_smithI guess you could use serializable-fn
17:32sdegutisAhhh haha yeah maybe.
17:33justin_smiththat means using the special serializable version of fn though
17:33justin_smithor replacing fn with that one?
17:33sdegutisRight.
17:33sdegutisYeah I'm not gonna go that route.
17:34amalloyjustin_smith: and also having to do some data wrangling to *find* the arglists in the list representation of the functino
17:34justin_smithoh, that too, yeah
17:34amalloylike you have to handle '(fn [a b]) as well as (fn '([a] [a b])) as well as '(let [x 1] (fn [a b]))...
17:36justin_smithsdegutis: you could promise not to do side effects, then use try/catch to find out via trial and error which arities it accepts
17:36justin_smithlol
17:36sdegutisHaha.
17:36sdegutisOh you.
17:37amalloyyou laugh, but i would estimate there are a countably infinite number of people who have decided this is a good idea
17:47sdegutisI'm mostly leaning toward (defn ^{:method :get :path "/"} home-page [db user] ...)
17:54justin_smithsdegutis: or the thing where everything takes exactly one arg, a hash map
17:54justin_smithI mean that's what ring does anyway
17:54sdegutisYeah, that's what I'm doing right now.
17:55sdegutisBut I'm trying to meta-program away the [{:keys [db user]}] so I can just write [db user]
17:55sdegutisBecause that gets old after the 240th time.
17:55justin_smithfeels like a lot of effort for a minimal convenience
17:55sdegutisYou may possibly be right.
18:08sdegutisIn fact, you *are* right.
18:09TimMcAll my fns take exactly two arguments: The first is a lookup table of names to fns, and the other is an argument map. It makes dependency injection so easy! /s
18:10justin_smithhaha
18:11SevereOverfl0wHeh. I've been doing something like that for templating, where my functions return either a ring map, or a hashmap for the templates. So my enlive fns must take only one arg or die.
18:11SevereOverfl0wI do wish there was a simple way to use something like Plumbing's fnk with Enlive (& other macro-based things)
18:12SevereOverfl0wI do wonder if we've over-encouraged macros for the fn problem, when really we should have been accepting anonymous functions as arguments.
18:18sdegutisDI well is hard.
18:20SevereOverfl0w* well is hard.
18:21TEttingerhard * is, well...
18:22sdegutisHa. ha.
18:22sdegutishaaaaaa....
18:24blake__Trying to send-message with postal and...going postal.
18:24justin_smithdealing with time zones and feeling pretty wibbly-wobbly about things
18:24blake__In the docs for the google example it has this for the ssl key: ":ssl :yes!!!11}"
18:24hiredmanwhile reading "Going Postal" I hope
18:24blake__(And playing postal.)
18:25blake__But the ":yes!!!11" doesn't seem to actually work. No keywords work. Nor does "true", as I found elsewhere. It apparently needs to be a string.
18:25justin_smithblake__: guessing it accepts anything truthy, so they just threw in something silly
18:25justin_smithoh
18:26blake__justin_smith: Yeah. I get a "boolean can't be converted to string" or "keyword can't be..."
18:27blake__Oh, crap, never mind. Just a typo. =P
18:28sdegutisblake__: you using AWS SES?
18:29blake__sdegutis: Not currently. Might, though, later on.
18:29sdegutisok
18:47nanukois it possible to create a random object in clojure such that i can perform `(.randomMethod random-object 1 2 3 4)`?
18:48justin_smithnanuko: how random does the object need to be?
18:49nanukojustin_smith: essentially an object that mocks out one called for a side effect
18:52justin_smithnanuko: that doesn't sound random at all - you can reify the interface which defines .randomMethod
18:52amalloybet you a dollar it's not in any interface
18:53justin_smithOK, you could proxy the calss
18:53justin_smith*class
18:53nanukoamalloy: yup, it’s a class
18:53amalloyunluckily, the class (or method) is final
18:54nanukothe class is method
18:54nanukofinal*
18:54nanukosorry
18:54amalloyjava unreasons
18:54nanukothis is the class i’m trying to mock https://github.com/tim-group/java-statsd-client/blob/master/src/main/java/com/timgroup/statsd/NonBlockingStatsDClient.java
18:55amalloynanuko: you just need to reify StatsDClient
18:56amalloywhich is the actual interface this class implements
18:57nanukowould i need to reify the whole interface?
18:58amalloywell, supposedly yes
18:58amalloybut in practice you can reify just one method and as long as none of the others are called you get away with it
18:59nanukooh sweet! so something like (reify StatsDClient (incrementCounter [arg] (prn arg))?
18:59amalloysure, as long as this function you're calling on doesn't rely on its StatsDClient to do anything meaningful
19:02nanukonope, just checking that the function is called in a test
21:10kenrestivowhat's that clojure equivalent to chef, puppet, and ansible?
21:11kenrestivoiirc chef and puppet are ruby. ansible is python. and ___ is clojure?
21:16amalloykenrestivo: you're thinking of pallet
21:17amalloybut i think the puppet folks said some publicly nice things about clojure a while ago, claiming they were "switching to it" somehow, but i don't remember the details. probably in some way that doesn't end up affecting users who write plugins in ruby or whatever
21:32kenrestivoamalloy: thanks, pallet it is.
21:32kenrestivooh did they? hmm...
21:32amalloyhttps://puppetlabs.com/blog/new-era-application-services-puppet-labs
21:32amalloyapril 2014
21:54Sgeo_WHat's that pastebin that uses Mozilla Persona?
21:57TimMcSgeo_: refheap, but it's going read-only and persona is going to the farm
21:58Sgeo_I just saw the thing about Persona, which is why I was wondering, but why is RefHeap going read-only?
22:07TimMcSgeo_: Raynes didn't have the time and energy to deal with takedown requests for credit card numbers and other stuff that was being posted illegally.
22:09Sgeo_Ah
22:16kenrestivothe farm?
22:16kenrestivowhat farm?
22:17justin_smithamalloy: puppet is heavily invested in clojure, they host all the portland clojure meetups, and clojure and c++ are the two parts of their backend right now
22:18amalloykenrestivo: the farm upstate, i presume
22:18amalloythe big doggy park in the sky
22:19kenrestivooh. bummer. it was the best system around. of course it wouldn't last.
22:19kenrestivoinstead we get authentication grafted onto an wildly-un-interoperable authorization system. yay.
22:28TimMcPersona was persistently close to being good, but never really reached it.
22:29TimMcI saw an interesting post by someone at Mozilla who said that the design was fatally flawed due to (IIRC) too-rapid development and not enough resources.
22:29TimMcsomething like that
23:15virmundihello.
23:15virmundiis edn replaced by Transit?
23:16TEttingerno, they have different purposes
23:17virmundiaside from configuration with edn, as an interchange document, what’s the difference?
23:17virmundiI thought edn targeted Java, iOS and JS by wayof ClojureScript
23:18amalloyisn't transit illegible to humans?
23:18TEttingeredn is considered a data format like XML or JSON, all 3 are human-readable
23:19TEttingerhence why clojure uses a superset of edn for source
23:19TEttinger(if it wasn't human-readable it wouldn't be very useful!)
23:19virmundiso Transit is a mostly better because it’s a binary format?
23:19TEttingeragain, different purposes
23:19TEttingerthere is not a better here
23:20TEttingeris a carrot better than an orange
23:21virmundiif I was making a new REST-ish service, would I want to use Transit or edn, with the possiblity that I’ll eventually expose my service to iOS and Android?
23:21justin_smithtransit has better portability to other languages
23:22amalloybetter than edn? i was not aware of that
23:22justin_smithand unlike regular edn you can use a locally scoped data structure to describe the encodings (instead of a magic file on the classpath)
23:22TEttingerclojure can run on iOS and android but not as quickly as it does on the desktop/server
23:23TEttingerso justin_smith is right about the portability being a good thing
23:23virmundiis there a clojure->Swift transpiler?
23:23TEttingerguh?
23:23TEttingerwhy on earth would someone transpile to swift?
23:23virmundiwell, I thought the way clojure works on iOS presently is via JS/Clojurescript.
23:23TEttingerI think it's via robovm, let me check
23:24justin_smithamalloy: I don't have a clean cite, but I can say that transit comes from the folks who made edn, and is meant for cross-language data sharing
23:24amalloyi mean, so was edn
23:24TEttingerhttps://github.com/oakes/lein-fruit
23:24TEttingerthere may be other things like this
23:24amalloymy understanding was that the difference is edn is human-readable, transit is compact
23:25justin_smithamalloy: I'm looking at the cognitect repos and not finding any edn libs for other languages
23:25amalloyhttps://github.com/relevance/edn-ruby
23:25TEttingerrobovm has become commercial since that was made, though certain things still get free licenses
23:25amalloythere are edn libs all over, some more official than others i guess
23:26justin_smithright, but there are official transit libs from cognitect for python, ruby, java, javascript
23:26TEttingerwell the reason you wouldn't want to transpile to swift is because it makes more sense to generate bytecode that iOS can run natively (LLVM) AND that every other LLVM platform can run (including the web via emscripten)
23:27amalloyhttps://github.com/edn-format/edn/wiki/Implementations
23:27justin_smithinteresting
23:27amalloyi think they want(ed) both of these things to be portable
23:27TEttingerbut clojure (and to a lesser extent clojurescript) is not something that someone can magically write a transpiler for overnight. clojure has a non-trivial amount of java source
23:28amalloywhether they achieved that is another question
23:28amalloyi certainly would not use transit in real life, where i would consider edn
23:28justin_smithamalloy: I use transit extensively, and at the code boundary it becomes edn
23:29amalloythe code boundary?
23:29justin_smiththe point where it goes from being an opaque container I pass around, to a value I use
23:30justin_smithprobably there's a better way to say that
23:30virmundijustin_smith: you unmarshal it from the wire to edn internal.
23:30justin_smithright
23:30justin_smithbut if I consumed it from js it would become standard js datatypes
23:30hiredmanyou don't unmarshal antthing to edn
23:31hiredmananything to edn
23:31virmundiaside from the compactness, I think transits’ linking might make it a better REST data format.
23:31hiredmanedn is marshaled
23:31amalloyyeah i was about to say the same thing hiredman is
23:32amalloyyou don't unmarshal to edn internally, you unmarshal to clojure data types
23:32amalloyedn is string representations of data
23:32virmundiI kinda thought so.
23:34virmundithanks.
23:53domgetterIs it possible to make a macro that expands to more than one form?
23:53justin_smithno
23:58neoncontrailsI have a postrgresql server up and running, and I'm following the instructions here to connect it to my luminus app: http://www.luminusweb.net/docs/database.md. I'm following along up until the part where it binds a raw SQL query to a function called create-user! and passes a bunch of fields to it. How do I call this function from my app?
23:59domgetterneoncontrails: that link didn't work
23:59neoncontrailsIs the idea to require the myapp.db.core namespace in myapp.core, and use the fully-qualified myapp.db.core/create-user! syntax to invoke?
23:59neoncontrailsdomgetter: hmm, let me try again
23:59domgetternvm, i removed the trailing period