#clojure logs

2015-01-31

00:00justin_smithMr0rris0: there is a gestalt effect where once you get past a certain threshold it all starts to synergize
00:01justin_smith(yes, I intentionally used ubscurantist phrasing for that :P)
00:01rhg135really, justin_smith? unperceivable fault in verbiage.
00:02Mr0rris0cool
00:03Mr0rris0i put nnscript on here earlier today, looks like it tells you when the day switches over
00:14Mr0rris0so how far along are you guys into this world/path/skill level
00:16ianhedoesitwhat do you mean?
00:16Mr0rris0yeah
00:16Mr0rris0...
00:16Mr0rris0i dunno
00:16Mr0rris0the more advanced areas
00:17Mr0rris0its relative i guess
00:17Mr0rris0ive been on computers nearly all my life but nothing advanced or of much use
00:18justin_smithI'm level 100, still working on my elite suit of armor
00:18Mr0rris0lol
00:19Mr0rris0so going by that logic im at level .5
00:19rhg135i've been on certain chans where the programmers are lv. 0.001
00:19rhg135don't be discouraged
00:19Mr0rris0yeah of course
00:20justin_smithgo grind on some low level 4clojure problems, make a small project, you'll level up fast enough
00:20Mr0rris0ok
00:20rhg135clojure makes it easier to level up imo
00:22Mr0rris0im about 26 been on computers since about 5. its been easy to use them without learning an awefull lot
00:22TEttingerjustin_smith is at level...
00:22TEttinger(identity justin_smith)
00:22TEttingerclojurebot?
00:22clojurebotclojurebot has a poetic soul
00:22rhg135lazybot is... lazy
00:22rhg135oh
00:22rhg135wrong bot lol
00:22TEttinger$karma justin_smith
00:22TEttingerright it is lazybot
00:22justin_smithoh wow, lazybot is out
00:22TEttingerand lazybot is missing
00:22TEttingeryep
00:23Mr0rris0compared to say my grandma or my mom, im an expert but compared to you guys im like them compared to me
00:23rhg135you'd be surprised
00:23justin_smithTEttinger: oh, were you going to compare karma to experience level?
00:23Mr0rris0i think you would lol
00:23Mr0rris0it takes alot to know what you dont know
00:23TEttingerjustin_smith, yeah your helpful level is over 9000
00:23rhg135i havent written a single line in weeks cuz life
00:24justin_smithTEttinger: the secret is figuring out how to help other people is a great way to get better myself
00:24TEttingeryep!
00:24TEttingerbut you have 4x my karma!
00:24justin_smithrhg135: starting around the new year I got super scatterbrained / distracted, had a hard time getting any real programming work done
00:25justin_smithonly in the last week or so is the magic juice starting to flow again
00:25justin_smithit's weird how it happens
00:25justin_smithI think it might have been a sleep quality thing...
00:25Mr0rris0could be
00:25rhg135it is, justin_smith. but in my case it's completely by choice
00:25Mr0rris0if the infomercials are correct a lack of sleep causes toxins to build up
00:25ianhedoesit30.2118 < rhg135> clojure makes it easier to level up imo
00:26Mr0rris0i saw that once late in the night
00:26rhg135i'm past the withdrawl i think
00:26ianhedoesitrhg135: I agree. I just started with Clojure in the last couple weeks and it's changed my life.
00:26rhg135definitely
00:26Mr0rris0your kidding, thats a testimonial right there
00:26Mr0rris0:D
00:26justin_smithclojure's design makes many of the right choices a lot easier to make
00:26rhg135it was 'what am i doing' later
00:26Mr0rris0ive lost like 20 lbs just reading about clojure
00:27justin_smithhaha
00:27justin_smith"and I feel great!"
00:27Mr0rris0:D
00:27rhg135I used to write python, part of my code folder disgusts me
00:27ianhedoesitnot only do the right choices become easier to make, but complex and difficult problems because much easier to understand, I think.
00:28Mr0rris0what helped you absorb it so fast ian?
00:28Mr0rris0knowing other languages already?
00:28rhg135it's completely natural
00:28TEttingerMaxazax, from the makers of Dexazam
00:28ianhedoesitwell I'm not exactly a beginner with computers anyway (around a decade of programming), but Clojure is just so nice. I have a hard time putting it into words
00:28TEttingerI think I might still have the clojure prescription drug name generator
00:29rhg135it exists?
00:29Mr0rris0i found a old book in my loft in the barn about Basic the language
00:29ianhedoesitClojure is exactly the opposite of everything I've done up until now and I feel like I see things clearly now
00:29ianhedoesit(the rain is gone)
00:29Mr0rris0ever tried about 1000mg of Fukitoll?
00:30Mr0rris0i cant do more than one
00:30Mr0rris0but i was a name generator champion back in the day
00:30Mr0rris0band name is whats popular in someplaces
00:30Mr0rris0those generators can be funny
00:34TEttingerheh, I'm proud of the heavily obfuscated/compressed cthulhu text generator
00:34Mr0rris0whats that cthulhu
00:34TEttingerunfortunately it needs lazybot to be effective.
00:34TEttinger(let[a #(apply str(flatten %))r repeatedly p partition N rand-nth n #(a(N(concat(repeat %"")(mapcat p[1 2 3]%&))))v #(n 0"aioeu""iaai")w(fn[](let[b(n 6"!.""""...")s[(n 0"STKNYPKLG""GlThShNyFt""ZvrCth")(r(N[1 2])#(do[(v)(n 9(map str"'-"(r 2 v)))(n 0(concat"lpstnkgx"[(N["h""gl""gr""nd"])(v)])"rlthggghtsltrkkhshng")]))]][b(if(seq b)[" "s][(n 3",")" "(.(a s)toLowerCase)])]))](re-find #"[A-Z].+"(a[(r 500 w)"."])))
00:35TEttingersince clojurebot won't paste to refheap
00:35TEttinger,(let[a #(apply str(flatten %))r repeatedly p partition N rand-nth n #(a(N(concat(repeat %"")(mapcat p[1 2 3]%&))))v #(n 0"aioeu""iaai")w(fn[](let[b(n 6"!.""""...")s[(n 0"STKNYPKLG""GlThShNyFt""ZvrCth")(r(N[1 2])#(do[(v)(n 9(map str"'-"(r 2 v)))(n 0(concat"lpstnkgx"[(N["h""gl""gr""nd"])(v)])"rlthggghtsltrkkhshng")]))]][b(if(seq b)[" "s][(n 3",")" "(.(a s)toLowerCase)])]))](re-find #"[A-Z].+"(a[(r 10 w)"."])))
00:35clojurebot"Thiathiagh... Gek."
00:35justin_smiththat's a lot of truncation
00:36TEttingerthat's with 10 words generated and starting at the first that meets certain criteria, IIRC
00:38TEttingerhttps://www.refheap.com/96713 there we go
00:40TEttingerI have a bad scifi alien name generator, in the vein of George Lucas https://www.refheap.com/96714
00:42TEttingerthe one that started it all, a fake greek word generator https://www.refheap.com/96715
00:43ianhedoesitTEttinger: neat!
00:43TEttingerit's fun stuff
00:43ianhedoesityeah
00:43TEttingerI also used it for an indie game idea generator
00:44TEttingeroutput below http://ideone.com/0MG8ED
00:45TEttingerranging from "sports game where you destroy clothing" to "semi-autobiographical 4x game where you guide travelers through a house of horrors"
00:47ianhedoesitTEttinger: did you post that on reddit at some point?
00:48justin_smith"minimalist interactive-fiction/ball-and-paddle/strategy game where you rescue executives" haha
00:50justin_smithI would totally play "chesslike game where you command puppies" because I like puppies.
00:52justin_smith"gore-drenched dating-sim game where you gamble on Russian roulette" has a remarkable amount of coherency to it as a proposal
00:53ianhedoesitjustin_smith: maybe someone will stumble upon those game ideas and implement them with play-clj!
01:01krat0sprakharhi all, i spent some time working through this awesome tutorial of building a crud app with compojure..
01:02krat0sprakharhttp://www.jarrodctaylor.com/posts/Compojure-Address-Book-Part-1/
01:02krat0sprakharis there something like this for clojurescript
01:02krat0sprakhar?
01:02justin_smithkrat0sprakhar: there is a clojurescript todo app example out there
01:02justin_smithkrat0sprakhar: I would probably start with figwheel
01:02krat0sprakharon that blog you mean?
01:03justin_smithhttp://swannodette.github.io/todomvc/labs/architecture-examples/om/
01:03krat0sprakhari don't know react :(
01:03krat0sprakhari can cljs w/o om right?
01:03justin_smiththe tutorial covers it, you don't use react directly
01:04justin_smithyou don't need to use om, but that tutorial is a really good one
01:04krat0sprakharso to use om / reagent dont you need to know react?
01:04krat0sprakharoh ok
01:04justin_smithhttps://github.com/swannodette/om/wiki/Basic-Tutorial
01:04ianhedoesitjustin_smith: "An indie game where you haunt the world and it's WAY retro."
01:04justin_smithnice
01:05krat0sprakharjustin_smith: to be productive with om / reagent, does know need to learn react?
01:07justin_smithkrat0sprakhar: I don't really think so. and om isn't super complex. even if you did need to learn it, react is just a js framework (better designed than many)
01:07krat0sprakharohk..
01:07krat0sprakharand you mentioned figwheel
01:07krat0sprakharwhere does that fit in?
01:08justin_smithyeah, if you were starting a project from scratch, that simplifies a lot of the clojure / clojurescript setup
01:08justin_smithso you can get a browser repl etc.
01:08krat0sprakharso thats compojure for the backend and om on the frontend?
01:08justin_smithyeah
01:09krat0sprakharif you dont mind me asking .. how does your dev env look like?
01:09krat0sprakharemacs?
01:09clojurebotemacs is "it has them, they are tricky to use"
01:10justin_smithkrat0sprakhar: I use emacs, with inferior-lisp-mode to embed the repl
01:10krat0sprakharah ok.. great...
01:10justin_smithmost people prefer cider though, but it has too many moving parts for me
01:10Jaoodjustin_smith: there is a inferior-clojure-mode
01:11justin_smithJaood: oh, I had no idea
01:11krat0sprakhari just connect vim to a running repl
01:11justin_smithkrat0sprakhar: with fireplace.vim?
01:11Jaoodjustin_smith: https://github.com/clojure-emacs/inf-clojure
01:11krat0sprakharjustin_smith: yeah!
01:12krat0sprakhartim pope is just awesome.. :D
01:12justin_smithJaood: next time I want to waste time setting up emacs I may try it
01:12Jaoodkrat0sprakhar: you should read about react on their website if you are going to play with om, at least to understand its concepts and approach to the virtual dom
01:12justin_smithJaood: the reason I use inferior-lisp is it is super simple and just works
01:12krat0sprakharJaood: ah .. thought so..
01:13Jaoodjustin_smith: yeah, that its almost like inferior-lisp just a bit more clojureish
01:13krat0sprakhari saw a few videos on egghead.. and wanted to ask.. if react is V in mvc
01:13krat0sprakharwhat are people using for m and c?
01:14krat0sprakharbackbone?
01:14clojurebotbackbone is awful
01:14krat0sprakharlol :D
01:14Jaoodjustin_smith: you don't need the cider-nrepl dep
01:14rhg135model's been datascript and c custom for me
01:14justin_smithJaood: to be honest seeing the author is enough to scare me away from it, but I may try it eventually.
01:15krat0sprakharjustin_smith: haha.. whats wrong with Batsov?
01:15krat0sprakharrhg135: datascript? whats that
01:16rhg135krat0sprakhar, an in mem db for cljs
01:16justin_smithhe's the guy behind cider. in over a decade using emacs it's only been with cider that I have truly hated using emacs.
01:17JustinusIIIcursiveclojure
01:17justin_smithyes, cursive is really good if I could give up my emacs habit :)
01:17krat0sprakharor, if i could give up my vim bindings :P
01:17krat0sprakharalso nightcode is pretty cool
01:18justin_smithdoesn't idea have vi bindings? or are they just not good enough
01:18JustinusIIIi think, you can set emacs keybinding in intellij
01:18justin_smithJustinusIII: I don't use emacs keybindings, I use evil mode inside emacs. I use emacs for the features not the UI.
01:20krat0sprakharJustinusIII: any good tutorial for cursive.. i have some free time this weekend.. will try setting it up.. :D
01:20cflemingkrat0sprakhar: Try IdeaVim for IntelliJ, it's not perfect but it's meant to be pretty good.
01:21cflemingkrat0sprakhar: It has some problems with the Cursive REPL editor unfortunately.
01:21krat0sprakharcfleming: thanks, will give that a shot
01:21JaoodI would say lein repl is good enough and just use whatever editor you like
01:21cflemingkrat0sprakhar: There aren't a lot of good tutorials, but the doc is reasonable: https://cursiveclojure.com/userguide/
01:21cflemingkrat0sprakhar: Ping me here or by email if you have questions
01:22Jaoodlein repl with tmux actually :)
01:23krat0sprakharcfleming: Oh, didnt realize you are Colin Fleming! I've seen your talk.. really liked it! :D
01:24cflemingkrat0sprakhar: Thanks! Glad you liked it.
01:25cflemingkrat0sprakhar: tbaldridge also has some videos on getting started with Cursive here: https://tbaldridge.pivotshare.com/search/cursive/videos
01:25tomjackcursive is the only reason I have any hope that I may be able to use clojure in production before my next job
01:25Jaoodif Hickey could get away with just the 'jave -cp clojure.jar clojure.main' repl at the beginning then we should too :P
01:26cflemingtomjack: How's that?
01:27krat0sprakharcfleming: thanks for the link.. seems like a lot of great videos at a reasonable price
01:27tomjackif I'm trying to convince a coworker to try clojure and cursive doesn't exist, what am I supposed to say?
01:27tomjack"use sublime and `lein repl`?"
01:28cflemingkrat0sprakhar: Yeah, definitely. The first Cursive one is free though.
01:28tomjack"learn emacs"? "light table"?
01:28krat0sprakhartomjack: yeah.. what so bad in that?
01:28cflemingtomjack: Yeah - I'm hopeful Cursive will help drive Clojure adoption.
01:28Jaoodcfleming: are you going to release a paid version this year?
01:28tomjack"install cursive" is the only answer I can give with a straight face
01:28justin_smithtomjack: ed, and java -cp clojure.jar clojure.main
01:28tomjack:)
01:29cflemingjustin_smith: Just poke the bytes in, man
01:29justin_smithI am gonna make ed.clj
01:29cflemingJaood: Yes, I am
01:29justin_smithso you don't need to leave the repl
01:30tomjackcfleming: huh, do you make cursive? if so, thank you :)
01:30cflemingtomjack: I do indeed - you're welcome!
01:31Jaoodcfleming: does cursive supports connecting to a remote repl?
01:31cflemingJaood: Yep
01:32cflemingJaood: https://cursiveclojure.com/userguide/repl.html
01:32tomjackdo you get locals printed inline in the code with 14?
01:32cflemingtomjack: Sadly, no, although I'm working on the debugger right now. Expression eval finally works, though, which is awesome.
01:32tomjackI just upgraded to 14 and installed cursive, but don't have it set up (working on a java project with .edn)
01:33cflemingtomjack: At least with Clojure, you do with Java obviously
01:33tomjackright
01:33Jaoodcfleming: nice, are going to support boot or wait for the hype to settle and see if it catchs on?
01:33cflemingtomjack: Unfortunately to do that in Clojure means macroexpanding everything
01:34cflemingJaood: I'm definitely planning support, hopefully soon - I'd like to use it to build Cursive itself.
01:34tomjackI'll make a quixotic attempt to have a few or more buyers lined up when it's for sale
01:34tomjackah
01:34cflemingtomjack: That sounds like a fine objective to me :)
01:34tomjackI haven't actually tried riddley yet, but my hope is that it makes that kind of thing feasible
01:35cflemingtomjack: Cursive's new macroexpander is actually a hacked around riddley
01:35tomjackhacked around, as in you hacked around it?
01:36cflemingtomjack: Whether or not I can get that inline painting working for debugging, I can definitely use it for LightTable-style inline REPL eval
01:36cflemingtomjack: Yeah https://github.com/cursiveclojure/riddley/blob/master/src/cursive/riddley.clj#L182-L249
01:37cflemingtomjack: The Cursive macroexpander is actually pretty nice now - you can expand interactively but it still properly respects &env
01:38tomjackI didn't know there was a macroexpander. cool
01:38jonathanjis there a more idiomatic way of writing: (or (:a {:a nil}) 42)
01:38cflemingtomjack: It's new as of a couple of weeks ago
01:38Jaoodcfleming: do you know if Hickey has tried cursive? :)
01:38cflemingtomjack: No doc yet, sadly, but should hopefully be fairly intuitive
01:38justin_smithjonathanj: not if {:a nil} is an expected possible value
01:39tomjackjonathanj: no
01:39justin_smithotherwise there is (:a {:b 1} 42)
01:39cflemingJaood: Yeah, he's slowly moving over to it
01:39cflemingJaood: Once I have a non-nREPL REPL he'll be on it full time
01:39tomjackhah
01:40cflemingJaood: Stuart Halloway is using it too
01:40tomjackwhat are some reasons someone might want a non-nREPL REPL?
01:40Jaoodcfleming: that's pretty awesome
01:41cflemingtomjack: https://gist.github.com/levand/b1012bb7bdb5fcc6486f
01:41cfleming(Luke Vanderhart also uses Cursive, and is bugging me for a non-nREPL REPL)
01:41cflemingtomjack: Reduced complexity, basically - middleware is a bit of a nightmare
01:43tomjacknow that I think about it, a lot of stuff about cider drives me nuts
01:44tomjacke.g. error buffers as in the gist
01:46cflemingtomjack: https://gist.github.com/cursiveclojure/593ee7421e765d1b0dba (from the 0.1.44 release email)
01:46Jaoodcfleming: why did you support nrepl first instead of just clojure.repl? or you building some repl from scratch?
01:53cflemingJaood: actually, initially I had a clojure.repl REPL, but then I migrated to nREPL because basically everyone uses it, and it's easier to develop against.
01:53Jaoodyeah, I can see how its easier for IDE integration
01:57cflemingNo doubt
01:57cflemingStill, a surprising number of people don't like the complexity and are moving back
01:59krat0sprakharcfleming: how can i see inline doc and source
01:59krat0sprakharin cursive?
02:00cflemingkrat0sprakhar: https://cursiveclojure.com/userguide/documentation.html
02:01JustinusIIIkrat0sprakhar: If you have used IntelliJ, Ctrl + Alt + A will do the magic for all actions
02:02krat0sprakharyou mean cmd + shift + A?
02:02krat0sprakharthanks cfleming
02:02JustinusIIIyes, shift
02:02cflemingkrat0sprakhar: On OSX, yeah
02:03tomjackhmm, macroexpansion doesn't seem to work for me
02:04tomjackbut, I'm still using emacs for clojure. I'll check it out more another day
02:04cflemingtomjack: You need a REPL running, and you need the current namespace loaded into the REPL
02:05tomjackyes, got that
02:05cflemingtomjack: Do you get an error or something?
02:06tomjackhttps://www.refheap.com/657f9d68355dc3c0d0f024fa8
02:06tomjackthat was when I tried inside the ns's file
02:07tomjackI don't seem to get an error when trying inside the repl prompt
02:07cflemingtomjack: Interesting, thanks - I saw that once or twice but thought I had fixed it.
02:07cflemingI think you'll have to do it from the ns's file
02:07cflemingAnd you have the editor focused when doing this?
02:08cflemingWhich platform are you on?
02:08tomjackah
02:08tomjackwhen I used the menu bar, it worked
02:08cflemingtomjack: Weird
02:08tomjackbut with, uh, that command which lets you type whatever, I got the error
02:08tomjackI'm on ubuntu using xmonad
02:08tomjackwhich does make intellij generally unhappy
02:09cflemingtomjack: Interesting, I wonder if in that case the command popup still has the focus - I should be able to reproduce that, thanks.
02:09cflemingtomjack: Normally you'd have that bound to a key and run it from within the editor - that should work, as will the menu
02:10cflemingtomjack: I'm planning to highlight the form you just expanded too, since it can be a little confusing to see what happened
02:11tomjackhmm
02:12tomjackthis is when I try to step forward https://www.refheap.com/aaa4a8bc0c1ab0cbe67da84a8
02:12tomjackyeah, bound a key
02:13tomjackhmm, but only on my macro
02:13cflemingtomjack: Hmm, do you have the caret within the macro form, or after it?
02:14tomjackalso, https://www.refheap.com/2161643929b2c26a5ce4701fb
02:14tomjack("error during macroexpansion")
02:14tomjacknot sure if that's you or me, but my form works when eval'd
02:14tomjacks/during/performing/
02:15cflemingtomjack: Oh, it'll be me - not sure what's going on there, though
02:15tomjack(the form expands to a keyword)
02:15cflemingCan you check the log (Help->Show log in <whatever it is on Linux>) and paste the full stacktrace?
02:15cflemingtomjack: Ah, interesting - I didn't know you could do that.
02:16cflemingtomjack: That'll be the problem, then - the expander adds metadata to all the forms it expands so I know what it did.
02:17cfleming,(do (defmacro x [] :test) (x))
02:17clojurebot:test
02:17cflemingOk, I'll fix that
02:17tomjackcan do, lemme try to figure out where to start
02:17tomjackdo I need to worry about sensitive content in the logs? :/
02:18cflemingtomjack: No worries, I can reproduce now that I know the macro expands to a keyword - that's definitely the problem.
02:18tomjackI haven't gotten it to expand my macro yet, even when it doesn't expand to a keyword
02:18cflemingCan you expand a defn or something like that?
02:18tomjackone thing is that sometimes the forms I pass to my macro contain non-standard usages of ~
02:18tomjackyeah, core stuff has worked
02:18tomjack(and it's really cool, btw)
02:19cflemingThanks - I think it'll be good once the kinks are worked out
02:19cflemingI'd expected more feedback on it, but I haven't heard anything
02:19cflemingSo this is really helpful, thanks
02:20cflemingSo on your macro, you always get that NPE?
02:21tomjacksegment of idea.log https://www.refheap.com/6734006ed9455289a5819d595
02:21cflemingActually, looking at the code, I have a few places where I assume that the expansion is a list
02:21tomjackah
02:21tomjackfor me it's always either a keyword or a vector
02:21tomjackkeyword threw the metadata problem, vector seems to do nothing I guess
02:21cflemingtomjack: That would explain it - I'll fix that for the next build
02:22tomjacknice, luckily I picked a strange macro :)
02:22tomjack(or unluckily)
02:22cflemingHeh, no doubt
02:23cflemingYeah, this was actually really hard to do well. It's amazingly tricky to correctly correlate elements in the editor with elements in the expansion
02:23cflemingAll those NPEs I see in your log will be the non-list problem, I think
02:24cflemingTwo different incarnations of it
02:29cflemingtomjack: Ok, I think I can fix that reasonably easily - hopefully I'll get that fix in the next drop. Thanks for all the help!
02:29tomjackrandom feature request: tidy qualified keywords. sorry, now I'll stop.
02:29tomjackbut relatedly, I once made a patch to EdnReader which provided a way to configure substitutions for keyword namespaces while reading
02:30tomjackmy eventual tentative conclusion was that the problem of bearable well-qualified Named things should be solved by the tools, not the reader
02:32tomjack'namespace folding' I guess
02:35cflemingtomjack: Yeah, that should be easy - I already do it for symbols
02:36cflemingtomjack: Cursive already automatically shortens keywords in the actual editor when completing, renaming and so forth
02:38cflemingtomjack: And don't stop, feature requests are always good
02:38tomjackhmm, I just want it in edn as well
02:38cflemingHow would that work?
02:38tomjackunclear :)
02:38tomjackwould need some config I guess
02:39cflemingI mean, how can you have macros in EDN?
02:39tomjackI mean, I want to use well-qualified keywords (and reader literals, maybe symbols) in .edn files
02:39tomjackbut not have my eyes bleed
02:40tomjacknot sure how to make that happen, but I vaguely suspect it should be in the editor
02:40cflemingtomjack: Ah, sorry, I thought we were still talking about macros - I see. I can easily code-fold them in Cursive.
02:41cflemingBut I'd have to know which prefixes to fold.
02:41tomjackI hadn't realized qualified keywords complete in .clj, though, that is pretty sweet
02:41tomjackyeah
02:42cflemingYou can find usages on keywords, too - try Ctrl-Alt-F7 on a keyword
02:43cflemingThat finds usages of the keyword anywhere in your project, and also local bindings destructured from then using :keys
02:44cflemingYou can rename keywords too, which will also rename destructured bindings
02:45cflemingSo for EDN, would you want to configure the prefixes per file, or per project?
02:45tomjackyeah, I dunno
02:45tomjackit's tricky
02:45cflemingI could automatically take them from prefixes you've used in code, as long as they're consistent
02:45tomjackshould the config go in the editor too? or might we adopt a convention which describes aliases in the edn itself?
02:46cflemingSure, if there's a convention I can use it.
02:46cflemingOne gotcha with code folding is that it will mess up your formatting in some cases
02:46cflemingSince formatting doesn't take the foldings into account
02:46tomjack(describing aliases in the edn seems tricky because edn (rough Rich quote) "has object-at-a-time, not document, semantics")
02:47cflemingWell, have a think about how you'd like it to work and let me know, it seems like a generally useful feature
02:48tomjackit's been a recurring thought for quite some time, unlikely to find a satisfying answer
02:49tomjack(the feature request was just keywords inside macroexpansion, which seems more straightforward design-wise)
02:50cflemingYeah, that one's trivial
02:53tomjackI guess the most satisfying answer right now is "put your edn in .clj files"
02:53tomjack..and then you're stuck with data_readers.clj. humm
02:54cflemingYeah, and Cursive will try to interpret your EDN as code, which will drive you bonkers
02:55cflemingBut I'm assuming that per-file, you would want a consistent mapping of namespaces to prefixes, right?
02:55tomjack(well, it would sortof be code, I mean like this: https://github.com/Datomic/codeq/blob/master/src/datomic/codeq/core.clj#L22 )
02:57cflemingSo there, you'd want e.g. :db.cardinality/one displayed as ::card/one?
02:58tomjackwell, I don't know even that
02:59cflemingThat makes fulfilling your desires a little tricky :)
03:00cflemingIt's tough, I actually have a similar problem at the moment - I need to get some declarations from code out into EDN
03:00tomjackyes, I meant to stick a paragraph break between cursive and "how to use reverse-DNS without going insane"
03:02cflemingAnd currently it's fairly eye-bleeding. I'm considering having an :impl-ns some.long.ns and :aliases [[some.other.ns :as ns1] [yet.another.ns :as ns2]], and then interpreting that myself after reading the EDN in
03:02tomjackthen what goes in the EDN with that out-of-band bit in place?
03:03tomjack:ns2/foo
03:03tomjack?
03:03cflemingYeah - they're symbols in my case, so foo -> some.long.ns/foo and ns1/bar -> some.other.ns/bar
03:04tomjackthe only problem I have with that approach (besides the cost of walking the data an extra time, which probably won't often matter) is that it won't necessarily work inside arbitrary reader literals
03:04tomjackbut then I'm not even really sure if that's a problem
03:05tomjackmotivating examples include datomic's db/id and db/fn
03:05cflemingYeah, fortunately in my case the data is a) broken up into small bits, so I'll just read the whole file in and work on it in memory, and b) is reasonably simple, i.e. I have no need of reader literals
03:07cflemingThis is a mini-IoC container for Cursive extensions
03:09tomjackextensions as in user supplied clj code?
03:12cflemingYeah
03:12tomjackI was wondering about that today, glad to hear it's planned
03:13cflemingI'm gradually working towards that, at first so that users can support symbol resolution for macros in libs they develop or use, and then later for more things
03:13tomjackhuh
03:13tomjackI have been wondering how I to approach a dev env for a toy language
03:14tomjacksomeday, maybe, as editor extensions, with the toy language code directly in the clj
03:16cflemingI actually have users who are interested in adding support to Cursive for internal DSLs, so that they can then ship Cursive to their users to edit the DSL
03:16cflemingFor financial modelling
03:16tomjackI'd also wondered if someday I may be able to spawn custom repls, in the same spirit as cljs stuff
03:16tomjackah, interesting
03:17cflemingCustom REPLs is trickier, I'm actually about to abstract my REPL code to support more REPL types, not sure if/when I'd expose that to users though
03:17tomjackI know a financial modeller who'd be very interested to hear that
03:17tomjackthough they use emacs
03:17cflemingSomething like Pixie would be a good usecase for it though
03:18Mr0rris0why
03:18tomjackhadn't seen pixie
03:18cflemingtomjack: Get him to drop me a mail if he's interested
03:19cflemingPlenty of people have come over to Cursive from Emacs, although a lot of people still use both I think, depending on what they're doing
03:20tomjack"hint to the JIT that certain values are constants, that certain functions are pure, etc. This can all be done from inside RPython..."
03:21Mr0rris0someday im gonna understand all of this i swear to god almighty
03:21tomjackwhy should we have to hint? pixie + purity seems interesting
03:23cflemingtomjack: IIRC there's a monad-style effects control system being considered
03:24tomjackinspired by eclj?
03:24tomjack(which I really hope there will be a talk about)
03:25tomjack(because I don't understand it at all)
03:26cflemingYeah, I haven't spent the time trying to understand that yet
03:27tomjackI wish the link wasn't to oleg, I never understand oleg
03:29cflemingYeah, there's no-one like him to make you feel dumb
03:41blockzombieI'm trying to use zippers with xml. using clojure.xml and clojure.zip seems to work but I thought I could make nice path query style forms... is this an external lib? clojure.data.xml ?
03:41blockzombie(-> z zip/right zip/right zip/node) etc. works well
03:42blockzombiebut I want (-> z :tagname :tagname ...)
08:16imancif I add (:gen-class) to an (ns) and an associated :main myproj.core in the project.clj I get: $ lein run
08:16imancException in thread "main" java.lang.RuntimeException: No such var: clojure.core
08:16imancany ideas why?
08:18imancoh wow, newb error!
08:22sashton_is there a way to find out how many items are in an async chan? I'm trying to add some monitoring to my app, and would like to know the progress of some work.
08:22sashton_or is there a better way?
08:45luxbockI'd like to be able to evaluate local bindings in my editor inside a let-form when I code
08:47luxbockso my plan is to create a function that takes a quoted Clojure let-form as its argument, extracts the bindings, runs it through clojure.core/destructuring, and then separate the gensym'd locals from the local bindings I'm after
08:51luxbockthen eval the gensym'd symbol->value pairs, and replace each occurance of a gensym'd symbols inside the local-bindings of the destructuring result
08:53luxbockactually I'm not sure if this makes a lot of sense to even myself yet
09:04Mr0rris0sounds interesting lux
09:04Mr0rris0your ahead of me atleast, im not sure what any of that is yet
09:04hellofunkluxbock: i don't think you can count the number of pending items on a channel, but you could of course update a count every time your put! and decrement the count every time you take!
09:05luxbockhellofunk: hmm? I'm not using channels/core.async at all
09:05hellofunkluxbock: i'm sorry i meant that reply for sashton_
09:05justin_smithsashton_: not unless you make your own custom chan impl
09:05luxbockah
09:06luxbockI want to be able to do two things actually
09:06justin_smithsashton_: that is, you would need a custom chan impl for querying the count of the chan
09:07luxbocktake a let-form, and simplify so that all the value-side of the expressions are evaluated, and return that
09:07luxbockso that I can do that inside my editor to see what each local-binding is evaluating to
09:07hellofunkluxbock: what editor are you using?
09:07luxbockEmacs
09:08hellofunkluxbock: doesn't the emacs tool for evalue the form at point do what you need? it's a part of cider, but of course you'd have to be using cider to use it
09:08luxbocksending code from Emacs to Clojure and back is easy enough with cider
09:08hellofunk*evaluate
09:09luxbockhellofunk: that would get me the evaluation result for the body of the let-form
09:09justin_smithhellofunk: there's form at point, but not for getting an arbitrary value of a local
09:10hellofunkhm, i'm confused. can't you evaluate any form, not just a top-level let, but anything with cider? i think i can. I can type (let [x (+ 1 1)]..) and just see the evaluation of 1 + 1 if I want
09:11justin_smithhellofunk: in (let [a 0 b (inc a) c (+ b b)]) can you get the value of c?
09:11hellofunki was just thinking that after i typed it. i haven't tried. perhaps i should this moment
09:12luxbockI'm toying around with ideas for trying to reduce the REPL-based feedback loop of writing code -> seeing results even further
09:14luxbockI already have a function that expands a function-call with the body of the function getting called, which I find amazingly useful when you can use that in-place in my editor
09:14hellofunki see what you are after now and no you can't do what justin_smith proposed with cider. interestingly, this seems like a frightening feature: Invoke clojure.walk/macroexpand-all on the form at point and display the result in a macroexpansion buffer.
09:15luxbockI think if I can combine this with the let-related stuff I was talking about then it'd be incredibly powerful
09:15hellofunklol when i first read that i thought it said display the macroexpand-all in the mini-buffer! lol
09:15lodinluxbock: I've been sketching on the same thing.
09:15hellofunkthat would be one heck of a mini buffer output
09:15luxbocklodin: cool, do you have anything out there yet?
09:15hellofunkluxbock: what you describe sounds like how the light table tools work
09:15lodinluxbock: Nope.
09:16luxbockhellofunk: I think expanding in-place is much better since then you can manipulate that code even further
09:16luxbockhellofunk: with these ideas my work flow is transitioning from the REPL to the *cider-scratch* buffer
09:17hellofunkluxbock: i've never seen a cider-scratch buffer before
09:18luxbockI end up with tons of code in there, which helps me think about the problem further
09:18luxbockthe Clojure compiler in my head is not strong enough where I could just lie in my hammock and solve problems like Rich Hickey :)
09:19luxbock*cider-scratch* is basically just a dummy Clojure-buffer that evaluates to the currently active ns
09:19luxbockit has some extra features as well but I don't use those much, so it's much the same as just creating your own dummy-buffer
09:21Glenjaminhas anyone used https://github.com/chlorinejs/chlorine ?
09:24sashton_hellofunk: yeah, a thought i had was to inc and dec an agent if there wasn't a built-in way to get the pending count
09:24hellofunkluxbock: i'm pretty sure the hammock idea is about having NO compiler in front of you, and no computer for that matter
09:25hellofunkif you are properly practising the Hammock, then to others you should appear to be asleep, in Rich's words.
09:27hellofunkman i think i'm asleep, talking about sleep. luxbock just saw your clause "in my head"
09:41matt`I'm trying to do a running total, but it doesn't seem to be totalling :D Can anyone spot my doofus mistake? http://pastebin.com/BPB6U3T2
09:42justin_smithmatt`: dotimes is calculating things that do not change total
09:42justin_smith(+ total x) does not increase total
09:42justin_smithit just calculates an addition (that dotimes then throws away)
09:42matt`Bugger
09:43justin_smithmatt`: I think you want (apply + (repeatedly number-of-rolls #(die-roll sides)))
09:43justin_smiththat does some number of die rolls, and adds them all up
09:43matt`:-O
09:44matt`Wow thanks, I'm off to look up 'repeatedly' too, I came across that on clojuredocs but it didn't seem appropriate
09:45matt`Thanks again for your help
09:45justin_smithnp
09:47matt`That worked btw justin_smith
09:48justin_smithoh, good
09:52Glenjaminanyone got a favourite hickey talk which isn't on this list? http://thechangelog.com/rich-hickeys-greatest-hits/
09:58matt`Is a # in front of a function a way to access the object instad of the returned value that the object would produce?
10:00fairuzmatt`: do you mean something like #(...) ?
10:01matt`yes, that's right
10:01justin_smithmatt`: #() is a shortcut for fn
10:01fairuzit's the same thing as (fn [args] ...)
10:01justin_smith,'#(+ % %)
10:01clojurebot(fn* [p1__25#] (+ p1__25# p1__25#))
10:01lodinmatt: #(...) is a function, it's sugar for (fn [] ...) in this case.
10:02matt`that's great, thanks, just trying to get my head around it
10:02justin_smithmatt`: do you know how (fn [] ...) is used?
10:03lodinmatt: You could also write (map die-roll (repeat sides)) to get an infinite list of die-rolls. Then you use (take) to get the number of rolls you want.
10:03matt`justin_smith: It's an anonymous (lambda) function right?
10:04justin_smithyes
10:04justin_smithlike defn but without creating a global definition
10:04matt`I take it an infinite amount of rolls like that wouldn't run the function infinitely?
10:04justin_smithmatt`: no, because of laziness
10:05matt`I've heard that term quite a few times now - it's lazy because it doesn't acutally do it until it's required?
10:05justin_smith,(apply + (take 3 (map #(inc (rand-int %)) (repeat 6))))
10:05clojurebot10
10:05justin_smith,(apply + (map #(inc (rand-int %)) (repeat 3 6))))
10:05clojurebot8
10:06lodin,(take 3 (repeat 6))
10:06clojurebot(6 6 6)
10:06lodinOops.
10:06lodin:-)
10:06justin_smith,(repeat 3 6)
10:06clojurebot(6 6 6)
10:06lodinjustin_smith: Just showing the concept.
10:06justin_smith,(apply + (repeatedly 3 #(inc (rand-int 6))))
10:06clojurebot8
10:06justin_smithright
10:07justin_smithwow, terrible rolls!
10:07justin_smiththis would be like the worst d&d character ever
10:07matt`I'm having a little trouble tbh, I come from C - I can see the awesome power of functional programming but it's pretty alien to me
10:07justin_smith,(reduce + (repeatedly 3 #(inc (rand-int 6))))
10:07clojurebot13
10:07matt`Lol! That's what this is for
10:07matt`Kinda
10:07matt`I'm writing some functions to help me run a dungeonworld game
10:08justin_smithhere's 4d6, drop the lowest:
10:08justin_smith,(reduce + (rest (sort (repeatedly 3 #(inc (rand-int 6))))))
10:08clojurebot9
10:08justin_smithoh wait
10:08matt`I did one of those in lisp, I'll post my code
10:08justin_smith,(reduce + (rest (sort (repeatedly 4 #(inc (rand-int 6))))))
10:08clojurebot13
10:09matt`(defun stat ()
10:09matt` ;; Generate 4 d6 results, discard the lowest
10:09matt` (apply #'+ (rest (sort (list (d 6) (d 6) (d 6) (d 6)) #'<))))
10:09lodinmatt: Use let binding generously and it becomes easier to grasp.
10:09matt`Tnx lodin
10:09justin_smithmatt`: that is like literally the code for the last thing I printed
10:09justin_smithif d is inc rand-int
10:10matt`Hah, maybe I am getting functional programming after all :)
10:10justin_smithmatt`: the only real difference is that you literally spell out every call to d, and I use repeatedly to specify how many times it is done
10:12matt`I'm going through your code examples, Clojure can be elegant
10:13lodinmatt: Also, as soon as possible, understand how to use (-> ...) and (->> ...).
10:16justin_smith,(->> #(inc (rand-int 6)) (repeatedly 4) rest (apply +))
10:16clojurebot8
10:17lodinIt's nicer when it's aligned vertically. :-)
10:18matt`lodin: I've been looking at ->, isn't it just for readability?
10:18justin_smithmatt`: -> / ->> make some code much clearer, yes
10:18lodinmatt: Sure.
10:18justin_smithand make certain errors much less likely
10:19lodinmatt: But it's a good alternative to using let bindings where you just repeat the name on the next line.
10:19matt`Right. Gotcha.
10:19matt`Much tidier
10:21lodinI particularly like (-> ...) over nesting the functions since the name and the rest of the arguments don't get spread apart (in contrast to (->> ...)).
10:22justin_smithlodin: ->> works with collection functions, -> works for functions on associatives
10:22matt`I've heard nesting functions is frowned upon, I can see why.
10:26lodinjustin_smith: -> would be more useful with reduce if three argument reduce took the initial value first. Coincidentally, usually have a reduce' that does just that. :-)
10:26justin_smithlodin: it's intentional that functions on collections all take the collection as the last arg
10:27lodinjustin_smith: reduce works well with ->>, but not ->. I'm only talking about the initial value (which sometimes is associative).
10:31Glenjaminreduce is fairly low level, if i was doing a reduce within a threading form i think i'd extract into a named function
10:37lodinGlenjamin: The same would probably apply for map.
10:37Glenjaminmap is generally a bit higher level than reduce
10:37Glenjaminit depends what you're doing i guess
10:37Glenjamin(reduce +) is pretty straightforward
10:38lodinGlenjamin: Yeah. In my use cases it's more like map. I have a set of stuff I want to reduce into another object through a function, and you'd just end up creating plural versions of the function.
10:38lodinLike map would be move into a plural version.
10:39Glenjamini'm not sure what you mean by that
10:48lodinGlenjamin: If you have (-> x (foo a) (foo b) (foo c)) you can rewrite that into a reduce, (reduce foo x [a b c]).
10:48Glenjaminthe threading form is much clearer there imo
10:49lodinGlenjamin: except something you can't use the threading form, because you really have (let [ys ...] (reduce foo x ys))
10:50lodinAnd want you also had initially was a threading form doing other stuff to x, and want to get the reduce in there.
10:51lodins/want/what/
10:52lodinSo now you either create a foo-all function so you can have that in your threading form, or write (#(reduce foo % ys)).
10:53lodinBut that second option is not good if you happened to have a #() form where foo is.
10:53lodinSo you might rewrite using partial is possible, or spell out the fn form.
10:54lodinOr you use your own reduce' which takes the initial value first, and you're done. :-)
10:54Glenjamincan you give a concrete example? i'm still not really following
10:55lodins/is poss/if poss/
10:56lodinGlenjamin. OK, hold on.
10:56Glenjaminthanks
11:15crack_userhello guys
11:15arav93Has the android app for clojure repl been updated?
11:16crack_userI am looking at reagent and I constantly see this code "(-> % .-target .-value)" in :on-field, but I don't find in any place what does it means
11:17crack_usersomeone can explain or show where is it in documentation?
11:17clojurebotHuh?
11:18crack_userfor example " :on-change #(reset! value (-> % .-target .-value))"
11:19lodinGlenjamin: http://pastebin.com/yhFK5Lyf
11:20Glenjamincrack_user: http://clojuredocs.org/clojure.core/-%3E
11:20Glenjaminthat bit of code is roughly equivalent to "e.target.value" in javascript
11:21crack_userhumm, I already know about the threads functions, my doubts is more about the .- and % syntax
11:22TMAcrack_user: #(... % ...) is equivalent to (fn [%] (... % ...))
11:22lodincrack_user: % is the first argument in the function created by #(...).
11:23crack_userI get it
11:24lodinGlenjamin: Does that example make it clearer?
11:24Glenjaminlodin: yes, it does
11:24Glenjamini'd probably say define (defn add-edges [g es] (reduce #(apply dep/depend %1 %2) g es)) because `add-edge` isn't actually that useful
11:26Glenjaminalthough i'm not sure the threaded version is worth using at all
11:26lodinGlenjamin: I knew you would say that, so assume that there's more going on in the thread.
11:26Glenjaminunless you're combining the top version with the bottom version
11:26lodin:-)
11:26Glenjaminyeah, i guessed there might be
11:26lodinGlenjamin: For instance, first you might want to remove some edges.
11:26Glenjaminbut yeah, add-edge doesn't seem bit enough to extract
11:27Glenjamin*big enough
11:27Glenjaminbut add-edges (with the reduce inside) is
11:27clojurebotExcuse me?
11:27lodinGlenjamin: I just added it because it get's tiresome to write apply all the time.
11:27Glenjaminright, but you're only using apply because you have a pair
11:27Glenjaminand you only have a pair because you have a list of pairs
11:27Glenjaminif you only had one, you'd just use dep/depend
11:27lodinGlenjamin: So assume that the API had add-edge, or that depend takes a pair.
11:29lodinBut you see, the reduce form is very similar to a map form.
11:29Glenjaminright, but reduce is more of a black box
11:30Glenjaminyou know what's going on with a map, a reduce could do anything - which i think is why i find it a bit "weird" in a thread like that
11:30Glenjamini dunno, might just be me
11:36imancis there a decent step through debugger for clojure? (I'm using vim)
11:36profilDoes it exist a lisp which is similiar to clojure but is compiled to machine code just like common lisp?
11:52profilor is it possible to compile clojure so that it is not dynamic?
12:06r4viprofil: pixie is the clojure inspired lisp that compiles to native code
12:08r4viwell kind of; it generates it's own native vm
12:14profilr4vi: ah, nice.. To bad its not entirely native. I was looking for something to write small apps like a window manager without having to touch common lisp or scheme
12:15r4viah so you want a no deps clojure
12:15r4viI seem to remember something that cross compiled clojure -> scheme -> native
12:16r4viprofil: not sure how mature but here it is https://github.com/takeoutweight/clojure-scheme
12:17profilI guess I could learn scheme, I like the minimalism, but I have read that its hard to write portable scheme programs..
12:27imanc,(apply (fn [x & more] (prn x more)) [1 2 3 4 5])
12:27clojurebot1 (2 3 4 5)\n
12:28imancwhy??
12:28imancwhy is rest passed back into the fn?
12:29imancand given it does that, how does (apply str [1 2 3 4 5]) work?
12:30Glenjamin(apply str [1 2 3]) === (str 1 2 3)
12:31Graawrimatigerhi ! I'm a little baffled: how come (flatten (vector <list of maps>) is almost instant, while (flatten <list of maps>) seems linear ? Both yield same result, it seems
12:31imancoh man
12:31imancn00b mistakes
12:31profil,((fn [x & more] (prn x more)) 1 2 3 4 5)
12:31clojurebot1 (2 3 4 5)\n
12:31profilimanc: ^
12:32GlenjaminGraawrimatiger: how are you measuring them?
12:32Glenjaminalso
12:32Glenjamin~flatten
12:32clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
12:32imancOK, this now makes perfect sense .. thanks!
12:34GraawrimatigerGlenjamin: I measure them with the built-in "time" function. Also, (mapcat identity) or (concat) instead of flatten both yield same results : "slow" if I use it directly on a list of maps, really quick if I apply `vector` first
12:35Glenjamin$source flatten
12:35Glenjaminbah
12:35Glenjaminwhere's lazybot :(
12:35profil,(source flatten)
12:35clojurebotSource not found\n
12:35profil:(
12:37Glenjamini can't see any obvious reason for that in the source Graawrimatiger, maybe try using criterium (a more detailed benchmarking tool) to compare them
12:38Glenjaminflatten seems to use tree-seq, which just uses lazy-seq and mapcat
12:38Graawrimatigerhum
12:39Graawrimatigermaybe it has something to do with lists being linked-lists while vectors are arrays ?
12:39Glenjaminthat shouldn't really make much of a difference for a straightforward linear walk like that
12:39Graawrimatigerha
12:43Graawrimatigerall in all, I'm not missing some hidden trap there, right ? Vector will maintain the order of the list if i'm correct, so both results should always be identical ?
12:43Glenjaminwell, lists can be lazy
12:43Glenjaminor, more accurately, vectors can only be eager
12:43GraawrimatigerI'm not using laziness here
12:45Glenjamincan you post some code samples?
12:46Graawrimatigerjust re-tried something, seems I was mistaken : mapcat identity doesn't flatten the list inside the vector (it only removes the vector, which seems logical) ; if I want the same results, I have to use flatten on the vector
12:48Graawrimatiger(i'm uploading some code samples)
12:53GraawrimatigerGlenjamin: here is the original map I use for the tests (some instaparse AST in enlive format) : http://pastebin.com/E5d5Q72q
12:54Glenjaminit's possible that some part of the procedure is doing lazy work at a different point, maybe try using the profiler to find out if it's important to you
12:55csd_`In the context of accumArray, what would the symbolic representation of the accumulation function (\/), where this represents an upside down carrot, mean?
12:56csd_`caret
12:57GraawrimatigerO_o i don't get it : if I store this list in a var, for exemple "mylist", (flatten mylist) and (flatten (vector mylist)) take the exact same time (really quick); if I do the same comparison while using the 'inline' result of the list (ie obtaining the result from function calls and flatten it directly from it), there is this big speed difference ><
12:57Graawrimatiger(well it's not really important, I was just a bit puzzled by this)
13:00lodinGraawrimatiger: How would a flattening for perform? (for [xs xss, x xs] x)
13:01justin_smithwhich is identical to nested mapcats btw
13:01Graawrimatigerlodin: sorry, I don't quite grasp how to flatten with for... ?
13:02lodinSorry, gotta go.
13:03justin_smith,(for [xs [{:a 0 :b 1 :c 2} {:d 3 :e 4}] x xs] x)
13:03clojurebot([:c 2] [:b 1] [:a 0] [:e 4] [:d 3])
13:03Graawrimatigeroh
13:03justin_smith,(for [xss [{:a 0 :b 1 :c 2} {:d 3 :e 4}] xs xss x xs] x)
13:03clojurebot(:c 2 :b 1 :a ...)
13:05Graawrimatigerit performs "quickly", not "badly linearly" (^^")
13:06justin_smithGraawrimatiger: were you consuming the individual results when benchmarking? because a vector would definitely be slower if not
13:06justin_smithcompared to something potentially lazy
13:07Graawrimatigerjustin_smith: I benchmarked while saving (time (def <name> (<several calls to get the original list I linked on pastebin>)))
13:09justin_smith,(def n (flatten (repeatedly range)))
13:09clojurebot#'sandbox/n
13:09justin_smithGraawrimatiger: n is infinite
13:09justin_smithGraawrimatiger: it wasn't evaluated at all
13:09justin_smithdoing the def did no work
13:10justin_smithso of course that is instant
13:10justin_smiththis is why one should use criterium for benchmarking, it makes these mistakes less likely
13:11Graawrimatiger_(sorry, disconnected)
13:11justin_smithGraawrimatiger: did you see the def of n?
13:11Graawrimatiger_(felt like I wasn't clear so (time (def x (flatten original_list))) ;=> 90msecs, and (time (def y (flatten (vector original_list)))) ;=> 0.38msecs ; at the end, (= x y) ;=> true
13:12justin_smith,(def n (map println (flatten (repeatedly range))))
13:12clojurebot#'sandbox/n
13:12justin_smithit returns instantly
13:12justin_smithnothing prints
13:12justin_smithno work was done
13:12justin_smithit should have printed a series of numbers up to the maximum possible integer, over and over
13:12justin_smith(if it had done anything)
13:12justin_smithtiming a def of a flatten is not a fair coparison
13:12justin_smith*comparison
13:13Graawrimatiger_oh
13:13justin_smithflatten is lazy
13:13justin_smithit doesn't calculate anything until you consume the output
13:13Glenjaminahah
13:14Graawrimatiger_but then again, after doing the defs above, (time x) and (time y) both take the same time (almost nothing). Wouldn't one of them be way longer if it needed to be realized ?
13:14justin_smithGraawrimatiger_: this is why you shouldn't use time to benchmark things btw, there is a lib called criterium that makes these mistakes less likely
13:14justin_smithGraawrimatiger_: (time x) does not force the result
13:14Graawrimatiger_oh
13:15justin_smithGraawrimatiger_: you need to consume the contents, or use something like "doall" or "dorun" on it
13:15Graawrimatiger_so all in all, there's no "magical way" to flatten a list of lists in O(1), I guess... ?
13:15justin_smithabsolutely not
13:15Graawrimatiger_:/
13:15whompso is let just a concise way of doing a bunch of defs?
13:15justin_smithyou have multiple lists, the lower bound is O(n) for the number of lists
13:16justin_smithwhomp: that was all that got tested, was creating the defs
13:16l3dxin compojure, is it possible to map just a subset of the routes with a given middleware?
13:16justin_smithl3dx: yes, a middleware is just a function that takes a handler and returns a new handler
13:16whompjustin_smith, ?
13:16justin_smithl3dx: use the middleware on the routes you want wrapped
13:17justin_smithwhomp: all that got timed was running def - the contents of hte things def'd were not forced, so at least in the case of a list input are not evaluated
13:17justin_smithwhomp: the laziness of flatten would mean that the work would get done later as the elements are accessed
13:18justin_smith(which was not timed)
13:18whompjustin_smith, so def is lazy, let is not?
13:18justin_smithwhomp: no, that's not what I am saying at all
13:18whomplol maybe i'll just read some more
13:18Graawrimatiger_justin_smith: okay; so if I have this structure ( a_list a_list a_list ...) from doing a map (of an instaparse parser function) on a list of strings, there's no way to optimize something in between to avoid the "long" flatten at the end ?
13:18justin_smithwhomp: if you do (time (def n (something lazy))) all you have timed is the amount of time it takes to run def
13:19whompjustin_smith, ok ty
13:19justin_smithGraawrimatiger_: mapcat the instaparse instead of map / flatten
13:19Glenjaminflatten/concat/mapcat are "optimised" in the sense that they are all lazy
13:19Graawrimatiger_justin_smith: hum, whomp asked you something else entirely; I think your last answers were for me... ?
13:19justin_smithGraawrimatiger_: no
13:19Graawrimatiger_oh, nevermind so ^^"
13:19justin_smithGraawrimatiger_: except the one I directed at you
13:20hellofunkl3dx: one easy way to group those routes you want effected into a single defroutes, then use the middleware on that group. you can combine this resulting handler with other route groups you've defined w/o middleware into one big handler.
13:20justin_smith(inc hellofunk)
13:20justin_smiththat's a much better way of saying what I was trying to say
13:20l3dxcool. thanks! I'll give it a try :)
13:21hellofunkl3dx: here's an example: https://github.com/hellofunk/hellofunk-lein-template/blob/master/resources/leiningen/new/hellofunk/src/h/examples.clj
13:22Graawrimatiger_justin_smith: oh well, mapcating the instaparse yields the desired result in only one step, thanks ! it's also linear time (time (mapcat...), no defs) so I guess that's the best I can get like you said
13:22Graawrimatiger_thanks a lot :)
13:22justin_smithGraawrimatiger_: (time (mapcat ...)) does not force the laziness either!
13:23justin_smithyou need to consume the result, or no work is done
13:23justin_smiththe easy way is doall / dorun
13:23justin_smith(time (dorun (mapcat ...)))
13:23Glenjaminalthough note that neither recurse deeply
13:23justin_smith(time (mapcat f coll)) won't even call f once
13:24Graawrimatiger_justin_smith: hm (time (dorun (mapcat ...))) and (time (mapcat ...)) both take the same time
13:24justin_smithGraawrimatiger_: that's surprising
13:24justin_smithmaybe I am wrong in this case...
13:24Glenjaminhow many items are in this list?
13:24justin_smith,(time (range))
13:24justin_smithd'oh
13:25clojurebot"Elapsed time: 0.047057 msecs"\n(0 1 2 3 4 ...)
13:25justin_smithAHA!
13:25Glenjaminaha?
13:25justin_smithyeah, that call to (range) was "infinite"
13:25Glenjamin,(doc time)
13:25clojurebot"([expr]); Evaluates expr and prints the time it took. Returns the value of expr."
13:25Graawrimatiger_justin_smith: I'm using the 'lein-ultra' plugin to run a repl, which changes a lot of things (only visual though), could it be that one feature is interfering here ?
13:25justin_smithGlenjamin: so if you don't consume the result inside the time form, you don't force any laziness
13:25Glenjaminyeah
13:26justin_smithGraawrimatiger_: no
13:26justin_smithGraawrimatiger_: you can't accurately calculate the time a lazy thing took without explicitly consuming its results (recursively if it has nested laziness)
13:26justin_smithflatten and mapcat are both lazy
13:27justin_smithcriterium is a benchmarking library that makes that mistake less likely though
13:27justin_smith(and gives much more accurate timing results)
13:27hellofunkjustin_smith: if using time at the REPL, i would think it would try to realize the whole sequence since REPL printouts are a form of consumption
13:28justin_smithhellofunk: unless you have print-length limited as clojurebot does, sure
13:28Graawrimatiger_oooh
13:29justin_smithhellofunk: also time will not end up timing the realization
13:29justin_smithhellofunk: because the forcing of the lazy result will happen after time returns the lazy object
13:29justin_smithhellofunk: so the whole thing gets realized, but your timing is fictional
13:29hellofunkoh intersting.
13:30hellofunkjustin_smith: here is a rather intersting tidbit i came across once, on the subject of time: https://gist.github.com/hellofunk/7d424d173125b5dc9640
13:30justin_smithhellofunk: just think about the order of execution: you time the generation of the lazy-seq (no work done), that lazy seq is returned, time calculates its result and prints it, your repl consumes and prints the lazy seq, and then *finally*, after the time is calculated, the seq is forced
13:31hellofunkjustin_smith: that makes sense
13:31Graawrimatiger_justin_smith: oh, that would explain the whole thing I guess
13:31Graawrimatiger_going to try criterion then
13:31justin_smith*criterium
13:32Graawrimatiger_woops
13:32Graawrimatiger_yeah, meant that x)
13:32justin_smithalso, as I mentioned before, doall or dorun would have helped too (and are still useful sometimes in criterium)
13:32Graawrimatiger_justin_smith: yeah but since I have the same results with or without doall/dorun, something is still missing
13:32imanc,(take 3 (repeat (/ (+ (rand-int 255) 255) 2))))
13:32clojurebot(147 147 147)
13:33imancI'm assuming that (repeat... is causing the output of rand-int to be repeated, rather than calling the evaluating the function on each iteratoin
13:34l3dxhellofunk: worked perfectly!
13:34Glenjamin,(doc repeatedly)
13:34clojurebot"([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"
13:35hellofunkl3dx: glad to hear it!
13:38imancahh repeatedly did it - thanks Glenjamin
13:39justin_smithGraawrimatiger_: so you did (time (dorun (mapcat f ...)))
13:39Graawrimatiger_justin_smith: yes
14:43justin_smith,(time (map #(*' % % % % % % %) (range)))
14:43clojurebot"Elapsed time: 0.148038 msecs"\n(0 1 128 2187 16384 ...)
14:43justin_smith,(time (doall (map #(*' % % % % % % %) (range))))
14:43clojureboteval service is offline
14:44justin_smith,(time (doall (map #(*' % % % % % % %) (range 100))))
14:44clojurebot"Elapsed time: 0.754953 msecs"\n(0 1 128 2187 16384 ...)
14:44tcrayford____justin_smith: reminder that in compiling that code, cleaxjure is writing a class file to disk, so it'd likely be faster in a real server
14:44justin_smithtcrayford____: I'm showing the difference in time taken
14:45justin_smithtcrayford____: related to the excange with Graawrimatiger_ above
14:45tcrayford____oh
15:03hellofunk,(doall (time (map #(*' % % % % % % %) (range 100))))
15:04clojurebot"Elapsed time: 0.103278 msecs"\n(0 1 128 2187 16384 ...)
15:06hellofunk,(time (doall (time (map #(*' % % % % % % %) (range 100)))))
15:06clojurebot"Elapsed time: 0.105691 msecs"\n"Elapsed time: 1.933527 msecs"\n(0 1 128 2187 16384 ...)
15:33whomphow is it that (take 5 (map identity (range)) doesn't go on forever?
15:34tcrayford____whomp: laziness
15:34whompah i see now, tcrayford____, ty
15:34tcrayford____whomp: did that completely answer it? I was writing a longer answer (that one was super glib)
15:35whompyeah cuz it reminded me of lazy seqs lol, i'm re-learning the language
15:35tcrayford____haha ok then :)
15:35tcrayford____happy I could help
15:44patrkrishi folks. I am trying to add customer encoders to cheshire, but do I need to do it in every namespace I use cheshire? can it be added globally somehow for my whole library?
15:44tcrayford____patrkris: adding an encoder is a global change
15:44tcrayford____so you can put them all in a namespace or something, and as long as that's required somewhere
15:44tcrayford____then you're good
15:44patrkristcrayford____: I believe I tried that, but let me just try again
15:45tcrayford____patrkris: for sure
15:48patrkristcrayford____: seems you were right. must've done something stupid before :) thanks
15:52tcrayford____patrkris: dope! Glad I could help out :)
15:52tcrayford____patrkris: I've been running like that in production for like, 2 years haha
15:56michaelr525hi
15:58dweaveAnyone have trouble getting stack trace not to show on every error in cider? It’s extremely useless
15:59dweaveonly seems to do so for some errors
16:01AeroNotixdweave: specific exceptions? Repeatable?
16:01AeroNotixWhich version of CIDER?
16:01AeroNotixalso, #clojure-emacs
16:01dweavedoesn’t seem repeatable trying to figure that out though.
16:01dweaveversion 0.8.2
16:02AeroNotixdweave: perhaps the exception buffer is getting hidden
16:02dweavei have this warning: WARNING: CIDER's version (0.8.2-snapshot) does not match cider-nrepl's version (0.8.1)
16:02tcrayford____dweave: check your JVM doesn't have -XX:+OmitStackTraceOnFastThrow as well
16:02dweaveAeroNotix: I want the error buffer to get hidden
16:03dweavetcrayford____ how do i check that
16:03AeroNotixdweave: I'm gonna say that you don't have the above setting
16:03AeroNotixunless you've put it there manually.
16:03dweavewhat setting AeroNotix
16:03dweaveI have this: (setq cider-show-error-buffer nil)
16:03AeroNotixdweave: what do you think that setting does? :)
16:04tcrayford____AeroNotix: that setting is on by default on the jvm ;)
16:04michaelr525will be starting a fresh new web app. thinking of starting with chestnut (figwheel, om, weasel, ring) and then adding system (component) and sente. anything else/instead you'd recommend?
16:04dweave“Configure whether the error buffer with stacktraces should be automatically shown on error:”
16:04AeroNotixtcrayford____: aha, ok then.
16:05tcrayford____AeroNotix: it only affects specific exceptions, and I don't think it's the problem here though
16:05AeroNotixright
16:05tcrayford____seems like #clojure-emacs kinda thing to me
16:05dweavei’m confused which setting are we talking about
16:06dweavei’ll try clojure-emacs thanks
16:13michaelr525will be starting a fresh new web app. thinking of starting with chestnut (figwheel, om, weasel, ring) and then adding system (component) and sente. anything else/instead you'd recommend?
16:15tcrayford____michaelr525: depends on what your app's doing really
16:16michaelr525oh and friend and liberator :)
16:17michaelr525tcrayford____: ui, crud, authentication, ElasticSearch as datastore
16:18tomjackI can't afford the modeline cost of #clojure-emacs :)
16:19tcrayford____michaelr525: I'm probably a bit more conservative than you here - I tend to only add libraries as I *need* them for things
16:20michaelr525tcrayford____: all web applications need this common base: ui, client-server communication, security, web services, data layer
16:20michaelr525on top of that you'd want good architecture and some development sugar, thus component, figwheel
16:21michaelr525tcrayford____: so this list is only the base stuff which 100% will be used
16:23tcrayford____michaelr525: yea. I tend to start with a much smaller set of things at the start (but then again my current app has ~80 direct dependencies)
16:25raspasovmichaelr525: ElasticSearch as datastore?
16:25michaelr525tcrayford____: xcactly :)
16:26tcrayford____echoing raspasov there, I don't trust elasticsearch as far as I can throw it
16:26michaelr525raspasov: the app will be around querying stuff from ES so we though of using it as the operational DB as well for app CRUD
16:27michaelr525don't trust it in what sense?
16:27raspasovonly put data in ES that you're 100% sure you're ok to completely lose
16:27tcrayford____^^
16:27tcrayford____it loses data
16:27michaelr525oh really
16:27michaelr525interesting
16:27raspasovhttps://aphyr.com/posts/317-call-me-maybe-elasticsearch
16:27raspasovread this
16:27michaelr525ok, thanks
16:27tcrayford____note that they've done a *lot* of work since that post
16:28tcrayford____but our ES cluster at work (which is only for logstash) still throws away it's data every few weeks (without us telling it to)
16:28raspasov^^ lol
16:29michaelr525heh
16:29michaelr525tcrayford____: are you on the latest version?
16:29raspasovyea I was running ES in prod on just two nodes, not good experience
16:29tcrayford____michaelr525: yeah, we were
16:29tcrayford____(I've been on vacation for 3 weeks, so things might have changed)
16:30raspasovmaybe another re-write happened since then? :D
16:30tcrayford____haha :(
16:31tcrayford____(https://github.com/elasticsearch/elasticsearch/issues/3145#issuecomment-27455667 is still open haha)
16:31raspasovmy advice is: use MySQL or PostgreSQL if your data is within a few TB, and use Riak or Dynamo if it's bigger than that, you can use ES to load data from those sources for searching
16:32raspasovbut never as a primary store of data
16:32tcrayford____raspasov: agree with that
16:32raspasovI made that mistake once and not doing it again lol
16:34raspasovsomeone needs to re-write ES in Clojure, it will prob be 10x less code and 10x less bugs lol
16:37michaelr525`hmm.. '
16:37michaelr525`have I missed anything?
16:38tcrayford____http://clojure-log.n01se.net/
16:38michaelr525`10x
16:56imancif a function relies on some global var that isn't passed in explicitly, is the function then impure / tainted?
16:56tcrayford____imanc: guess so, on some levels
16:56tcrayford____imanc: though like, if your function calls `map`, it's relying on a var ;)
16:57imancyeh
16:57tcrayford____generally if it calls another pure function, imo that's ok
16:57raspasovif that var is never modified, in a way, no (I guess lol)
16:57Bronsathe solution is easy
16:57tcrayford____raspasov: right, but if you reload it at the repl you've modified it ;)
16:57Bronsa(let [map map] (defn my-f [..] ..))
16:58raspasovwell but if you reload with the same value, you haven't? :)
16:58imanchm, i've been messing with quil and doing some animation stuff to get acquainted with clojure. But most functions need to rely on a global vars for screen width/height, and it seems clunky to pass these in each time. Obviuosly these are constants, but I'm wondering if this then taints the function
16:58Bronsanow my-f won't be affected by var redef :P
16:59tcrayford____imanc: I'd typically pass those in always
16:59tcrayford____it gets a bit more verbose, but you win in being able to test/maintain/etc
16:59raspasovyea generally I agree ^^
16:59imanctcrayford____: yeh, I've been wondernig about how to write unit tests for these also
16:59imancmakes sense
17:00Bronsaimanc: just pass in an opts arg to all your functions and use a map {:width .. :height ..}
17:00danlentzthanks to those that pointed out a potential race condition in my monotonic timestamp generator last night. I rewrote it based on the comments recieved: https://gist.github.com/danlentz/301a0f056ffd9c6605a9
17:01imanc@Bronsa cool, that sounds like a solution.
17:01Bronsadanlentz: why are you using MapEntry?
17:02danlentzi wanted a single cons cell
17:02danlentzie a pair
17:02tcrayford____seems better to just deftype or defrecord it
17:02tcrayford____(if that was for perf)
17:02Bronsadanlentz: (defrecord Pair [k v])
17:02danlentzi believe records are slower than types, no?
17:03Bronsano
17:03tcrayford____depends how much it matters
17:03danlentzit matters
17:03Bronsadanlentz: they are not slower
17:03tcrayford____Bronsa: yeah they are ;)
17:03danlentzi need a two slot tuple, i dont need a record with a map interace
17:03raspasovI believe deftype is more barebones than defrecord
17:03tcrayford____danlentz: in which case (deftype Pair [k v])
17:03danlentzim pretty sure deftype
17:04Bronsatcrayford____: no they are not. they just implement more abstractions
17:04danlentzbut i dont quite understand the reasoning why a mapentry would not be as fast
17:04danlentzas a custom deftype
17:04tcrayford____danlentz: that one isn't a perf arg
17:04tcrayford____just that it seems "odd" or "weird"
17:04danlentzoh
17:04danlentzyeah, yes weird
17:05danlentzim a common lisper I yearn for a cons cell :)
17:05tcrayford____Bronsa: records implement IMeta, so they inherit at least an additional function call on every `assoc` for example
17:05Bronsadanlentz: also there are key and val functions that work on mapentry anyway, no need to use .key/.val directly
17:05tcrayford____Bronsa: that's also very slightly slower ;)
17:05Bronsatcrayford____: moot argument, deftypes don't support assoc at all out of the box
17:06raspasovI've done something like this https://gist.github.com/raspasov/c3a45a669b74de717050
17:06raspasov(this will never return the same number)
17:06danlentznot thread safe
17:06danlentzis it?
17:07tcrayford____it is
17:07tcrayford____`synchronized`
17:07tcrayford____but uh, that involves a lock vs a CAS like your one does, so it might be slower
17:07raspasovyea I haven't benchmarked, but locks on longs are pretty damn fast I think
17:08Bronsatcrayford____: all I'm arguing is that it makes no sense to say "records are slower than types", they share the same implementation. the way one uses records might be slower than the way one uses types (i.e. (:foo x) vs (.foo x)) but you can still use the .foo syntax with records if you need that
17:08tcrayford____Bronsa: roughly agreed haha. If you start digging, they are *for sure* slower, even if you use the same syntax, but in most applications that ain't gonna matter so much
17:08Bronsaand keyword lookup on records is really fast anyway
17:09danlentzraspasov: i forked that gist tho thanks
17:09raspasovdanlentz: if you care for the utmost performance you should benchmark the atom's CAS vs (locking) macro in Clojure or some Java solution like I posted
17:09tcrayford____(you're starting to look at things like the extra memory allocation because defrecords store two extra pointers compared to deftype etc at that point though)
17:10raspasovdanlentz: np, cheers :)
17:10tcrayford____Bronsa: just depends how deep you're gonna dig, and at that point you should prolly be using C or C++ or Rust or something without a GC
17:10danlentzwell, there is some value is trying to be more idiomatic clojure rather than ‘locking’ or dropping to java
17:10raspasovyea def
17:10Bronsatcrayford____: whatever, I don't believe that instantiating two extra fields null will make any difference
17:11raspasovthis is pretty much the only bit of Java I've used lol
17:11tcrayford____Bronsa: I don't trust myself to benchmark at that level of performance ;)
17:11danlentzi just finished a weight balanced binary tree which was very very very sensitive to allocation
17:11danlentzi tried clj-tuple
17:11danlentzobject array
17:11danlentzand deftype
17:11raspasovdanlentz: what are you working on - some sort of storage/database?
17:11danlentzso, deftype and clj-tuple were about equivalent
17:12tcrayford____danlentz: note that clj-tuple had a new release yesterday evening that rewrites it in java
17:12tcrayford____(and zach says it's noticeably faster)
17:12danlentzbut, with deftype i was able to declare the last element as ^long, and i saved considerably,
17:12tcrayford____(not for any class/deftype reasons though - the code's better)
17:12danlentzah
17:12tcrayford____but yea, the type hint is a huge win there
17:12danlentzprobably due to my nagging and griping :)
17:13tcrayford____nah, I was griping at him haha ;)
17:13danlentzhttp://github.com/danlentz/clj-wbtree
17:13danlentzim still working on it but its within 10% of sorted-set
17:13tcrayford____danlentz: post your benchmarks in that repo
17:13raspasovcool!
17:14tcrayford____(and yea - looks dope)
17:14danlentzwbtree only typically will beat rbtree for very large collections, and also I have an extra cost because I have a “universal” ordering relation
17:14danlentzive really been learning a lot its been a really good exercise
17:15tcrayford____danlentz: how are you measuring performance?
17:15danlentzwell, specifically for building trees
17:16danlentzi dont have rigorous benchmarks, that is just a very rough estimation
17:17danlentzgoing to play with criterium
17:17justin_smithdanlentz: criterium is not hard to use
17:17tcrayford____would highly recommend it :)
17:17tcrayford____it's as easy as calling `time` from core
17:17tcrayford____just like, the numbers are kinda real
17:17danlentzbut first I had to get it at least in the ballpark — up until now it was like 20x slower than sorted set so my priority was on big fixes not high confidence measurement
17:17raspasovyea use Criterium https://github.com/hugoduncan/criterium it's very nice
17:17tcrayford____danlentz: that's mostly what I was asking there. Measuring performance on the JVM even somewhat accurately is near impossible ;)
17:18justin_smithguys, I think we need at least six people to tell danlentz to use criterium, if anyone else can pitch in
17:18tcrayford____things I've seen: run the same benchmark twice in the same JVM: second time is 4000x slower (note: *exactly* the same JVM)
17:18danlentzhey anybody know of a good library i can use?
17:18danlentz:)
17:18tcrayford____(that was specific to that benchmark)
17:18raspasovjustin_smith: yes I think so :D
17:20tcrayford____(lesson there: if you use criterium, you need a new JVM per benchmark, or the numbers will lie)
17:20danlentzthe monotonic timestamp is for my clj-uuid library so I needed that to be really fast so I can generate v1 uuid’s on multiple cores really fast
17:20danlentzhttp://github.com/danlentz/clj-uuid
17:21danlentzor reasonably fast anyway.
17:27justin_smithhaha, a var called +tick-resolution+ - you really do miss common lisp
17:27imancis there a decent debugger for clojure? Or do people generally resort to printing stuff to stdout? :)
17:27justin_smithimanc: best experience will likely be cursive
17:28imancahh
17:28imancgoogling
17:28cflemingimanc: https://cursiveclojure.com/userguide/
17:28justin_smithcursive is an editor plugin for doing clojure in the intellij idea ide
17:29cflemingimanc: I've just been working on the debugger recently, it works pretty well now. More improvements in the next release (in a week or so probably)
17:29imanccool - i use pycharm (intellij) so it should be easy to use
17:29cflemingYeah, it should all be familiar
17:30cflemingCursive can't plug into PyCharm unfortunately, although it might be able to in the future
17:30imancpresumably i can instlal a vanilla intellij and use that?
17:31cflemingYes
17:31cflemingWorks fine with the community edition
17:31imancawesome
17:32imancdo you guys generally use midje for writing tests?
17:32justin_smithclojure.test
17:33cflemingWhat justin_smith said
17:33cflemingGo for simple, IMO
17:33imanckoay
17:36glosoliHey. when I am in cider repl mode, I seem to get company mode completion every time I type some text, yet it doesn't seem to work that way when I am in cider mode, any ideas how to get the same thing in cider mode ?
17:37danlentzjustin_smith: i do love CL deeply but Clojure is my adopted home and I like it here
17:37justin_smithdanlentz: :)
17:38danlentzthe tooling is still a little painful
17:38justin_smithit's true, there are some rough edges compared to a decent cl
17:38danlentzeveryone I encourage you to go to gittip and donate a few dollars a month to bhatsov
17:39danlentzthe better the tooling, the more viable our language becomes to a wider marketplace
17:39justin_smithdanlentz: my experience has been better since I stopped using stuff by bbatsov actually
17:39danlentzhe does cider, no?
17:39justin_smithright
17:39o0rebelious0oI'm fairly new to using clojure having used it briefly over summer for a (pretty basic) DSL implementation but it's been really nice to look at and play with
17:39o0rebelious0oI hear #clojure is a pretty nice community unlike some other language IRCs
17:40danlentzi believe cider can overtake slime because it is architecturally more sound
17:40danlentzbut it has a way to go
17:40sobelo0rebelious0o: in my experience, it's comparable with #postgresql which is about as good as it gets on IRC
17:41danlentzin particular, although I never particularly loved the slime debugger, it was really really helpful as compared to clojure/cider’s error reporting
17:41tomjackwhen I switched to cider some months back, I thought I was very late wrt trends
17:41cflemingSorry, I missed this earlier: danlentz, you should be using criterium
17:42danlentzoh, criterium. right. totally forgot.
17:42imanco0rebelious0o: yeh, I have noticed that. People are cool on here.
17:42justin_smithhaha
17:42danlentzno i use cider
17:42o0rebelious0osobel: can't say I've ever used it
17:42danlentzbut for CL i used slime obviously
17:42danlentzslime for clojure was not very good by comparison
17:43justin_smithdanlentz: clojure breakpoint / step debugging is possible, but I think cursive is the only environment that really has it conveniently available.
17:43danlentzi never used it because it was mutually exclusive with my common-lisp slime installation. That actually prevented me from playing with clojure for a very long time
17:43danlentzcursive, huh?
17:43danlentzthats the intellij plugin?
17:44danlentzhmm
17:44danlentzpeople seem to like intellij
17:44sobelo0rebelious0o: if you end up needing postgresql support, you might just be glad to know there's a great channel for it
17:44cflemingdanlentz: Yeah, IntelliJ is really pretty amazing. Of course, it's a full-blown IDE which isn't to everyone's taste.
17:45danlentzcider has made dramatic improvement though. I think there has been a lot of time up front establishing a good framework
17:45cflemingdanlentz: But JetBrains are amazing when it comes to dev tooling
17:45danlentzabandoning legacy slime-derived approach
17:45sobelJetBrains have been doing great tooling for a very long time
17:45sobeltheir tools make Eclipse look like amateur hour tbh
17:46danlentzI used it for about 4-5 months during a scala gig over the summer. I don’t think emacs is even usable doing scala and I tried. Its awful
17:46sobeland i'm no eclipse hater
17:46rcbevansI've used intellij for java and python with pycharm, intrigued by c-lion too
17:46cflemingsobel: I hear Eclipse has come a long way in recent years, but I was traumatised by early versions - I haven't touched it for years
17:46rcbevansand android studio is based on it and that seems to work pretty great
17:46imancpycharm is nice- though I felt like a quitter ditching vim to use it
17:47cflemingimanc: There's nothing wrong with moving to pain-free tools
17:47rcbevanslars vogel seems to be doing a lot of work to push the eclipse foundation forward
17:48rcbevansI think they realised they were a bit long in the tooth in comparison
17:48rcbevansintellij seemed to not suffer from some of the sore spots I had with eclipse
17:49tbaldridgeI often wonder if Eclipse just suffers from the fact that it's not a commercial product
17:50cflemingtbaldridge: That, and it also really helps that all the JetBrains products are made by one company with a consistent vision - it's all really coherent.
17:50rcbevanscfleming: +1
17:51cflemingrcbevans: We use inc round here :)
17:51cfleming(inc rcbevans)
17:53rcbevansinc cfleming ah sorry, I'm pretty new to IRC, don't really know what I'm doing ^^
17:53rcbevans(inc cfleming) ah sorry, I'm pretty new to IRC, don't really know what I'm doing ^^
17:53sveriphpstorm lead me to intellij, pretty awesome too
17:53rcbevansoh wow, failing hard here
17:53cflemingHehe, no worries, it's more of an in-joke than anything
17:53Bronsarcbevans: no the bot is dead :(
17:53cflemingBronsa: That too
17:55pandeirofunny i just opened intellij for the firstish time
17:55Bronsacfleming: don't worry I'll write a note on paper, you'll get your inc
17:55pandeirototally overwhelmed
17:55imancsveri: yeh, I've used phpstorm also - hope to never use php again though. Causes outbreak of hives.
17:55rcbevanson clojure related stuff :), where is a good place to get started? I've been doing some project euler questions by myself, but I have no idea if the clojure I'm writing is really even good clojure for what i'm doing
17:56rcbevansare there any good resources to go through, I have the joy of clojure and O'Reilly clojure cookbook
17:56rcbevansi've seen 4clojure mentioned some places too
17:56imancrcbevans: I'm reading the JoC atm, and messing around with a nice gfx library called quil.
17:57raspasovrcbevans: I personally like http://clojurekoans.com/
17:57justin_smithrcbevans: for automated exercises, 4clojure and the clojure koans are decent
17:57raspasovrcbevans: also Aphyr's blog "Clojure from the ground up" series are excellent https://aphyr.com/posts/301-clojure-from-the-ground-up-welcome
17:58raspasovjust go through the blog and find "clojure from the ground up" - there's a bunch
17:58rcbevansthat looks ace
17:58rcbevanshadn't seen clojurekoans
17:58rcbevansI'll def give that a look
17:59rcbevansI was on the train friday and wanted to download an offline version of 4clojure, cloned a couple of 4clojure-offline type repos
17:59rcbevansneither seemed to work all that well though
17:59justin_smithrcbevans: 4clojure itself is open source
17:59justin_smiththough you wouldn't likely want to run it on your phone
18:00rcbevanswell I was on a laptop
18:00rcbevansdoes it have a repl type version? or just run a web stack and local copy of the site?
18:00justin_smithrcbevans: it's literally the code that runs the site
18:01rcbevansorly
18:01rcbevansprobs shoul have looked at that
18:01rcbevansah "Setup instructions for running locally"
18:02rcbevans*facepalm*
18:03andyfAnyone have recommendations for books or web sites that teaches about various aspects of web server development like: what is a session? where is it typically stored in a server and why? what is carried across a TCP socket that indicates the session, how secure is it, and why? between the level of a TCP socket and the web server, what do different web server containers/platforms do between them, and what are the relative
18:03andyfadvantages of each?
18:03justin_smithandyf: all of that could be cleared up by reading the code for ring
18:03justin_smithandyf: good question regarding an actual book though, that would be interesting to see
18:05imancandyf: maybe reading the source of some frameworks would answer those questions. E.g. sessions identifiers are stored in cookies, which are sent back to the browser on each request. The session data is then stored in whatever backend storage is configured - a file, a database, etc.
18:05andyfSo ring has one 'standard' method it uses for representing sessions, and it is good enough for most purposes? Or it allows multiple different implentations depending upon unique needs someone may have?
18:06justin_smithandyf: wrap-session is a middleware that attaches a hash-map to the request, under the key :session
18:07andyfimanc: Sessions tend to last over one to several dozen requests, typically? Is it important to store them in persistent storage on the server because they can last even longer? Or because of load balancing over different physical servers for different requests from the same user?
18:07justin_smithandyf: it can use configurable storage backends (I believe there is a protocol you can implement?) but the defaults are cookie or in-memory and in either case you can have an optional encryption key for the cookie
18:08justin_smithandyf: the default in-memory session storage is an atom (for ring's wrap-session) and maps from an identifier in the user's cookie to the data
18:08justin_smithandyf: the code to wrap-session, and the various things it calls, are relatively straightforward
18:08imancandyf: if you're load balancing then you need to remove any state from the appers. Often a medium such a memcached or redis, or a plain database running on external servers is used to persist session information
18:09sveriimanc: hehe and a lot of other things :D
18:09imanc* from the app servers
18:09imancsveri: yeh indeed
18:10andyfAre there web servers that don't bother storing sessions in persistent storage, keeping it only in memory?
18:10justin_smithandyf: sure, for things like login state
18:11justin_smithandyf: not onerous to require a user to log in again if the server restarts and you only have one server
18:11favetelinguisare there any tools i can use to read a XML file and generate clojure code?
18:11justin_smithandyf: typically the "log in"
18:11justin_smith will map some data from the db into app memory
18:11justin_smithwhich keeps further request times lower
18:12justin_smithfavetelinguis: generate code, or clojure data structures? clojure.xml is good for the latter
18:13favetelinguisjustin_smith: no i want to genereta arbitrary code
18:13justin_smithfavetelinguis: you'd have to design your own DSL for that I think.
18:13justin_smithbut I would use clojure.xml to implement it
18:14cflemingBronsa: Awesome, thanks! I need all I can get.
18:15Xackhm, currently modifying a leiningen template, wondering how i can test it without uploading to clojars
18:15justin_smithXack: lein install
18:16Xackahhh, thanks!
18:17Bronsacfleming: I too have been robbed of my internet points because of lazybot being offline in the past, nobody deserves this.
18:17justin_smithclearly my improvements were not sufficient
18:17justin_smithwe need a distributed lazy-bot array
18:17justin_smithwith redundant laziness in waiting
18:18Bronsajustin_smith: you failed us
18:18justin_smith(dec justin_smith)
18:20imancinstalling oracle java on ubuntu is a PITA
18:20justin_smithimanc: really?
18:20justin_smith(not in my experience)
18:21justin_smithimanc: any particular difficulty?
18:21imancmaybe i'm doing it wrong - I had to remove all trace of openjdk, download it into /usr/bin/java or something, and I'm now adding a PATH to porfile
18:21justin_smithimanc: that is like multiple layers of wrong
18:22imancyeh?
18:22justin_smithimanc: there is a directory called /etc/alternatives
18:22imancI'd hoped to be able to do apt-get install oraclejava :)
18:22justin_smithit's not free, so that's not an option
18:22imancso what do I need to do with etc/alternatives?
18:22justin_smithimanc: it contains symlinks. If you replace the symlink called java, with one pointing to the java you want, that becomes the default java command
18:22cflemingBronsa: There's no justice in this world. From what I can tell, it's all justin_smith's fault.
18:23imancahh OK
18:23imancso it overrides anything else
18:23justin_smithimanc: /etc/alternatives/ allows multiple versions of anything to be installed, but it establishes which one is the default
18:23danlentzjustin_smith: the correct answer was definitely use a custom type because i can declare both slots primitive
18:23justin_smithimanc: yeah, I have 5 jvms installed right now
18:23justin_smithdanlentz: oh, cool
18:23danlentz(deftype Pair [^short k ^long v])
18:23imancOK, that sounds cool
18:24danlentzhttps://gist.github.com/danlentz/301a0f056ffd9c6605a9
18:24justin_smithimanc: there is also an "update-alternatives" command, but all that does is automate the process of replacing the symlinks in /etc/alternatives to one pointing to the locations you want
18:24danlentzfwiw
18:24imanchow does that work with your JAVA_HOME and JRE_HOME env variables?
18:25justin_smithimanc: tbh I never set those, never have
18:25Bronsadanlentz: FWIW the type-hint at line 32 on the argvec is totally useless
18:25Bronsadanlentz: also deftype defines a ->Pair function, no need for `pair`
18:25imanci guess if java is in a public path, then there's no ned
18:26danlentzok, wait
18:26justin_smithimanc: if you do "ls -l /usr/bin/java" you'll see it is a symlink to "/etc/alternatives/java"
18:26danlentzthe ^Pair on the argvec avoids reflection on .k, .v no?
18:26justin_smithimanc: by replacing "/etc/alternatives/java" you decide which java gets run
18:27Bronsadanlentz: the type hint on current-state does, the one on [^Pair current-state] is useless
18:27justin_smith(and as I mentioned before, /etc/alternatives/java is also a symlink)
18:28cflemingBronsa: type hints are exclusively used for removing reflection in interop, right? There are no other subtle uses of them?
18:28danlentzthe ^Pair on the return val of the fn does not avoids reflection when adding the .k and .v of the result of swap?
18:28cflemingBronsa: I'm hoping to be able to mark unused hints in Cursive
18:28Bronsadanlentz: type hints on return value of fn only work in the context of defn
18:29danlentzok b/c new-state is Pair anyway
18:29danlentzBronsa: oh.
18:30danlentzgood tip.
18:30Bronsacfleming: eh, uhm they also affect method matching + primitive usage
18:30cflemingBronsa: Oh, right, the primitive hints work differently.
18:31BronsaI hate type hints.
18:31cflemingI hate metadata in general.
18:31Bronsathat too
18:31Bronsaand its weird evaluation semantics
18:31cflemingEspecially during macroexpansion
18:39imanchow do you install cursive?
18:42justin_smithimanc: https://cursiveclojure.com/userguide/
18:45andyfimanc: It is perfectly possible to install Oracle Java in your home dir on Ubuntu, and not worry about /etc/alternatives, /usr/bin, etc. But to do that you will need to set JAVA_HOME env variable, and add ${JAVA_HOME}/bin to your PATH.
18:46imancandyf: presumably $JAVA_HOME/jre/bin is also needed?
18:46imancas JRE_HOME
18:46andyfI've never needed to do that.
18:46imancahh - i followed some instuctions and did that
18:47andyfimanc: I guess I should say that when I've installed Oracle Java on Ubuntu this way, I was only using it from the command line, not from a web browser.
18:51andyfimanc: In the Oracle Java 1.8.0 JDK I have installed, jre/bin is a strict subset of what is in bin
19:00lodinI just realized that (defprotocol P (m [x])) (defrecord R [] Object (m [x] "m") P) (m (R.)) works.
19:01justin_smithlodin: is there a misplaced paren in that?
19:02justin_smithwait, why does P happen after the protocol impl for m?
19:02lodinjustin_smith: Exactly.
19:03justin_smithlodin that makes my brain cry
19:03lodinYou can put the interfaces anywhere, as long as the first things in an interface.
19:03lodins/things/thing/
19:03lodinerr, can. not. type.
19:04lodin"is an".
19:05lodinjustin_smith: It makes sense from a Java perspective, I guess.
19:08justin_smithI guess the ordering I have always seen was just a convention for clarity
19:28lodinjustin_smith: Yeah. My first assumption was that defrecord does what extend-type does.
19:44lodinjustin_smith: The sneaky thing is that you can write (defrecord R [...] P1 P2 (m ...)) if m is in both P1 and P2 and should be the same. (Of course, it's more likely that it shouldn't be the same, and then you have to use extend-type.)
19:44justin_smithweird
19:45lodinjustin_smith: defrecord also defines Java methods (.m in this case), and there can only be one Java method m.
19:46lodinOr can it nowadays? Haven't look at Java for several years.
20:25tcrayford____lodin: it's one method m per type signature
20:25tcrayford____you can have m(Object, Object) and m(Object) just fine
20:27lodintcrayford: Yeah, sure. Meant that you can't qualify the name with an interface (as you can in e.g. C# if I'm not mistaken).
20:30tcrayford____yeah, you cannot
20:30tcrayford____wouldn't be surprised if that went all the way down to the bytecode spec even ;)
20:42justin_s3ithjustin_s3ith: that sure is a weird irc client you have
21:22cflemingtomjack: I've fixed those bugs for the next drop
21:47tomjackcool
21:47tomjackthanks!
22:12cflemingtomjack: No problem, if you'd like to try a dev build with the fixes before I release let me know
23:09riceandbeansquestion
23:10riceandbeansI hear of more and more things moving to clojure, and I'm going to need to support it, but I find the JVM abhorrent, are there any viable implementations of clojure NOT in the JVM?
23:10dyresharkriceandbeans: clojureCLR?
23:10justin_s3ithriceandbeans: clr, or js (but that still needs to compile via the jvm)
23:11justin_s3ithriceandbeans: any particular reason for not liking the jvm?
23:13riceandbeansaside from security issues and inherent memory leaks, it also has same nasty networking tendencies that cause it to break in certain operating systems where it supports ipv6 only by tunneling through ipv4
23:15justin_s3ithcitation needed on inherent memory leaks, I have web servers stay up for months, and likey they would have stayed up for years except for restarting for code updates
23:16dyreshark^^
23:16riceandbeansJVMs leak, it's pretty much a feature
23:16justin_s3ithleast leaky vm I know of
23:16dyresharkhow have you determined that they leak memory?
23:17riceandbeansbecause you tell them a max amount of heap memory and they go 5x over and never stay within their bounds
23:17riceandbeansin all my years of SA work, never once seen a JVM stay within its bounds
23:17justin_s3ithriceandbeans: then you are saying you don't understand java's command line flags?
23:17rhg135also do native code even have limits?
23:18riceandbeansJVMs can have hard limits
23:18justin_s3ithrhg135: sure, OS imposed limits are always possible
23:18dyresharkrhg135: they do -- the OOM killer is a pretty hard limit to bypass ;)
23:18riceandbeanswhether or not they respect them is another thing
23:18rhg135oh well yeah, but that covers the jvm too lol
23:18justin_s3ithriceandbeans: in my experience, my vm dies when it is forced past the hard limit, and I have seen no exception to that
23:19riceandbeansI've just seen in take down servers in a cluster
23:19justin_s3ithalso the security concerns are when you are client side running unknown code, it's quite solid compared to the alternatives on the server side
23:20justin_s3ithand client side running unknown code is a crapshoot no matter what
23:20justin_s3ithanyway, yeah, clojure can run on the clr, but isn't as mature for that target
23:20riceandbeansyou have to submit to oracle, who's in bed with the us govt
23:20justin_s3ithit can compile to js, but from within a jvm process
23:20riceandbeansmost people lock at very specific jvm requirements
23:21riceandbeansmost people never patch their jvms
23:21justin_s3ithyou don't need oracle's jvm, there is openjdk, an open source project.
23:21riceandbeansoracle doesn't like to patch their jvms
23:21riceandbeanswhich comes from oracle
23:21justin_s3ithand I promise, that javascript engines you will find and the clr are less reliable and less secure than any recent jvm
23:21justin_s3ithseriously
23:21riceandbeansopenjdk is a product of oracle
23:22justin_s3ithit's an open source, community project, with backing from oracle
23:22riceandbeansclr means I'll have to run mono, which is hardly usable
23:22justin_s3ithriceandbeans: I guess you probably shouldn't use clojure at all
23:22rhg135clojureclr, riceandbeans but be warned
23:23riceandbeansopenjdk is a product of oracle, it's free, it's owned by them, it's partly gpl, but also has closed source and commercial parts in it too
23:23riceandbeansthe only official developer of the code is oracle
23:23justin_s3ithopenjdk is 100% open source
23:23justin_s3ithdebian ships it
23:23TEttingerriceandbeans: there's always Common Lisp, which also received a ton of Department of Defense funding back in the day
23:24justin_s3ithdebian won't even ship the emacs manual in the regular repos, because the license isn't permissive enough
23:24riceandbeansopenjdk is not in base
23:24riceandbeansit's in non-free
23:24rhg135icedtea compiles from source for me
23:25p_lSBCL is public domain, that's enough for "freedom"?
23:25riceandbeansin order to submit code to be part of openjdk you have to sign a waiver that you forfeit right to your code and surrender it to oracle and sun, and it has to be approved by oracle before it can be accepted
23:25dyresharkFWIW, twitter apparently uses OpenJDK with a few tweaks for their prod servers https://engineering.twitter.com/university/videos/twitter-scale-computing-with-openjdk
23:25justin_s3ithriceandbeans: I just went into aptitude, openjdk is not in nonfree
23:25dyresharkso if twitter chose to use it, chances are it's not *that bad* as a platform
23:25TEttingerI've personally been curious about alternative JVMs, like Avian, but that one's a pain to compile so that the standard lib has enough to run clojure
23:26riceandbeanstwitter doesn't care about security
23:26TEttingerlol
23:26scottjhttps://packages.debian.org/sid/openjdk-6-jdk
23:26justin_s3ithriceandbeans: that's a contributor agreement for inclusion in the official repo, not a condition for modifying the code
23:26dyresharkwhatever you say riceandbeans :)
23:26riceandbeansthey're as much in bed with feds as oracle and facebook
23:26dyresharkhave a nice night
23:27TEttingerwe sure end up with our fair share of conspiracy theorists here in #clojure. remember that one guy who wouldn't run any code that he couldn't read himself?
23:27riceandbeansif your basis for the argument is the larry ellison is a great guy and his company is awesome, so it's a great product, you're not going to convice me of anything
23:27justin_s3ithriceandbeans: similarly clojure has a contributor agreement that must be signed before they will consider including your code in the official codebase. It is open source, and you can fork and distribute it all you like without said agreement.
23:27justin_s3ithThis does not make it in any way nonfree software.
23:27scottjriceandbeans: https://packages.debian.org/search?keywords=openjdk&amp;searchon=names&amp;suite=stable&amp;section=main note the main at the end there
23:28TEttingerriceandbeans, you know the internet that you're using right now was once a DoD project?
23:29riceandbeansthat's new, because I used debian at 3.0, and stopped at 7.4, and it was throughout then, never in main
23:29riceandbeansdue to java's licensing
23:29scottjriceandbeans: we've never argued java is good because larry is a great guy, we always said it was ok because he is an ok sailor.
23:31riceandbeansI'm aware of arpanet
23:31raspasovI have a sequence that looks like this ([14227624954630003 3] [14227624954630004 4] [14227624954630005 5] [14227624954630006 6] [14227624954630007 7] [14227624954630008 8] [14227624954630009 9] [14227624954630010 10])
23:31justin_s3ithriceandbeans: anyway, you seem determined to hate the jvm, and it's not really worth my energy to expend much more effort convincing you otherwise. It sounds like you will likely be happier if you don't support clojure, and let people who want to use clojure go elsewhere.
23:31riceandbeansit's not that simple
23:31raspasov(reduce (fn [result new]
23:31raspasov [(conj (nth result 0) (nth new 0))
23:31raspasov (conj (nth result 1) (nth new 1))]) [(lazy-seq []) (lazy-seq [])] x)
23:31riceandbeanspuppet is going to be fully moving to clojure from ruby
23:31justin_s3ithraspasov: use a paste site please
23:31raspasovanything more idiomatic than this for splitting it into two collections?
23:32scottjriceandbeans: it's in main in squeeze, or debian 6.0
23:32justin_s3ithriceandbeans: yeah, I know some cool dudes who do clojure there
23:32riceandbeansthe entire project is being ported to clojure
23:32riceandbeansso anyone using puppet will need to support clojure
23:32justin_s3ithriceandbeans: I assure you that the clojure they are doing at puppet is not portable away from the jvm
23:33TEttinger$google avian jvm
23:33TEttingerno lazybot still?
23:33justin_s3ithamalloy or Raynes need to restart it, I don't have the permissions (though I do have a login on that server)
23:34riceandbeanswhatever happened to parrot?
23:34riceandbeanshttps://en.wikipedia.org/wiki/Comparison_of_Java_virtual_machines
23:34justin_s3ithriceandbeans: it's out there, and not really being used in anger from what I can gather
23:35justin_s3ithwait, parrot is the new perl vm
23:35justin_s3ithdid it ever have plans to support java?
23:35riceandbeansI thought it did
23:36justin_s3ithanyway, clojure is a bytecode compiler, so unless parrot is bytecode compatible with the jvm, it won't run clojure
23:36riceandbeansit supports a lot of languages
23:36justin_s3ithOK
23:36justin_s3ithclojure does not generate java, it directly generates bytecode
23:36justin_s3ithso you need either direct clojure support (which nobody has) or jvm bytecode compatibility (in other words you need to be a jvm)
23:37riceandbeansjvm bytecode is java
23:37justin_s3ithno
23:37justin_s3ithjava is a language
23:37justin_s3ithjvm bytecode is a machine language for a virtual machine
23:37justin_s3ithclojure generates bytecode, it does not generate java
23:38raspasovanything more idiomatic? thanks! :) https://gist.github.com/raspasov/499b9aa5d0b0d0b91bf8
23:40justin_s3ithraspasov: you could use destructuring like so - (fn [[r0 r1] [n0 n1]] [(conj r0 n0) (conj r1 n1)])
23:40tomjack[(map first x) (map second x)] ? :)
23:40raspasovyea that's true, I was looking for something even more than that :)
23:40justin_s3ithtomjack: heh
23:41raspasovtomjack: but that generates two sequences, doesn't it?
23:41justin_s3ithtomjack: the reduce has the advantage of only walking the input once
23:41justin_s3ithraspasov: yours generates two sequences too
23:41tomjackyeah, but I figure it's unlikely you care
23:41raspasovoh really?
23:41tomjackperhaps you do
23:41raspasovI mean
23:41raspasovI meant
23:41justin_s3ithraspasov: your result has two sequences inside it
23:41riceandbeansjustin_s3ith: so you're telling me, if I write hello world in clojure and I wrote the same in scala, and compiled it to bytecode, the bytecode would not be identical
23:41raspasovwalking it once, instead of two sequences - yes the result is two sequences
23:41justin_s3ithriceandbeans: absolutely not
23:42raspasovused the wrong language :)
23:42riceandbeansvvkvebkiuhcbtdthitebjgltrnuvdrhiunnfhkhhvtjv
23:42riceandbeansvvkvebkiuhcbjglklrndvdldultbrhejbjjfuuflbien
23:42justin_s3ithriceandbeans: both generate jvm bytecode, but they have different infrastructure for bootstrapping the runtime parts of their languages
23:42raspasovok thanks guys!
23:44justin_s3ithriceandbeans: on the other hand it is trivial to call java code from clojure, clojure code from java, scala code from clojure, clojure code from scala etc. etc.
23:48riceandbeansI was under the impression that JVM languages translated the parent language code to java before compiling
23:48justin_s3ithriceandbeans: none of the ones that are any good
23:48justin_s3ithjava the language sucks
23:48justin_s3iththe jvm byte code / vm is much better
23:49justin_s3ithanyway, I am turning in for the night, best of luck
23:49tomjackscala code from clojure, trivial? hmm
23:50justin_s3ithtomjack: it compiles to classes you can invoke via interop
23:50cflemingIt's relatively trivial but very ugly
23:50tomjackISTR looking only at classes and methods, it seemed nightmarish
23:50tomjackah, you just have to know what to look for I guess?
23:50justin_s3ithcfleming: pretty is a higher standard
23:50cflemingYeah, you have to know how it mangles its classes, and some understanding of how it encodes traits etc
23:51cflemingjustin_s3ith: No doubt.
23:51cflemingThere's a company near here using datomic with Scala clients, actually
23:51cflemingAlthough that's the other direction, of course